/* 1. THE LAYOUT LOCK (Stops the "Drop") 
   Forces Selector and Panel into a single vertical column */
.gssf-faq-layout-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    clear: both !important;
    margin: 40px 0 !important;
}

/* 2. REGION SELECTOR (Locked to Top) */
.gssf-region-selector-outer {
    order: 1 !important;
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

.gssf-region-selector-outer label {
    display: block;
    font-weight: bold;
    color: #22401d;
    margin-bottom: 8px;
    font-family: sans-serif;
}

.gssf-region-dropdown {
    width: 25% !important;
    min-width: 220px !important;
    padding: 10px !important;
    border: 2px solid #22401d !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    color: #22401d !important;
    background: #fff !important;
}

/* 3. MASTER PANEL (Locked to Bottom) */
.gssf-master-ai-panel {
    order: 2 !important;
    display: block !important;
    width: 100% !important;
    border: 2px solid #22401d;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    font-family: sans-serif;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 4. HEADER & BADGE COLORS */
.gssf-panel-header {
    background: #22401d;
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gssf-panel-header h3 { color: #fff !important; margin: 0 !important; font-size: 1.4em; }
.gssf-panel-header small { opacity: 0.8; color: #fff; }

.live-intel-badge {
    background: #2ecc71;
    color: #22401d;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}

/* 4b. MONTH SELECTOR (replaces LIVE INTEL badge) */
.gssf-month-selector-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 4px !important;
    line-height: 1.1 !important;
}

.gssf-month-selector-label {
    color: #fff !important;
    font-size: 11px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    opacity: 0.9 !important;
    margin: 0 !important;
}

.gssf-month-selector-wrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #2ecc71 !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    line-height: 1 !important;
}

.gssf-month-selector-prefix {
    color: #22401d !important;
    font-size: 12px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 18px !important;
}

/*
 * Force the <select> to look like a plain inline label across all theme
 * states (focus/hover/active). Without !important most themes override the
 * background to white as soon as the user clicks the control.
 */
.gssf-master-ai-panel .gssf-month-dropdown,
.gssf-master-ai-panel .gssf-month-dropdown:focus,
.gssf-master-ai-panel .gssf-month-dropdown:hover,
.gssf-master-ai-panel .gssf-month-dropdown:active,
.gssf-master-ai-panel .gssf-month-dropdown:focus-visible {
    background-color: transparent !important;
    background-image: linear-gradient(45deg, transparent 50%, #22401d 50%),
                      linear-gradient(135deg, #22401d 50%, transparent 50%) !important;
    background-position: calc(100% - 8px) 50%, calc(100% - 4px) 50% !important;
    background-size: 4px 4px, 4px 4px !important;
    background-repeat: no-repeat !important;
    color: #22401d !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: inherit !important;
    font-weight: bold !important;
    font-size: 12px !important;
    line-height: 1 !important;
    height: 18px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 16px 0 0 !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    text-transform: none !important;
    text-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

@media (max-width: 600px) {
    /* Keep the header as a single row on mobile: title + sub-title on the
       left, green pill on the right (driven by `justify-content: space-between`
       inherited from the base rule). Allow flex-wrap as a graceful fallback
       on extremely narrow screens, but do NOT force the selector box to a
       new row with width:100% (that's what was stacking it below). */
    .gssf-panel-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .gssf-month-selector-box {
        align-items: flex-end !important;
    }
}

/* 5. FAQ ITEM STYLING */
.gssf-panel-content { padding: 25px; }

/* 5b. MONTH CONTAINERS
   All 12 months are rendered in the initial HTML for SEO. Only the
   container with `.active` is shown to the user. The AJAX response
   (region-faq.php) emits raw <details> items without these wrappers,
   so this rule does not affect post-load content swaps. */
.gssf-faq-month { display: none !important; }
.gssf-faq-month.active { display: block !important; }

/* Seasonal product list: panel must not clip rows below the fold */
.gssf-master-ai-panel:has(.gssf-seasonal-placement) {
    overflow: visible !important;
}

#gssf-ajax-faq-content .gssf-seasonal-placement,
#gssf-ajax-faq-content .gssf-spp-rows-fe,
#gssf-ajax-faq-content .gssf-spp-product-row {
    overflow: visible !important;
    max-height: none !important;
}

#gssf-ajax-faq-content .gssf-spp-product-row {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gssf-seasonal-placement .gssf-spp-h2 {
    max-width: 35em;
}

.faq-details-item {
    margin-bottom: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.faq-details-item summary {
    padding: 15px;
    font-weight: 700;
    color: #22401d;
    cursor: pointer;
    background: #f9f9f9;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-details-item summary::-webkit-details-marker { display: none; }

.plus-icon { color: #2ecc71; font-size: 1.2em; font-weight: bold; }

.faq-answer-content {
    padding: 18px;
    font-size: 15px;
    color: #444;
    line-height: 1.7;
    background: #fff;
    border-top: 1px solid #eee;
}

/* 6. VIDEO SECTION SPECIFIC (Dashed Green) */
.video-item {
    border: 2px dashed #2ecc71 !important;
    background: #f1f8f1 !important;
}

.video-item summary {
    color: #1b5e20 !important;
    background: transparent !important;
}

/* VIDEO TOGGLE LOGIC: Forces content to stay hidden unless [open] */
.video-item:not([open]) .faq-video-container {
    display: none !important;
}

.video-item[open] .faq-video-container {
    display: block !important;
    padding: 18px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #eee;
}

.faq-video-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #22401d;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(34, 64, 29, 0.3);
}

.faq-video-btn:hover {
    background: #2ecc71;
    color: #22401d !important;
}

/* 7. CLEANUP */
.weather-video-thumb { display: none !important; height: 0; visibility: hidden; }

/* 1. THE STAGE - This allows the 3D effect to happen */
#gssf-ajax-faq-content {
    perspective: 1500px; /* High value for a smooth, deep flip */
    transform-origin: top center; /* The 'Hinge' of the calendar */
    transition: transform 0.5s ease-in, opacity 0.4s ease-in;
    backface-visibility: hidden; /* Prevents flickering */
}

/* 2. THE FOLD OUT - Old page lifting up */
.gssf-folding {
    opacity: 0 !important;
    transform: rotateX(-95deg); /* Flips up towards the 'back' of the screen */
}

/* 3. THE UNFOLD - New page dropping down */
.gssf-unfolding {
    animation: calendarUnfold 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
}

/* 4. THE ANIMATION KEYFRAMES */
@keyframes calendarUnfold {
    0% {
        opacity: 0;
        transform: rotateX(90deg); /* Start tilted way out towards the user */
    }
    70% {
        transform: rotateX(-10deg); /* Slight overshoot for a 'paper' bounce */
    }
    100% {
        opacity: 1;
        transform: rotateX(0deg); /* Snap to perfectly flat */
    }
}

/* Optional: Add a slight shadow during the flip to make it look like paper */
#gssf-ajax-faq-content.gssf-unfolding {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 4px;
}

/* Seasonal product placement: mobile — light horizontal bleed (-10px/side), no calc width (full calc caused layout issues on some themes). */
@media (max-width: 768px) {
    .gssf-master-ai-panel {
        overflow: visible !important;
    }

    #gssf-ajax-faq-content.gssf-panel-content > .gssf-seasonal-placement {
        box-sizing: border-box !important;
        margin-left: -10px !important;
        margin-right: -10px !important;
        max-width: none !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    #gssf-ajax-faq-content.gssf-panel-content > .gssf-seasonal-placement .gssf-spp-fe-summary {
        padding-left: 14px !important;
        padding-right: 14px !important;
        gap: 10px !important;
    }

    #gssf-ajax-faq-content.gssf-panel-content > .gssf-seasonal-placement .gssf-spp-fe-body {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}