/* ═══════════════════════════════════════════════════════
   Jacobs Cake World — Premium Cookie Consent Banner CSS
   ═══════════════════════════════════════════════════════ */

/* Cookie Banner Container */
#jcw-cookie-banner-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 24px;
    pointer-events: none; /* Let clicks pass through outside the banner */
    font-family: 'Inter', sans-serif;
}

.jcw-cookie-banner {
    max-width: 820px;
    margin: 0 auto;
    background: var(--jcw-dark, #21140E); /* Dark Chocolate */
    color: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(216, 162, 74, 0.2); /* Soft Gold border */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 24px 32px;
    pointer-events: auto; /* Re-enable clicks for the banner content */
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.jcw-cookie-banner.jcw-cookie-banner--show {
    transform: translateY(0);
    opacity: 1;
}

.jcw-cookie-banner__content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jcw-cookie-banner__title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--jcw-secondary, #D8A24A); /* Gold Accent */
    margin: 0;
}

.jcw-cookie-banner__text {
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.jcw-cookie-banner__text a {
    color: var(--jcw-secondary, #D8A24A);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.jcw-cookie-banner__text a:hover {
    color: #ffffff;
}

/* Actions Section */
.jcw-cookie-banner__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.jcw-cookie-btn {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.jcw-cookie-btn--primary {
    background: var(--jcw-secondary, #D8A24A);
    color: var(--jcw-dark, #21140E);
}

.jcw-cookie-btn--primary:hover {
    background: #ffffff;
    color: var(--jcw-dark, #21140E);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(216, 162, 74, 0.3);
}

.jcw-cookie-btn--secondary {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.jcw-cookie-btn--secondary:hover {
	color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
}

.jcw-cookie-btn--link {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    padding: 12px 16px;
}

.jcw-cookie-btn--link:hover {
    color: #222;
}

/* ── PREFERENCES MODAL OVERLAY ── */
.jcw-cookie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(28, 15, 10, 0.5); /* Warm dark tint */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none; /* Block clicks when hidden (since wrapper has pointer-events: none) */
}

.jcw-cookie-modal-overlay.jcw-cookie-modal-overlay--show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Enable clicks when visible */
}

.jcw-cookie-modal {
    background: var(--jcw-dark, #21140E);
    border: 1px solid rgba(216, 162, 74, 0.2);
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.jcw-cookie-modal-overlay.jcw-cookie-modal-overlay--show .jcw-cookie-modal {
    transform: scale(1);
}

/* Modal Header */
.jcw-cookie-modal__header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(216, 162, 74, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jcw-cookie-modal__title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--jcw-secondary, #D8A24A);
    margin: 0;
}

.jcw-cookie-modal__close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 24px;
    transition: color 0.2s ease;
    padding: 4px;
    display: flex;
    align-items: center;
}

.jcw-cookie-modal__close:hover {
    color: var(--jcw-secondary, #D8A24A);
}

/* Modal Content */
.jcw-cookie-modal__body {
    padding: 24px 32px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.jcw-cookie-modal__intro {
    font-size: 13.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Preference Cards */
.jcw-cookie-pref-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.3s ease;
}

.jcw-cookie-pref-item:hover {
    border-color: rgba(216, 162, 74, 0.15);
}

.jcw-cookie-pref-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jcw-cookie-pref-item__title {
    font-size: 14.5px;
    font-weight: 600;
    color: #ffffff;
}

.jcw-cookie-pref-item__badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(216, 162, 74, 0.15);
    color: var(--jcw-secondary, #D8A24A);
    padding: 4px 8px;
    border-radius: 4px;
}

.jcw-cookie-pref-item__desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

/* Toggle Switch Styles */
.jcw-cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.jcw-cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.jcw-cookie-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
}

.jcw-cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

.jcw-cookie-switch input:checked + .jcw-cookie-slider {
    background-color: var(--jcw-secondary, #D8A24A);
}

.jcw-cookie-switch input:checked + .jcw-cookie-slider:before {
    transform: translateX(20px);
}

.jcw-cookie-switch input:disabled + .jcw-cookie-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Footer */
.jcw-cookie-modal__footer {
    padding: 20px 32px;
    border-top: 1px solid rgba(216, 162, 74, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Custom Scrollbar for Modal Body */
.jcw-cookie-modal__body::-webkit-scrollbar {
    width: 6px;
}
.jcw-cookie-modal__body::-webkit-scrollbar-track {
    background: transparent;
}
.jcw-cookie-modal__body::-webkit-scrollbar-thumb {
    background: rgba(216, 162, 74, 0.2);
    border-radius: 4px;
}
.jcw-cookie-modal__body::-webkit-scrollbar-thumb:hover {
    background: var(--jcw-secondary, #D8A24A);
}

/* Responsive Rules */
@media (max-width: 767px) {
    #jcw-cookie-banner-wrapper {
        padding: 16px;
    }
    
    .jcw-cookie-banner {
        padding: 20px 24px;
    }

    .jcw-cookie-banner__title {
        font-size: 18px;
    }

    .jcw-cookie-banner__actions {
        justify-content: stretch;
    }

    .jcw-cookie-banner__actions button,
    .jcw-cookie-banner__actions a {
        flex: 1;
        text-align: center;
    }

    .jcw-cookie-modal {
        max-height: 90vh;
    }

    .jcw-cookie-modal__header,
    .jcw-cookie-modal__body,
    .jcw-cookie-modal__footer {
        padding: 16px 20px;
    }
}
