/* =========================================================
   Cookie Consent — Banner & Modal Styles
   ========================================================= */

/* ---- Banner ---- */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    width: calc(100% - 40px);
    max-width: 1250px;
    z-index: 99990;
    background: #1b1d1cdb;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    animation: cookieSlideUp 0.45s ease-out both;
}

@keyframes cookieSlideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.cookie-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1280px;
    min-height: 150px;
    margin: 0 auto;
    padding: 20px 28px;
}

.cookie-banner__text {
    flex: 1 1 300px;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
}

.cookie-banner__link {
    color: #FFBF00;
    text-decoration: underline;
    margin-right: 10px;
}

.cookie-banner__link:hover {
    color: #e6ac00;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ---- Buttons ---- */
.cookie-btn {
    font-family: 'Kanit', sans-serif !important;
    font-size: 16px;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.cookie-btn--primary {
    background: #FFBF00;
    color: #1b1d1c;
    border: 2px solid #FFBF00;
}

.cookie-btn--primary:hover {
    background: #e6ac00;
    border-color: #e6ac00;
    color: #1b1d1c;
}

.cookie-btn--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.cookie-btn--secondary:hover {
    border-color: #fff;
    color: #fff;
}

.cookie-btn--outline {
    background: transparent;
    color: #333;
    border: 2px solid #aaa;
}

.cookie-btn--outline:hover {
    border-color: #555;
    color: #111;
}

/* ---- Modal Base ---- */
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 99995;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.cookie-modal--hidden {
    display: none !important;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.cookie-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 620px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    animation: cookieModalIn 0.3s ease-out both;
}

.cookie-modal--sm .cookie-modal__dialog {
    max-width: 520px;
}

@keyframes cookieModalIn {
    from {
        transform: scale(0.92) translateY(24px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.cookie-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #eee;
}

.cookie-modal__title {
    font-size: 17px;
    font-weight: 600;
    color: #1b1d1c;
    margin: 0;
}

.cookie-modal__title i {
    color: #FFBF00;
    margin-right: 6px;
}

.cookie-modal__close {
    background: none;
    border: none;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.cookie-modal__close:hover {
    color: #333;
}

.cookie-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cookie-modal__footer {
    padding: 14px 24px 18px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---- Category Item ---- */
.cookie-category-item {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.cookie-category-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f8f8;
}

.cookie-category-item__name {
    font-weight: 600;
    font-size: 15px;
    color: #1b1d1c;
    flex: 1;
}

.cookie-category-item__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-category-item__body {
    padding: 10px 16px 12px;
    font-size: 14px;
    color: #6f6f6f;
    line-height: 1.6;
    font-weight: 300;
}

.cookie-more-btn {
    font-size: 12px;
    color: #FFBF00;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.cookie-more-btn:hover {
    color: #e6ac00;
}

/* ---- Toggle Switch ---- */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: background 0.25s;
}

.cookie-toggle__slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.cookie-toggle input:checked + .cookie-toggle__slider {
    background-color: #FFBF00;
}

.cookie-toggle input:checked + .cookie-toggle__slider:before {
    transform: translateX(18px);
}

.cookie-toggle input:disabled + .cookie-toggle__slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Notice Only badge ---- */
.cookie-required-badge {
    font-size: 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 20px;
    padding: 2px 10px;
    white-space: nowrap;
}

/* ---- Detail list ---- */
.cookie-detail-entry {
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0;
}

.cookie-detail-entry:last-child {
    border-bottom: none;
}

.cookie-detail-entry__name {
    font-size: 13px;
    font-weight: 600;
    color: #1b1d1c;
    margin-bottom: 3px;
}

.cookie-detail-entry__desc {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .cookie-banner {
        bottom: 12px;
        width: calc(100% - 24px);
        border-radius: 12px;
    }

    .cookie-banner__inner {
        /* flex-direction: column; */
        align-items: flex-start;
        padding: 16px 16px;
    }

    .cookie-banner__text {
        font-size: 14px;
    }

    .cookie-banner__actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

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

    .cookie-modal__dialog {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-modal__footer {
        flex-direction: column;
    }

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

/* Tablet */
@media (min-width: 601px) and (max-width: 900px) {
    .cookie-banner {
        bottom: 16px;
        width: calc(100% - 32px);
    }

    .cookie-banner__inner {
        padding: 16px 20px;
    }

    .cookie-banner__text {
        font-size: 15px;
        flex: 1 1 100%;
    }

    .cookie-banner__actions {
        width: 100%;
        justify-content: flex-end;
    }
}
