/* ==========================================================================
   Cookie Consent — Banner & Modal (E-01-01)
   ========================================================================== */

/* ---------- Banner ---------- */

.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-banner[hidden] {
    display: block !important;
    transform: translateY(100%);
    pointer-events: none;
}

.cc-banner.is-visible {
    transform: translateY(0);
    pointer-events: auto;
}

.cc-banner__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cc-banner__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4B5563;
}

.cc-banner__text a {
    color: #1B9AAA;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-banner__text a:hover {
    color: #167a87;
}

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (min-width: 769px) {
    .cc-banner__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 2rem;
    }

    .cc-banner__content {
        flex: 1;
        margin-right: 2rem;
    }

    .cc-banner__actions {
        flex-shrink: 0;
        flex-wrap: nowrap;
    }
}

/* ---------- Buttons ---------- */

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.cc-btn:focus-visible {
    outline: 2px solid #1B9AAA;
    outline-offset: 2px;
}

.cc-btn--accept {
    background: linear-gradient(135deg, #1B9AAA 0%, #22C55E 100%);
    color: #fff;
}

.cc-btn--accept:hover {
    box-shadow: 0 4px 12px rgba(27, 154, 170, 0.3);
}

.cc-btn--reject {
    background: transparent;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.cc-btn--reject:hover {
    background: #F9FAFB;
    color: #374151;
    border-color: #D1D5DB;
}

.cc-btn--settings {
    background: transparent;
    color: #1B9AAA;
    border: 1px solid #1B9AAA;
}

.cc-btn--settings:hover {
    background: rgba(27, 154, 170, 0.06);
}

.cc-btn--save {
    background: #F3F4F6;
    color: #374151;
}

.cc-btn--save:hover {
    background: #E5E7EB;
}

/* ---------- Modal ---------- */

.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cc-modal[hidden] {
    display: flex !important;
    opacity: 0;
    pointer-events: none;
}

.cc-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.cc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cc-modal__dialog {
    position: relative;
    width: 90%;
    max-width: 540px;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-modal.is-visible .cc-modal__dialog {
    transform: translateY(0) scale(1);
}

.cc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.cc-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1F2937;
}

.cc-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6B7280;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cc-modal__close:hover {
    background: #F3F4F6;
    color: #1F2937;
}

.cc-modal__close:focus-visible {
    outline: 2px solid #1B9AAA;
    outline-offset: 2px;
}

.cc-modal__body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cc-modal__intro {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4B5563;
}

.cc-modal__intro a {
    color: #1B9AAA;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Category ---------- */

.cc-category {
    padding: 1rem 0;
    border-bottom: 1px solid #F3F4F6;
}

.cc-category:last-child {
    border-bottom: none;
}

.cc-category__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cc-category__info {
    flex: 1;
}

.cc-category__title {
    margin: 0 0 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1F2937;
}

.cc-category__desc {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6B7280;
}

/* ---------- Toggle Switch ---------- */

.cc-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.125rem;
}

.cc-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.cc-toggle__label {
    display: block;
    cursor: pointer;
}

.cc-toggle__track {
    display: block;
    width: 44px;
    height: 24px;
    background: #D1D5DB;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

.cc-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.cc-toggle input:checked + .cc-toggle__label .cc-toggle__track {
    background: #1B9AAA;
}

.cc-toggle input:checked + .cc-toggle__label .cc-toggle__track::after {
    transform: translateX(20px);
}

.cc-toggle input:focus-visible + .cc-toggle__label .cc-toggle__track {
    outline: 2px solid #1B9AAA;
    outline-offset: 2px;
}

.cc-toggle--disabled .cc-toggle__label {
    cursor: not-allowed;
    opacity: 0.6;
}

.cc-toggle__status {
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 500;
    white-space: nowrap;
}

/* ---------- Modal Footer ---------- */

.cc-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #E5E7EB;
    background: #FAFAFA;
}

/* ---------- Mobile adjustments ---------- */

@media (max-width: 480px) {
    .cc-banner__actions {
        flex-direction: column;
    }

    .cc-banner__actions .cc-btn {
        width: 100%;
    }

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

    .cc-modal__footer {
        flex-direction: column-reverse;
    }

    .cc-modal__footer .cc-btn {
        width: 100%;
    }
}
