/* ============================================
   DAVID VILLALBA AUTOR - Banner de cookies (js/consent.js)
   Mismo aspecto que el banner anterior (.cookie-* de styles.css),
   con los tres botones de primera capa con el mismo peso visual.
   ============================================ */

.dvc-root [hidden] {
    display: none !important;
}

.dvc-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.dvc-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.dvc-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    z-index: 99999;
    width: 94%;
    max-width: 540px;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--white, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 28px 28px 24px;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    color: var(--black, #1c1c1c);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.dvc-banner.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* El foco se lleva al propio diálogo al abrirlo (para no «empujar» hacia Aceptar):
   sin contorno en el contenedor; los botones y casillas sí lo muestran. */
.dvc-banner:focus,
.dvc-banner:focus-visible {
    outline: none;
}

.dvc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.dvc-header svg {
    width: 22px;
    height: 22px;
    color: var(--gold, #c9a84c);
    flex-shrink: 0;
}

.dvc-header h2 {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--black, #1c1c1c);
    margin: 0;
}

.dvc-text p {
    font-size: 14px;
    color: var(--gray-dark, #555555);
    line-height: 1.75;
    margin: 0 0 20px;
    max-width: none;
}

.dvc-text a {
    color: var(--gold-dark, #b8953f);
    text-decoration: underline;
    font-weight: 500;
}

.dvc-text a:hover {
    color: var(--primary, #2b2b2b);
}

/* Los tres botones de la primera capa: idénticos (mismo tamaño, color y borde) */
.dvc-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dvc-btn {
    flex: 1;
    min-width: 120px;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    text-align: center;
    background: var(--white, #ffffff);
    color: var(--primary, #2b2b2b);
    border: 1.5px solid var(--primary, #2b2b2b);
    transition: background 0.25s ease, color 0.25s ease;
}

.dvc-btn:hover {
    background: var(--primary, #2b2b2b);
    color: var(--white, #ffffff);
}

.dvc-btn:focus-visible {
    outline: 2px solid var(--gold, #c9a84c);
    outline-offset: 2px;
}

.dvc-btn[aria-expanded="true"] {
    background: rgba(43, 43, 43, 0.06);
}

.dvc-btn[aria-expanded="true"]:hover {
    background: var(--primary, #2b2b2b);
}

/* Segunda capa */
.dvc-config {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.dvc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.dvc-item:last-of-type {
    border-bottom: none;
}

.dvc-item__info h3 {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--black, #1c1c1c);
    margin: 0 0 2px;
}

.dvc-item__info p {
    font-size: 12px;
    color: var(--gray-dark, #555555);
    margin: 0;
    line-height: 1.5;
    max-width: none;
}

.dvc-item__info code {
    font-size: 11px;
    background: #f3f4f6;
    padding: 0 4px;
    border-radius: 4px;
}

.dvc-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 16px;
}

.dvc-toggle input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.dvc-toggle input:disabled {
    cursor: not-allowed;
}

.dvc-toggle__slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.25s ease;
}

.dvc-toggle__slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: var(--white, #ffffff);
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.dvc-toggle input:checked + .dvc-toggle__slider {
    background: var(--gold, #c9a84c);
}

.dvc-toggle input:checked + .dvc-toggle__slider::before {
    transform: translateX(20px);
}

.dvc-toggle input:disabled + .dvc-toggle__slider {
    opacity: 0.6;
}

.dvc-toggle input:focus-visible + .dvc-toggle__slider {
    outline: 2px solid var(--primary, #2b2b2b);
    outline-offset: 2px;
}

.dvc-btn--save {
    margin-top: 16px;
    width: 100%;
    flex: none;
}

.dvc-status:empty {
    display: none;
}


@media (max-width: 768px) {
    .dvc-banner {
        bottom: 12px;
        padding: 24px 20px 20px;
        width: calc(100% - 32px);
        max-width: none;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .dvc-btns {
        flex-direction: column;
    }

    .dvc-btn {
        min-width: unset;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dvc-overlay,
    .dvc-banner,
    .dvc-toggle__slider,
    .dvc-toggle__slider::before,
    .dvc-btn {
        transition: none;
    }

    .dvc-banner,
    .dvc-banner.visible {
        transform: translateX(-50%);
    }
}

/* Tablas de la Política de cookies (no tenían estilos y en móvil se salían de la pantalla) */
.legal-content .cookies-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0 1.5rem;
}

.legal-content .cookies-table table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

.legal-content .cookies-table th,
.legal-content .cookies-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.legal-content .cookies-table th {
    background: var(--gray-light, #f7f6f4);
    font-weight: 600;
}

.legal-content .dvc-policy-action {
    margin: 1rem 0 1.5rem;
}
