/* Cookie Banner (Bottom) */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 20000;
    transform: translateY(100%);
    transition: transform 300ms ease;
    padding: 32px 16px;
}

.cookie-banner.visible {
    transform: translateY(0);
}

/* Hide the close (X) button when the banner is hidden off-screen */
.cookie-banner:not(.visible) > .cookie-close {
    display: none;
}

.cookie-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10rem;
    max-width: 1430px;
    margin: 0 auto;
    position: relative;
    padding: 0;
}

/* Close Button (banner) */
.cookie-banner > .cookie-close {
    position: absolute;
    top: -18px;
    right: 16px;
    background: #fff;
    border: 1px solid #ccc;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 1;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cookie-banner > .cookie-close:hover {
    background: #f5f5f5;
}

/* Cookie Modal Overlay */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 20001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease, visibility 300ms ease;
    overflow-y: auto; /* allow overlay to scroll instead of modal */
    padding: 20px; /* keeps modal away from edges on small screens */
}

.cookie-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Prevent background scroll when cookie modal is open */
html.cookie-modal-open,
body.cookie-modal-open {
    overflow: hidden;
}

/* Cookie Modal */
.cookie-modal {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: none; /* show full modal without inner scrollbar */
    overflow: visible;
    position: relative;
    transform: scale(0.9);
    transition: transform 300ms ease;
}

.cookie-modal-overlay.visible .cookie-modal {
    transform: scale(1);
}

/* Close Button (modal) */
.cookie-modal .cookie-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cookie-modal .cookie-close:hover {
    background: #f5f5f5;
}

/* Content */
.cookie-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.cookie-text {
    flex: 1;
}

.cookie-title {
    font-size: 28px;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.cookie-description {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Actions */
.cookie-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

/* Desktop: place Accept All at far right inside modal */
.cookie-modal .cookie-actions {
    justify-content: space-between;
}
.cookie-modal .cookie-btn-all {
    margin-left: auto;
}

/* Tablet landscape (769–1023px): keep actions on one row with Accept All on right */
@media (min-width: 769px) and (max-width: 1370px) {
    .cookie-modal .cookie-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 16px;
    }

    .cookie-modal .cookie-btn {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .cookie-modal .cookie-btn-all {
        margin-left: auto;
    }
}

.cookie-text {
    flex: 0 0 auto;
    max-width: 50%;
    margin-right: auto;
}

.cookie-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
}

.cookie-btn-essential {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
}

.cookie-btn-essential:hover {
    background: #CAA260;
    color: #fff;
    border-color: #CAA260;
}

.cookie-btn-all {
    background: #CAA260;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Underline animation on hover only */
.cookie-btn-all::after {
    content: "";
    position: absolute;
    left: 20px;  /* match horizontal padding so line equals text width */
    right: 20px;
    bottom: 10px;
    height: 1px;
    background: #ffffff;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 300ms ease;
    opacity: 0.95;
}

.cookie-btn-all:hover {
    background: #CAA260; /* keep same color */
}

.cookie-btn-all:hover::after {
    transform: scaleX(1);
}

.cookie-btn-decline {
    background: transparent;
    color: #333;
    border: none;
    text-decoration: none;
    padding: 0; /* remove horizontal padding so line isn't extended */
    display: inline-block; /* shrink to text width */
    width: auto;
    position: relative;
}

.cookie-btn-decline:hover {
    color: #666;
}

/* Animated underline that retracts right -> left on hover */
.cookie-btn-decline::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: currentColor;
    transform: scaleX(1);
    transform-origin: right center;
    transition: transform 300ms ease;
}

.cookie-btn-decline:hover::after {
    transform: scaleX(0);
}


/* Cookie Preferences */
.cookie-preferences {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.preference-item {
    /* Use grid so the toggle column has a fixed width and all checkboxes align */
    display: grid;
    grid-template-columns: 1fr 100px; /* move toggle column a bit more to the right */
    align-items: center;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    background: #fafafa;
}

.preference-info h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.preference-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.preference-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* left align input + label */
    gap: 8px;
}

.preference-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #cca260; /* fallback for browsers that support it */
    /* custom checkbox to guarantee white checkmark */
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #cca260;
    background: #fff;
    border-radius: 2px;
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.preference-toggle input[type="checkbox"]:checked {
    background: #cca260;
    border-color: #cca260;
}

.preference-toggle input[type="checkbox"]::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 10px;
    border: solid #ffffff; /* white tick */
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -52%) rotate(45deg);
    opacity: 0;
}

.preference-toggle input[type="checkbox"]:checked::after {
    opacity: 1;
}

.preference-toggle label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 24px 14px;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 0;
    }
    
    .cookie-text {
        max-width: 100%;
        margin-right: 0;
    }
    
    .cookie-title {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .cookie-description {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .cookie-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }
    
    .cookie-btn {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Make the Decline underline match text width on mobile */
    .cookie-actions .cookie-btn-decline {
        width: auto !important;
        display: inline-block;
        align-self: center;
        padding: 8px 0;
        margin: 0 auto;
    }
    
    .cookie-banner > .cookie-close {
        top: -12px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,.15);
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 16px 12px;
    }
    
    .cookie-title {
        font-size: 20px;
    }
    
    .cookie-description {
        font-size: 13px;
    }
    
    .cookie-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Tablet to small-laptop: ensure buttons are fully visible (769px–1370px) */
@media (min-width: 769px) and (max-width: 1370px) {
    .cookie-banner-content {
        gap: 24px;
        padding: 0 12px;
        align-items: flex-start;
    }
    .cookie-text {
        max-width: 58%;
        margin-right: auto;
        text-align: left;
    }
    .cookie-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 12px;
        flex-wrap: nowrap;
        width: auto;
    }
    .cookie-btn {
        width: auto;
        white-space: nowrap;
        text-align: center;
        padding: 12px 20px;
        font-size: 12px;
    }
}

/* Cookie Modal Responsive */
@media (max-width: 768px) {
    .cookie-content {
        padding: 30px 20px;
        gap: 25px;
    }
    
    .cookie-title {
        font-size: 24px;
    }
    
    .cookie-description {
        font-size: 15px;
    }
    
    .cookie-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-btn {
        width: 100%;
        text-align: center;
    }
    
    .preference-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .preference-toggle {
        align-self: flex-start; /* keep left aligned on mobile as well */
    }
}

/* Laptop breakpoint: improve spacing and readability (1024–1366px) */
@media (min-width: 992px) and (max-width: 1366px) {
    .cookie-banner {
        padding: 28px 24px;
        box-shadow: 0 -8px 24px rgba(0,0,0,.18);
        border-top: 1px solid rgba(0,0,0,.08);
        background: #ffffff; /* ensure high contrast over footer */
    }
    .cookie-banner-content {
        max-width: 1120px;
        gap: 64px;
        padding: 0 10px;
    }
    .cookie-text {
        max-width: 58%;
    }
    .cookie-title {
        font-size: 26px;
        margin-bottom: 12px;
        font-weight: 600;
        color: #212529;
    }
    .cookie-description {
        font-size: 15px;
        line-height: 1.5;
        color: #495057;
    }
    .cookie-actions {
        gap: 20px;
    }
    .cookie-btn {
        padding: 12px 24px;
        font-size: 12px; /* consistent */
        font-weight: 600; /* increase legibility */
    }
    .cookie-btn-essential { border-color: #b8b8b8; }
    .cookie-btn-essential:hover { border-color: #8f8f8f; }
    .cookie-btn-all { background: #CAA260; }
    .cookie-btn-all:hover { background: #b8944f; }
    .cookie-close {
        top: -16px;
        right: 16px;
        border: 1px solid #d0d0d0;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,.15);
    }
}

/* Ensure modal action buttons sit on one row around ~1024px widths */
@media (min-width: 992px) and (max-width: 1100px) {
    .cookie-modal .cookie-actions {
        width: 100%;
        flex-direction: row; /* override tablet column layout */
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .cookie-modal .cookie-btn {
        white-space: nowrap;
        flex: 0 0 auto;
    }
}


