/* ================================================
   Osteoclot - Cookie Banner (RGPD/GDPR)
   Diseño premium: glassmorphism + animaciones suaves
   ================================================ */

/* --- Overlay de fondo (oscurece la web) --- */
.cookie-overlay {
    position: fixed;
    inset: 0;                          /* top/right/bottom/left: 0 */
    z-index: 9999;
    display: flex;
    align-items: flex-end;             /* Banner anclado al fondo */
    justify-content: center;
    padding: 0 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.45);  /* Overlay semitransparente */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    /* Estado inicial: invisible */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Estado visible (añadido por JS) */
.cookie-overlay--visible {
    opacity: 1;
    pointer-events: all;
}

/* Animación de salida */
.cookie-overlay--hiding {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

/* --- Tarjeta del banner --- */
.cookie-banner {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.18),
        0 4px 16px rgba(26, 122, 90, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(26, 122, 90, 0.15);
    padding: 2rem 2rem 1.75rem;
    max-width: 720px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;

    /* Animación de entrada desde abajo */
    transform: translateY(40px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Icono decorativo --- */
.cookie-icon-wrap {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #e8f5f0 0%, #c8eade 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(26, 122, 90, 0.15);
}

.cookie-icon-wrap .bi-cookie {
    font-size: 1.7rem;
    color: #1a7a5a;
}

/* --- Texto --- */
.cookie-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.cookie-desc {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem;
    color: #636e72;
    line-height: 1.65;
    margin: 0;
    text-align: left !important; /* Sobreescribir regla global justify */
}

.cookie-desc a {
    color: #1a7a5a;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-desc a:hover {
    color: #145e45;
}

/* --- Botonera --- */
.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-start;
}

/* Base de todos los botones */
.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 50px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    letter-spacing: 0.01em;
    text-decoration: none;
}

/* Botón: Ver política (outline neutro) */
.cookie-btn--outline {
    background: transparent;
    border-color: #b2bec3;
    color: #636e72;
}

.cookie-btn--outline:hover {
    border-color: #1a7a5a;
    color: #1a7a5a;
    background: #e8f5f0;
    transform: translateY(-1px);
}

/* Botón: Rechazar (outline rojo suave) */
.cookie-btn--reject {
    background: transparent;
    border-color: #e17055;
    color: #e17055;
}

.cookie-btn--reject:hover {
    background: #fdf0ee;
    border-color: #d63031;
    color: #d63031;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(214, 48, 49, 0.15);
}

/* Botón: Aceptar (relleno verde premium) */
.cookie-btn--accept {
    background: linear-gradient(135deg, #1a7a5a 0%, #22a573 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(26, 122, 90, 0.3);
}

.cookie-btn--accept:hover {
    background: linear-gradient(135deg, #145e45 0%, #1a7a5a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 122, 90, 0.4);
    color: #fff;
}

/* =============================================
   RESPONSIVE: Layout definitivo del banner
   
   DIAGNÓSTICO:
   - Botones en fila = 494px → texto queda en 61px → BUG
   - Solución: botones siempre en COLUMNA a la derecha (160px fijo)
   - Layout desktop: CSS Grid [1fr | 160px]
   ============================================= */

/* --- Móvil (≤ 599px): todo apilado en columna --- */
@media (max-width: 599px) {
    .cookie-overlay {
        padding: 0 0.6rem 0.8rem;
    }

    .cookie-banner {
        padding: 1.4rem 1.1rem 1.2rem;
        border-radius: 16px;
        gap: 1rem;
    }

    .cookie-title {
        font-size: 1.1rem;
    }

    .cookie-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .cookie-btn {
        width: 100%;
        padding: 12px 18px;
        justify-content: center;
    }
}

/* --- Desktop (≥ 600px): Grid 2 columnas
       Izquierda (1fr): icono + texto
       Derecha (160px fijo): botones en columna
   ------------------------------------------- */
@media (min-width: 600px) {
    .cookie-banner {
        display: grid;
        /* Columna izquierda flexible (todo el espacio sobrante)
           Columna derecha fija 160px para los botones              */
        grid-template-columns: 1fr 160px;
        grid-template-areas:
            "icon  actions"
            "text  actions";
        column-gap: 1.25rem;
        row-gap: 0.25rem;
        align-items: start;
        padding: 1.75rem 1.75rem 1.5rem;
    }

    /* Icono → celda "icon" */
    .cookie-icon-wrap {
        grid-area: icon;
        align-self: center;
    }

    /* Texto (título + descripción) → celda "text" */
    .cookie-content {
        grid-area: text;
        /* El grid ya garantiza el ancho; no hace falta min-width: 0 aquí */
    }

    /* Botones → celda "actions", centrados verticalmente */
    .cookie-actions {
        grid-area: actions;
        flex-direction: column;
        align-items: stretch;
        align-self: center;
        gap: 0.5rem;
        width: 160px;
    }

    /* Botones ocupan todo el ancho de su columna */
    .cookie-btn {
        width: 100%;
        justify-content: center;
        /* Permitir que el texto del botón haga salto de línea si es muy largo */
        white-space: normal;
        text-align: center;
        padding: 9px 14px;
        font-size: 0.82rem;
    }
}
