/* ========================================
   COOKIE CONSENT BANNER
   GDPR-Compliant Cookie Management
   ======================================== */

.cookie-consent {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999;
    max-width: 420px;
    width: calc(100% - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    pointer-events: none;
}

.cookie-consent.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.cookie-consent__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cookie-consent__icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #B62727 0%, #8B1E1E 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.cookie-consent__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.cookie-consent__text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 16px;
}

.cookie-consent__text a {
    color: #B62727;
    text-decoration: underline;
    font-weight: 500;
}

/* Category Toggles */
.cookie-consent__categories {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.cookie-consent__categories.open {
    display: flex;
}

.cookie-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: border-color 0.2s;
}

.cookie-category:hover {
    border-color: #B62727;
}

.cookie-category__info {
    flex: 1;
    min-width: 0;
}

.cookie-category__name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 2px;
}

.cookie-category__desc {
    font-size: 0.72rem;
    color: #777;
    margin: 0;
    line-height: 1.4;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    min-width: 40px;
    margin-left: 12px;
}

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

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

.cookie-toggle__slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
}

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

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

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

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

/* Buttons */
.cookie-consent__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cookie-consent__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.cookie-consent__btn--accept {
    background: linear-gradient(135deg, #B62727 0%, #8B1E1E 100%);
    color: #fff;
}

.cookie-consent__btn--accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(182, 39, 39, 0.3);
}

.cookie-consent__btn--settings {
    background: #f1f3f5;
    color: #333;
}

.cookie-consent__btn--settings:hover {
    background: #e9ecef;
}

.cookie-consent__btn--reject {
    background: transparent;
    color: #888;
    padding: 8px 16px;
    font-size: 0.78rem;
}

.cookie-consent__btn--reject:hover {
    color: #333;
}

.cookie-consent__btn-row {
    display: flex;
    gap: 8px;
}

.cookie-consent__btn-row .cookie-consent__btn {
    flex: 1;
}

/* Settings open state */
.cookie-consent--expanded .cookie-consent__btn--settings {
    background: #B62727;
    color: #fff;
}

/* Floating reopen button */
.cookie-consent__reopen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #B62727 0%, #8B1E1E 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(182, 39, 39, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cookie-consent__reopen:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(182, 39, 39, 0.4);
}

.cookie-consent__reopen.visible {
    display: flex;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
    .cookie-consent {
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        padding: 18px;
        border-radius: 14px;
    }

    .cookie-consent__header {
        gap: 10px;
    }

    .cookie-consent__icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 1rem;
    }

    .cookie-consent__title {
        font-size: 0.95rem;
    }

    .cookie-consent__text {
        font-size: 0.8rem;
    }

    .cookie-consent__categories {
        max-height: 200px;
        padding: 10px;
    }

    .cookie-category {
        padding: 8px 10px;
    }

    .cookie-category__name {
        font-size: 0.78rem;
    }

    .cookie-category__desc {
        font-size: 0.68rem;
    }

    .cookie-consent__btn {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .cookie-consent__reopen {
        bottom: 12px;
        left: 12px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .cookie-consent {
        max-width: 380px;
        bottom: 16px;
        left: 16px;
    }
}
