/*
 * Banner de consentimiento de cookies — Floristería OCA
 * Debe cargarse después de style.css (ver partials/head.blade.php).
 * Estilos sin dependencias: colores tomados de la paleta del template.
 */

.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 1080; /* por encima del overlay y del botón flotante */
    width: calc(100% - 32px);
    max-width: 900px;
    background: #ffffff;
    color: #2b2b2b;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    padding: 20px 22px;
    font-size: 14px;
    line-height: 1.5;
    animation: cc-slide-up 0.35s ease-out;
}

@keyframes cc-slide-up {
    from { opacity: 0; transform: translate(-50%, 24px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.cookie-consent[hidden] { display: none; }

/* ---- Vista principal ---- */
.cookie-consent__main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent__text { flex: 1 1 340px; min-width: 240px; }

.cookie-consent__title {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 16px;
    color: #1f1f1f;
}

.cookie-consent__desc { margin: 0; color: #4a4a4a; }

.cookie-consent__link {
    color: var(--theme-color, #ff5c8d);
    text-decoration: underline;
    font-weight: 600;
}

/* ---- Botones ---- */
.cookie-consent__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-consent__btn {
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 8px;
    transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.cookie-consent__btn--primary {
    background: var(--theme-color, #ff5c8d);
    color: #ffffff;
}
.cookie-consent__btn--primary:hover { filter: brightness(0.92); }

.cookie-consent__btn--secondary {
    background: #efefef;
    color: #2b2b2b;
}
.cookie-consent__btn--secondary:hover { background: #e3e3e3; }

.cookie-consent__btn--ghost {
    background: transparent;
    color: #6b6b6b;
    text-decoration: underline;
    padding-left: 8px;
    padding-right: 8px;
}
.cookie-consent__btn--ghost:hover { color: #2b2b2b; }

/* ---- Vista de preferencias ---- */
.cookie-consent__prefs[hidden] { display: none; }

.cookie-consent__categories {
    list-style: none;
    margin: 14px 0 18px;
    padding: 0;
    display: grid;
    gap: 14px;
}

.cookie-consent__category {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 14px;
    background: #f8f8f8;
    border-radius: 10px;
}

.cookie-consent__category p {
    margin: 4px 0 0;
    color: #5a5a5a;
    font-size: 13px;
}

.cookie-consent__category strong { font-size: 14px; color: #1f1f1f; }

.cookie-consent__badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    background: #e6f4ea;
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: middle;
}

/* ---- Interruptor (toggle) ---- */
.cookie-consent__switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
    margin-top: 2px;
}
.cookie-consent__switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cookie-consent__slider {
    position: absolute;
    inset: 0;
    background: #cfcfcf;
    border-radius: 999px;
    transition: background 0.2s ease;
}
.cookie-consent__slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.cookie-consent__switch input:checked + .cookie-consent__slider {
    background: var(--theme-color, #ff5c8d);
}
.cookie-consent__switch input:checked + .cookie-consent__slider::before {
    transform: translateX(18px);
}
.cookie-consent__switch input:disabled + .cookie-consent__slider {
    background: #9fd6a9;
    cursor: not-allowed;
}

/* ---- Responsive ---- */
@media (max-width: 575px) {
    .cookie-consent {
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        transform: none;
        padding: 16px;
    }
    @keyframes cc-slide-up {
        from { opacity: 0; transform: translateY(24px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .cookie-consent__actions { width: 100%; }
    .cookie-consent__btn { flex: 1 1 auto; text-align: center; }
    .cookie-consent__btn--ghost { flex-basis: 100%; }
}
