/* ============================================
 * Guidy Contents Menu — v1.2.0
 * Overton Cloud
 * ============================================ */

/* ── Wrapper ── */
.guidy-cm-wrapper {
    display: flex;
    position: relative;
}

.guidy-cm-wrapper *,
.guidy-cm-wrapper *::before,
.guidy-cm-wrapper *::after {
    box-sizing: border-box;
}

/* ── Trigger Wrapper ── */
.guidy-cm-trigger-wrap {
    display: flex;
    justify-content: inherit;
    position: relative;
    z-index: 3;
}

.guidy-cm-trigger-wrap--fixed {
    position: fixed;
    top: 24px;
    right: 24px;
}

.guidy-cm-trigger-wrap--absolute {
    position: absolute;
    top: 24px;
    right: 24px;
}

/* ── Trigger Button ── */
.guidy-cm-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 14px;
    border: none;
    border-radius: 16px;
    background-color: #ffffff;
    color: #0f0f0f;
    cursor: pointer;
    box-shadow: rgba(15, 15, 15, 0.25) 0px 25px 50px 0px;
    transition: all 200ms ease;
    font-size: 15px;
    font-weight: 500;
    line-height: 24px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 3;
}

.guidy-cm-trigger:hover {
    transform: translateY(-1px);
    box-shadow: rgba(15, 15, 15, 0.3) 0px 30px 60px 0px;
}

.guidy-cm-trigger:active {
    transform: translateY(0);
}

/* When open, flatten the trigger shadow so the panel shadow takes over */
.guidy-cm--open .guidy-cm-trigger-wrap .guidy-cm-trigger {
    box-shadow: none;
    transform: none;
}

.guidy-cm-trigger-label {
    font-weight: 500;
    line-height: 24px;
}

/* ── Hamburger Icon ── */
.guidy-cm-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 16px;
    height: 12px;
    flex-shrink: 0;
    gap: 3px;
}

.guidy-cm-hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #0f0f0f;
    border-radius: 8px;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.guidy-cm-hamburger-line--mid {
    width: 60%;
}

/* Single-line mode (default Guidy style): hide top & bottom, show only middle at full width */
.guidy-cm-hamburger--single .guidy-cm-hamburger-line--top,
.guidy-cm-hamburger--single .guidy-cm-hamburger-line--bot {
    opacity: 0;
    height: 0;
}

.guidy-cm-hamburger--single .guidy-cm-hamburger-line--mid {
    width: 100%;
}

/* Hamburger → X animation when open */
.guidy-cm--open .guidy-cm-trigger-wrap .guidy-cm-hamburger-line--top {
    opacity: 1;
    height: 2px;
    transform: translateY(5px) rotate(45deg);
}

.guidy-cm--open .guidy-cm-trigger-wrap .guidy-cm-hamburger-line--mid {
    opacity: 0;
    width: 0;
}

.guidy-cm--open .guidy-cm-trigger-wrap .guidy-cm-hamburger-line--bot {
    opacity: 1;
    height: 2px;
    transform: translateY(-5px) rotate(-45deg);
}

/* ── Backdrop ── */
.guidy-cm-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--guidy-anim-duration, 350ms) ease,
                visibility var(--guidy-anim-duration, 350ms) ease;
    z-index: 1;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.guidy-cm-wrapper.guidy-cm--open .guidy-cm-backdrop {
    opacity: 1;
    visibility: visible;
}

/* ── Overlay Panel (expands FROM the button) ── */
.guidy-cm-overlay {
    --guidy-anim-duration: 350ms;
    position: absolute;
    top: 0;
    right: 0;
    max-width: 520px;
    width: max-content;
    min-width: 320px;
    max-height: calc(100vh - 64px);
    overflow: hidden;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: rgba(15, 15, 15, 0.25) 0px 25px 50px 0px;
    z-index: 2;

    /* Closed: clip to the button area (top-right corner) */
    clip-path: inset(0 0 calc(100% - 44px) calc(100% - 140px) round 16px);
    visibility: hidden;
    transition: clip-path var(--guidy-anim-duration) cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0ms linear var(--guidy-anim-duration);
}

.guidy-cm-overlay::-webkit-scrollbar {
    width: 6px;
}

.guidy-cm-overlay::-webkit-scrollbar-track {
    background: transparent;
}

.guidy-cm-overlay::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

/* Open: reveal the full panel */
.guidy-cm--open .guidy-cm-overlay {
    clip-path: inset(0 0 0 0 round 20px);
    visibility: visible;
    overflow-y: auto;
    transition: clip-path var(--guidy-anim-duration) cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0ms linear 0ms;
}

/* ── Overlay Header ── */
.guidy-cm-overlay-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 14px 10px 32px;
    min-height: 44px;
    position: sticky;
    top: 0;
    background-color: inherit;
    z-index: 4;
}

.guidy-cm-overlay-title {
    font-size: 13px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: auto;
}

/* Close button inside overlay */
.guidy-cm-trigger--close {
    margin-left: auto;
    box-shadow: none;
    background-color: transparent;
    padding: 6px 12px 6px 8px;
    border-radius: 12px;
}

.guidy-cm-trigger--close:hover {
    background-color: #f5f5f5;
    box-shadow: none;
    transform: none;
}

/* ── Close Icon ── */
.guidy-cm-close-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    position: relative;
    flex-shrink: 0;
}

.guidy-cm-close-line {
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: currentColor;
    border-radius: 8px;
}

.guidy-cm-close-line--1 {
    transform: rotate(45deg);
}

.guidy-cm-close-line--2 {
    transform: rotate(-45deg);
}

/* ── Overlay Inner ── */
.guidy-cm-overlay-inner {
    padding: 0 32px 32px;
}

/* ── Items Grid ── */
.guidy-cm-items-grid {
    display: grid;
    gap: 4px;
}

.guidy-cm-cols-1 { grid-template-columns: 1fr; }
.guidy-cm-cols-2 { grid-template-columns: 1fr 1fr; }
.guidy-cm-cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Menu Item ── */
.guidy-cm-item {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background-color: transparent;
    position: relative;
    opacity: 0;
    transform: translateY(8px) translateX(0);
    /* Default transition for hover (only applies once items are settled) */
    transition: background-color 200ms ease,
                transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Entrance animation (stagger) ── */
.guidy-cm--open .guidy-cm-item {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.guidy-cm-wrapper[data-stagger="yes"].guidy-cm--open .guidy-cm-item {
    transition: background-color 200ms ease,
                transform 400ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: calc(80ms + var(--guidy-item-index, 0) * 50ms);
}

.guidy-cm-wrapper:not([data-stagger="yes"]).guidy-cm--open .guidy-cm-item {
    transition: background-color 200ms ease,
                transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 100ms;
}

/* Once entrance is done, JS adds this class to kill stagger delay on hover */
.guidy-cm--settled .guidy-cm-item {
    transition-delay: 0ms !important;
    transition: background-color 200ms ease,
                transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Closing — snap back quickly */
.guidy-cm-wrapper:not(.guidy-cm--open) .guidy-cm-item {
    transition: opacity 100ms ease, transform 100ms ease;
}

/* ── Hover: slide left ── */
.guidy-cm--open .guidy-cm-item:hover {
    background-color: #f5f5f5;
    transform: translateY(0) translateX(-15px);
}

.guidy-cm-item:active {
    transform: translateY(0) translateX(-15px) scale(0.98) !important;
}

/* Disable hover slide when toggled off */
.guidy-cm-wrapper[data-hover-slide=""] .guidy-cm--open .guidy-cm-item:hover,
.guidy-cm-wrapper:not([data-hover-slide="yes"]) .guidy-cm--open .guidy-cm-item:hover {
    transform: translateY(0) translateX(0);
}

.guidy-cm-wrapper[data-hover-slide=""] .guidy-cm-item:active,
.guidy-cm-wrapper:not([data-hover-slide="yes"]) .guidy-cm-item:active {
    transform: translateY(0) translateX(0) scale(0.98) !important;
}

.guidy-cm-item--divider {
    border-bottom: 1px solid #e5e5e5;
    border-radius: 0;
}

/* ── Item Number ── */
.guidy-cm-item-number {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #999999;
}

/* ── Item Text ── */
.guidy-cm-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guidy-cm-item-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: #0f0f0f;
}

.guidy-cm-item-subtitle {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: #666666;
}

/* ── Item Icon ── */
.guidy-cm-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    color: #0f0f0f;
    transition: color 180ms ease;
}

.guidy-cm-item-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: fill 180ms ease;
}

.guidy-cm-item-icon--has-bg {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 10px;
}

/* ── Layout: Stacked (default) ── */
.guidy-cm-item.guidy-cm-item--layout-stacked {
    /* flex-direction: column — set by Elementor selector */
}

.guidy-cm-item.guidy-cm-item--layout-stacked .guidy-cm-item-icon {
    margin-bottom: 8px;
}

/* ── Layout: Icon Top (centred) ── */
.guidy-cm-item.guidy-cm-item--layout-icon-top {
    /* flex-direction: column — set by Elementor selector */
    align-items: center;
}

.guidy-cm-item.guidy-cm-item--layout-icon-top .guidy-cm-item-icon {
    margin-bottom: 8px;
}

.guidy-cm-item.guidy-cm-item--layout-icon-top .guidy-cm-item-text {
    text-align: center;
}

.guidy-cm-item.guidy-cm-item--layout-icon-top .guidy-cm-item-number {
    text-align: center;
}

.guidy-cm-item.guidy-cm-item--layout-icon-top .guidy-cm-item-badge {
    align-self: center;
}

/* ── Layout: Inline Right (text left, icon right) ── */
.guidy-cm-item.guidy-cm-item--layout-inline-right {
    /* flex-direction: row-reverse — set by Elementor selector */
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.guidy-cm-item.guidy-cm-item--layout-inline-right .guidy-cm-item-icon {
    margin-bottom: 0;
}

.guidy-cm-item.guidy-cm-item--layout-inline-right .guidy-cm-item-text {
    flex: none;
    min-width: 0;
}

.guidy-cm-item.guidy-cm-item--layout-inline-right .guidy-cm-item-badge {
    margin-left: auto;
}

/* ── Layout: Inline Left (icon left, text right) ── */
.guidy-cm-item.guidy-cm-item--layout-inline-left {
    /* flex-direction: row — set by Elementor selector */
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.guidy-cm-item.guidy-cm-item--layout-inline-left .guidy-cm-item-icon {
    order: 0;
    margin-bottom: 0;
}

.guidy-cm-item.guidy-cm-item--layout-inline-left .guidy-cm-item-text {
    order: 1;
    flex: none;
    min-width: 0;
}

.guidy-cm-item.guidy-cm-item--layout-inline-left .guidy-cm-item-number {
    order: -1;
}

.guidy-cm-item--layout-inline-left .guidy-cm-item-badge {
    order: 3;
}

/* ── Badge ── */
.guidy-cm-item-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    color: #0f0f0f;
    background-color: #f0f0f0;
    border-radius: 6px;
    margin-top: 2px;
}

/* ── Body scroll lock ── */
body.guidy-cm-body-locked {
    overflow: hidden;
}

/* ── Fixed mode: overlay + backdrop must also be fixed ── */
.guidy-cm-wrapper--pos-fixed .guidy-cm-overlay,
.guidy-cm-wrapper--pos-fixed .guidy-cm-backdrop {
    position: fixed;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .guidy-cm-cols-2,
    .guidy-cm-cols-3 {
        grid-template-columns: 1fr;
    }

    .guidy-cm-overlay {
        min-width: 280px;
        max-width: calc(100vw - 24px);
    }

    .guidy-cm-overlay-inner {
        padding: 0 24px 24px;
    }

    .guidy-cm-overlay-header {
        padding-left: 24px;
        padding-right: 14px;
    }
}

/* ── Editor preview: show overlay expanded inline ── */
.elementor-editor-active .guidy-cm-overlay {
    position: relative;
    top: auto;
    right: auto;
    clip-path: none;
    visibility: visible;
    overflow: visible;
    margin-top: 8px;
}

.elementor-editor-active .guidy-cm-backdrop {
    display: none;
}

.elementor-editor-active .guidy-cm-wrapper {
    flex-direction: column;
    align-items: flex-end;
}

.elementor-editor-active .guidy-cm-item {
    opacity: 1;
    transform: none;
}
