/**
 * Cookie Consent Banner Styles
 * GDPR/LGPD compliant - matches BestHouseDecor design system
 */

/* ==========================================================================
   1. BANNER BASE
   ========================================================================== */

.CookieConsent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #FFFFFF;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 1.5em;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-family: inherit;
}

.CookieConsent.is-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   2. BANNER CONTENT
   ========================================================================== */

.CookieConsent-content {
    max-width: 75em;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5em;
}

.CookieConsent-text {
    flex: 1;
    min-width: 280px;
}

.CookieConsent-title {
    font-size: 1.125em;
    font-weight: 600;
    color: #0D0C0B;
    margin-bottom: 0.5em;
}

.CookieConsent-desc {
    font-size: 0.9375em;
    line-height: 1.5;
    color: #4A4845;
    margin: 0;
}

.CookieConsent-link {
    color: #8B7355;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.CookieConsent-link:hover {
    color: #6B5A45;
}

/* ==========================================================================
   3. ACTION BUTTONS
   ========================================================================== */

.CookieConsent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
}

.CookieConsent-btn {
    padding: 0.75em 1.5em;
    font-size: 0.9375em;
    font-weight: 500;
    border-radius: 0.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    white-space: nowrap;
    font-family: inherit;
}

.CookieConsent-btn:focus {
    outline: 2px solid #8B7355;
    outline-offset: 2px;
}

/* Primary Button - Accept */
.CookieConsent-btn--primary {
    background: #8B7355;
    color: #FFFFFF;
    border-color: #8B7355;
}

.CookieConsent-btn--primary:hover {
    background: #6B5A45;
    border-color: #6B5A45;
}

/* Secondary Buttons - Reject & Settings */
/* GDPR: Equal visual weight to Accept button */
.CookieConsent-btn--secondary {
    background: #FFFFFF;
    color: #8B7355;
    border-color: #8B7355;
}

.CookieConsent-btn--secondary:hover {
    background: #FAF8F5;
    color: #6B5A45;
    border-color: #6B5A45;
}

/* ==========================================================================
   4. SETTINGS PANEL
   ========================================================================== */

.CookieConsent-settings {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    padding: 1.5em;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.CookieConsent-settings.is-visible {
    display: block;
    transform: translateY(0);
}

.CookieConsent-settingsHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 50em;
    margin: 0 auto 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid #E8E5E0;
}

.CookieConsent-settingsTitle {
    font-size: 1.25em;
    font-weight: 600;
    color: #0D0C0B;
    margin: 0;
}

.CookieConsent-settingsClose {
    width: 2.5em;
    height: 2.5em;
    padding: 0.5em;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4A4845;
    border-radius: 0.375em;
    transition: background 0.2s ease;
}

.CookieConsent-settingsClose:hover {
    background: #F0EDE8;
}

.CookieConsent-settingsClose:focus {
    outline: 2px solid #8B7355;
    outline-offset: 2px;
}

.CookieConsent-settingsClose svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   5. COOKIE CATEGORIES
   ========================================================================== */

.CookieConsent-categories {
    max-width: 50em;
    margin: 0 auto 1.5em;
}

.CookieConsent-category {
    padding: 1.25em;
    background: #FAF8F5;
    border-radius: 0.5em;
    margin-bottom: 0.75em;
}

.CookieConsent-category:last-child {
    margin-bottom: 0;
}

.CookieConsent-categoryHeader {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-bottom: 0.5em;
}

.CookieConsent-categoryName {
    font-size: 1em;
    font-weight: 600;
    color: #0D0C0B;
}

.CookieConsent-required {
    font-size: 0.8125em;
    font-weight: 400;
    color: #7A756E;
}

.CookieConsent-categoryDesc {
    font-size: 0.875em;
    line-height: 1.5;
    color: #5C5854;
    margin: 0;
    padding-left: 3.5em;
}

/* ==========================================================================
   6. TOGGLE SWITCH
   ========================================================================== */

.CookieConsent-toggle {
    position: relative;
    display: inline-block;
    width: 3em;
    height: 1.75em;
    flex-shrink: 0;
}

.CookieConsent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.CookieConsent-toggleSlider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #C8C4BE;
    transition: 0.3s;
    border-radius: 1em;
}

.CookieConsent-toggleSlider:before {
    position: absolute;
    content: "";
    height: 1.25em;
    width: 1.25em;
    left: 0.25em;
    bottom: 0.25em;
    background-color: #FFFFFF;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.CookieConsent-toggle input:checked + .CookieConsent-toggleSlider {
    background-color: #8B7355;
}

.CookieConsent-toggle input:checked + .CookieConsent-toggleSlider:before {
    transform: translateX(1.25em);
}

.CookieConsent-toggle input:focus + .CookieConsent-toggleSlider {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #8B7355;
}

.CookieConsent-toggle input:disabled + .CookieConsent-toggleSlider {
    background-color: #8B7355;
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   7. SETTINGS ACTIONS
   ========================================================================== */

.CookieConsent-settingsActions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75em;
    max-width: 50em;
    margin: 0 auto;
    padding-top: 1em;
    border-top: 1px solid #E8E5E0;
}

/* ==========================================================================
   8. RESPONSIVE STYLES
   ========================================================================== */

/* Tablet and below */
@media screen and (max-width: 48em) {
    .CookieConsent {
        padding: 1.25em;
    }

    .CookieConsent-content {
        flex-direction: column;
        align-items: stretch;
    }

    .CookieConsent-text {
        text-align: center;
    }

    .CookieConsent-actions {
        justify-content: center;
    }

    .CookieConsent-btn {
        flex: 1;
        min-width: 0;
        padding: 0.875em 1em;
    }

    .CookieConsent-settings {
        padding: 1.25em;
        max-height: 85vh;
    }

    .CookieConsent-categoryDesc {
        padding-left: 0;
        margin-top: 0.5em;
    }

    .CookieConsent-settingsActions {
        flex-direction: column;
    }

    .CookieConsent-settingsActions .CookieConsent-btn {
        width: 100%;
    }
}

/* Mobile small */
@media screen and (max-width: 30em) {
    .CookieConsent {
        padding: 1em;
    }

    .CookieConsent-title {
        font-size: 1em;
    }

    .CookieConsent-desc {
        font-size: 0.875em;
    }

    .CookieConsent-actions {
        flex-direction: column;
    }

    .CookieConsent-btn {
        width: 100%;
        text-align: center;
    }

    .CookieConsent-category {
        padding: 1em;
    }
}

/* ==========================================================================
   9. PRINT STYLES
   ========================================================================== */

@media print {
    .CookieConsent {
        display: none !important;
    }
}

/* ==========================================================================
   10. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .CookieConsent,
    .CookieConsent-settings,
    .CookieConsent-toggleSlider,
    .CookieConsent-toggleSlider:before,
    .CookieConsent-btn {
        transition: none;
    }
}

/* ==========================================================================
   11. HIGH CONTRAST MODE
   ========================================================================== */

@media (prefers-contrast: high) {
    .CookieConsent {
        border-top: 2px solid #0D0C0B;
    }

    .CookieConsent-btn--secondary {
        border-width: 3px;
    }

    .CookieConsent-toggle input:focus + .CookieConsent-toggleSlider {
        box-shadow: 0 0 0 3px #000000;
    }
}
