/* ============================================
   COOKIE BANNER - ESTILOS
   ============================================ */

/* ============================================
   BANNER PRINCIPAL
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
}

.cookie-banner-visible {
    transform: translateY(0);
}

.cookie-banner-hidden {
    transform: translateY(100%);
    opacity: 0;
}

.cookie-banner-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-banner-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.cookie-banner-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white, #fff);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    animation: cookieIconPulse 3s infinite ease-in-out;
}

@keyframes cookieIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.cookie-banner-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.cookie-banner-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin: 0;
}

.cookie-policy-link {
    color: #fbbf24;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.cookie-policy-link:hover {
    color: #f59e0b;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ============================================
   BOTONES DEL BANNER
   ============================================ */
.cookie-btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #e94560 0%, #f59e0b 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.5);
}

.cookie-btn-reject {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.cookie-btn-settings {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.cookie-btn-settings:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fbbf24;
}

.cookie-btn-settings svg {
    transition: transform 0.3s ease;
}

.cookie-btn-settings:hover svg {
    transform: rotate(90deg);
}

/* ============================================
   PANEL DE CONFIGURACIÓN
   ============================================ */
.cookie-settings-panel {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-settings-panel.cookie-settings-open {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cookie-settings-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-settings-open .cookie-settings-container {
    transform: scale(1) translateY(0);
}

.cookie-settings-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-settings-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.cookie-settings-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cookie-settings-close:hover {
    background: rgba(233, 69, 96, 0.8);
    transform: rotate(90deg);
}

.cookie-settings-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-settings-intro {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* ============================================
   CATEGORÍAS DE COOKIES
   ============================================ */
.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-category {
    padding: 1.25rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: #e94560;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.08);
}

.cookie-category-required {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(251, 191, 36, 0.05) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-category-info {
    display: flex;
    gap: 0.875rem;
    flex: 1;
}

.cookie-category-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cookie-category-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.cookie-category-desc {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #e94560 0%, #f59e0b 100%);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(22px);
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.cookie-toggle-disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.cookie-toggle-disabled .cookie-toggle-slider {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

/* ============================================
   FOOTER DEL PANEL
   ============================================ */
.cookie-settings-footer {
    padding: 1.25rem 2rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.cookie-settings-footer .cookie-btn-reject {
    background: transparent;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.cookie-settings-footer .cookie-btn-reject:hover {
    background: #f3f4f6;
    color: #1f2937;
    border-color: #9ca3af;
}

.cookie-settings-footer .cookie-btn-accept {
    background: linear-gradient(135deg, #e94560 0%, #f59e0b 100%);
    color: #fff;
}

/* ============================================
   BOTÓN FLOTANTE
   ============================================ */
.cookie-floating-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fbbf24;
    border: 2px solid rgba(245, 158, 11, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: cookieFloatIn 0.5s ease-out 0.5s both;
}

@keyframes cookieFloatIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cookie-floating-btn:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: #fbbf24;
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.3);
}

.cookie-floating-btn::after {
    content: 'Cookies';
    position: absolute;
    right: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cookie-floating-btn:hover::after {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 1.25rem;
    }

    .cookie-banner-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }

    .cookie-banner-icon {
        margin: 0 auto;
        width: 48px;
        height: 48px;
    }

    .cookie-banner-text h3 {
        font-size: 1.1rem;
    }

    .cookie-banner-text p {
        font-size: 0.85rem;
    }

    .cookie-banner-buttons {
        justify-content: center;
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        min-width: 0;
        padding: 0.65rem 0.875rem;
        font-size: 0.8rem;
    }

    .cookie-settings-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 1rem;
    }

    .cookie-settings-header,
    .cookie-settings-body,
    .cookie-settings-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .cookie-settings-header h3 {
        font-size: 1.15rem;
    }

    .cookie-category {
        padding: 1rem;
    }

    .cookie-category-header {
        flex-direction: column;
    }

    .cookie-toggle {
        align-self: flex-end;
    }

    .cookie-settings-footer {
        flex-direction: column-reverse;
    }

    .cookie-settings-footer .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-floating-btn {
        width: 44px;
        height: 44px;
        bottom: 1rem;
        right: 1rem;
    }

    .cookie-floating-btn::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .cookie-banner-buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-category-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cookie-category-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-settings-panel,
    .cookie-settings-container,
    .cookie-btn,
    .cookie-toggle-slider,
    .cookie-floating-btn {
        transition: none !important;
        animation: none !important;
    }
}

.cookie-banner:focus-within {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}