/* Symptom picker - self-hosted component, no third-party code.
   Works with zero JS: every .sp-panel is visible by default (normal
   flow, no max-height cap). JS adds .js to <html> very early, which is
   what gates the collapsed/animated accordion-or-tabs behavior below -
   nothing is ever preselected; every item starts closed. */

.sp-section {
    padding: 4rem 1.5rem 5rem;
    background: #ffffff;
    position: relative;
}

.sp-card {
    max-width: 950px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
}

.sp-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 2rem;
}

.sp-heading {
    font-family: 'Barlow', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #111111;
    margin-bottom: 0.5rem;
}

.sp-subline {
    font-size: 1rem;
    color: #555555;
    font-weight: 500;
}

.sp-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sp-item {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.sp-tab {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: #ffffff;
    border: none;
    padding: 1rem 1.2rem;
    cursor: pointer;
    text-align: left;
    font-family: 'Inter', sans-serif;
    /* background/color/border-color are not compositor-friendly to animate,
       so these states just switch instantly (same pattern as .primary-btn
       elsewhere on the site, which also has no hover transition). */
}

.sp-tab:hover {
    background: rgba(217, 4, 41, 0.05);
}

.sp-tab-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-accent, #D90429);
}

.sp-tab-icon svg { width: 100%; height: 100%; }

.sp-tab-label {
    font-size: 1rem;
    font-weight: 700;
    color: #111111;
}

.sp-tab-chevron {
    margin-left: auto;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #999999;
    transition: transform 0.2s ease;
}

.js .sp-tab[aria-expanded="true"] .sp-tab-chevron {
    transform: rotate(180deg);
}

/* Selected/open symptom stays highlighted brand red regardless of
   layout mode; everything else stays neutral. */
.js .sp-tab[aria-expanded="true"] .sp-tab-label { color: var(--primary-accent, #D90429); }

/* Panel content - visible unconditionally with no JS */
.sp-panel-main { padding: 1.1rem 1.2rem 1.2rem; }

.sp-cause {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--primary-accent, #D90429);
    margin-bottom: 0.5rem;
}

.sp-cause-icon {
    width: 14px;
    height: 14px;
    margin-right: 0.3rem;
    vertical-align: -2px;
}

.sp-panel-heading {
    font-family: 'Barlow', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #111111;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.sp-panel-text {
    font-size: 0.95rem;
    color: #333333;
    line-height: 1.65;
    margin-bottom: 0.9rem;
}

.sp-safety {
    background: rgba(217, 4, 41, 0.07);
    border-left: 3px solid var(--primary-accent, #D90429);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    color: #5a1020;
    line-height: 1.55;
    margin-bottom: 1.1rem;
}

.sp-safety strong { color: var(--primary-accent, #D90429); }

.sp-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0 1.2rem 1.2rem;
}

.sp-btn {
    flex: 1;
    min-width: 160px;
    text-align: center;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.92rem;
    text-decoration: none;
    /* hover below only changes background/border-color, so there's nothing
       compositor-friendly to animate here - same instant-switch pattern as
       .primary-btn elsewhere on the site. */
}

.sp-btn-call {
    background: var(--primary-accent, #D90429);
    color: #ffffff;
    border: 2px solid var(--primary-accent, #D90429);
}

.sp-btn-call:hover {
    background: var(--secondary-accent, #A8001E);
    border-color: var(--secondary-accent, #A8001E);
}

.sp-btn-request {
    background: transparent;
    color: var(--primary-dark, #111111);
    border: 2px solid #d5d5d5;
}

.sp-btn-request:hover {
    border-color: var(--primary-dark, #111111);
}

.sp-learn-more {
    flex-basis: 100%;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-accent, #D90429);
    text-decoration: none;
}

.sp-learn-more:hover { text-decoration: underline; }

/* Emergency symptom (Call Now is already first in markup for every
   item, so it only needs extra visual weight here, not reordering) */
.sp-item.sp-emergency .sp-cause { font-size: 0.85rem; }
.sp-item.sp-emergency .sp-btn-call { font-size: 1.05rem; padding: 1rem 1.2rem; }

/* ===== No-JS baseline: every panel is simply visible, always ===== */
.sp-panel { display: block; }

/* =====================================================================
   JS-enabled (html.js): every panel starts closed, nothing preselected.
   Visibility is animated with max-height + overflow (not display), so
   it can transition smoothly; .sp-collapsed (added by JS only *after*
   the close transition finishes) removes it from layout entirely -
   that's what keeps the desktop tab row intact (see 1024px block).
   ===================================================================== */
.js .sp-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}
.js .sp-panel.sp-collapsed { display: none; }

@media (prefers-reduced-motion: reduce) {
    .js .sp-panel { transition: none; }
}

@media (min-width: 768px) {
    .sp-section { padding: 4rem 1.5rem 6rem; }
    .sp-card { padding: 3rem; }

    /* Tabs mode (JS-enabled only): icon-above-label tiles in a grid row,
       with the one open panel forming a full-width band underneath via
       CSS grid placement - no DOM moves needed. Collapsed panels get
       .sp-collapsed (display:none) from JS, which is what lets the grid
       auto-placement skip them entirely and keep every tab on one row. */
    .js .sp-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    .js .sp-item { display: contents; }
    .js .sp-tab {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        gap: 0.6rem;
        border: 2px solid #e5e5e5;
        border-radius: 12px;
        padding: 1.3rem 1rem;
    }
    .js .sp-tab-chevron { display: none; }
    .js .sp-tab[aria-expanded="true"] {
        background: var(--primary-accent, #D90429);
        border-color: var(--primary-accent, #D90429);
    }
    .js .sp-tab[aria-expanded="true"] .sp-tab-label,
    .js .sp-tab[aria-expanded="true"] .sp-tab-icon { color: #ffffff; }

    .js .sp-panel {
        grid-column: 1 / -1;
        border: 2px solid #f0f0f0;
        border-radius: 14px;
    }
    /* padding (not margin) so the gap is clipped away too when the
       panel is collapsed to max-height:0 - no dead space when closed */
    .js .sp-panel-main { padding: 1.8rem 1.8rem 1.8rem; margin-top: 1rem; }
    .js .sp-panel-actions {
        flex-direction: column;
        padding: 0 1.8rem 1.8rem;
    }
    .js .sp-panel-actions .sp-learn-more {
        flex-basis: auto;
        text-align: left;
        margin-top: 0.25rem;
    }
}

@media (min-width: 1024px) {
    .sp-section { padding: 0 1.5rem 6rem; }
    .sp-card {
        margin-top: -80px;
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.18);
        position: relative;
        z-index: 3;
    }
    .js .sp-list { grid-template-columns: repeat(4, 1fr); }

    /* The panel's own internal layout (65/35 columns) is independent of
       whether it's open - max-height:0 + overflow:hidden still fully
       clips a display:grid element, so this is safe to apply always. */
    .js .sp-panel {
        display: grid;
        grid-template-columns: 1.85fr 1fr;
        gap: 2.5rem;
        align-items: start;
    }
    .js .sp-panel-main { padding: 1.8rem 0 1.8rem; }
    .js .sp-panel-actions { padding: 0 0 1.8rem; }
}
