/* ══════════════════════════════════════════════
   Tide & Hive — Cookie consent banner styling
   ══════════════════════════════════════════════ */

#th-consent {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    max-width: 560px;
    margin: 0 auto;
    background: #FFFFFF;
    color: #0D1F29;
    border: 1px solid #E8E4DF;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(13,31,41,0.18);
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    padding: 22px 24px 20px;
    transform: translateY(140%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease;
}
#th-consent.is-visible {
    transform: translateY(0);
    opacity: 1;
}
#th-consent .th-consent-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: #0D1F29;
    margin: 0 0 6px;
}
#th-consent p {
    margin: 0 0 14px;
    color: #3A4A54;
    font-size: 13.5px;
}
#th-consent a {
    color: #0D1F29;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
#th-consent a:hover { color: #C19A2B; }

#th-consent .th-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
#th-consent button {
    flex: 1 1 auto;
    min-width: 110px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 11px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    line-height: 1.2;
}
#th-consent button:active { transform: translateY(1px); }
#th-consent .th-consent-accept {
    background: #0D1F29;
    color: #FFFFFF;
    border: 1px solid #0D1F29;
}
#th-consent .th-consent-accept:hover {
    background: #17333F;
    border-color: #17333F;
}
#th-consent .th-consent-reject {
    background: #FFFFFF;
    color: #0D1F29;
    border: 1px solid #0D1F29;
}
#th-consent .th-consent-reject:hover {
    background: #F7F5F2;
}
#th-consent .th-consent-prefs {
    background: transparent;
    color: #3A4A54;
    border: 1px solid #E8E4DF;
    flex: 0 0 auto;
    min-width: 0;
    padding: 11px 14px;
}
#th-consent .th-consent-prefs:hover {
    border-color: #0D1F29;
    color: #0D1F29;
}

/* ── Preferences modal ───────────────────── */
#th-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(13,31,41,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
#th-consent-modal.is-visible {
    display: flex;
    opacity: 1;
}
#th-consent-modal .th-modal-card {
    background: #FFFFFF;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 28px 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    font-family: 'Outfit', -apple-system, sans-serif;
    color: #0D1F29;
}
#th-consent-modal h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #0D1F29;
}
#th-consent-modal .th-modal-intro {
    font-size: 13.5px;
    color: #3A4A54;
    margin: 0 0 18px;
    line-height: 1.6;
}
#th-consent-modal .th-prefs-row {
    border-top: 1px solid #E8E4DF;
    padding: 14px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
#th-consent-modal .th-prefs-row:last-of-type { border-bottom: 1px solid #E8E4DF; }
#th-consent-modal .th-prefs-row .th-prefs-info { flex: 1; }
#th-consent-modal .th-prefs-row h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #0D1F29;
    letter-spacing: 0.3px;
}
#th-consent-modal .th-prefs-row p {
    margin: 0;
    font-size: 13px;
    color: #3A4A54;
    line-height: 1.55;
}
#th-consent-modal .th-prefs-locked {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #1E7D4B;
    background: #E8F5E9;
    padding: 4px 8px;
    border-radius: 4px;
    align-self: center;
}

/* iOS-style toggle */
.th-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    align-self: center;
}
.th-toggle input { opacity: 0; width: 0; height: 0; }
.th-toggle .th-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e0;
    border-radius: 24px;
    transition: background 0.25s ease;
}
.th-toggle .th-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.th-toggle input:checked + .th-slider { background: #0D1F29; }
.th-toggle input:checked + .th-slider::before { transform: translateX(20px); }
.th-toggle input:focus-visible + .th-slider { box-shadow: 0 0 0 3px rgba(13,31,41,0.18); }

#th-consent-modal .th-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}
#th-consent-modal .th-modal-actions button {
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 11px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}
#th-consent-modal .th-modal-save {
    background: #0D1F29;
    color: #FFFFFF;
    border: 1px solid #0D1F29;
}
#th-consent-modal .th-modal-save:hover { background: #17333F; }
#th-consent-modal .th-modal-accept-all {
    background: #FFFFFF;
    color: #0D1F29;
    border: 1px solid #0D1F29;
}
#th-consent-modal .th-modal-accept-all:hover { background: #F7F5F2; }

/* ── Footer "Cookie settings" link helper ── */
.th-cookie-link {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.th-cookie-link:hover { color: #C19A2B; }

/* ── Small screens ───────────────────────── */
@media (max-width: 480px) {
    #th-consent {
        padding: 18px 18px 16px;
        font-size: 13.5px;
    }
    #th-consent .th-consent-actions { flex-direction: column; }
    #th-consent button { width: 100%; }
    #th-consent .th-consent-prefs { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
    #th-consent, #th-consent-modal, .th-toggle .th-slider, .th-toggle .th-slider::before {
        transition: none;
    }
}
