/* =============================================================================
   ECOVIAL360 — cookie-consent.css
   Banner de consentimiento de cookies RGPD.
   ============================================================================= */

/* ----------------------------------------------------------------------------
   Overlay de fondo (bloqueante hasta aceptar, opcional)
   ---------------------------------------------------------------------------- */
.cc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.cc-overlay.is-visible {
    display: block;
}

/* ----------------------------------------------------------------------------
   Banner principal
   ---------------------------------------------------------------------------- */
.cc-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 9999;
    width: calc(100% - 2rem);
    max-width: 780px;

    background: #ffffff;
    border: 1px solid #E5EAE3;
    border-radius: 18px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.14),
        0 4px 16px rgba(0, 0, 0, 0.08);

    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;

    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.cc-banner.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Fila superior: icono + texto */
.cc-banner__top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cc-banner__icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.cc-banner__copy {
    flex: 1;
    min-width: 0;
}

.cc-banner__title {
    font-size: 1rem;
    font-weight: 800;
    color: #1F2933;
    margin: 0 0 0.3rem;
    font-family: inherit;
}

.cc-banner__text {
    font-size: 0.85rem;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
}

.cc-banner__text a {
    color: #1A531A;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-banner__text a:hover {
    color: #2E7D32;
}

/* Fila de botones */
.cc-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Botón: Aceptar todas */
.cc-btn-accept {
    background: #1A531A;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.65rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(26, 83, 26, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.cc-btn-accept:hover {
    background: #2E7D32;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 83, 26, 0.4);
}

/* Botón: Solo necesarias */
.cc-btn-necessary {
    background: transparent;
    color: #4B5563;
    border: 1.5px solid #D1D5DB;
    border-radius: 50px;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.cc-btn-necessary:hover {
    border-color: #1A531A;
    color: #1A531A;
}

/* Botón: Personalizar */
.cc-btn-customize {
    background: transparent;
    color: #9CA3AF;
    border: none;
    padding: 0.65rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
    white-space: nowrap;
}

.cc-btn-customize:hover { color: #1A531A; }

/* ----------------------------------------------------------------------------
   Panel de personalización (desplegable)
   ---------------------------------------------------------------------------- */
.cc-panel {
    display: none;
    border-top: 1px solid #F3F4F6;
    padding-top: 1.25rem;
    flex-direction: column;
    gap: 0.75rem;
}

.cc-panel.is-open {
    display: flex;
}

.cc-panel__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin: 0;
}

/* Toggle row */
.cc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #F9FAFB;
    border-radius: 10px;
    border: 1px solid #F3F4F6;
}

.cc-toggle-row__info { flex: 1; min-width: 0; }

.cc-toggle-row__label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1F2933;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-toggle-row__badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #D1FAE5;
    color: #065F46;
    padding: 2px 7px;
    border-radius: 999px;
}

.cc-toggle-row__desc {
    font-size: 0.78rem;
    color: #9CA3AF;
    margin: 2px 0 0;
}

/* Toggle switch */
.cc-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cc-switch__track {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}

.cc-switch__track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cc-switch input:checked + .cc-switch__track {
    background: #1A531A;
}

.cc-switch input:checked + .cc-switch__track::after {
    transform: translateX(20px);
}

.cc-switch input:disabled + .cc-switch__track {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Botón guardar preferencias */
.cc-btn-save {
    align-self: flex-start;
    background: #1A531A;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.25rem;
}

.cc-btn-save:hover { background: #2E7D32; }

/* ----------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .cc-banner {
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(120%);
        width: 100%;
        max-width: 100%;
        border-radius: 18px 18px 0 0;
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .cc-banner.is-visible {
        transform: translateY(0);
    }

    .cc-banner__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-btn-accept,
    .cc-btn-necessary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .cc-btn-customize {
        text-align: center;
    }
}