/*
 * Aviso de cookies — Esparza Arquitectura
 * Paleta y tipografía alineadas con src/assets/sass/helpers/_variables.scss
 * (theme-primary #00F885, heading font "Broad", body font "Aileron").
 * Sin bordes redondeados en ningún elemento, siguiendo la línea visual del sitio.
 */
:root {
    --cookie-primary: #00F885;
    --cookie-heading: #070143;
    --cookie-text: rgba(0, 0, 0, 0.62);
    --cookie-dark: #000000;
    --cookie-light: #ffffff;
    --cookie-bg-muted: #fafbfe;
    --cookie-border: rgba(0, 0, 0, 0.12);
    --cookie-shadow: rgba(0, 0, 0, 0.25);
    --cookie-heading-font: "Broad", sans-serif;
    --cookie-body-font: "Aileron", sans-serif;
}

.cookie-consent-banner {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 10000;
    background: var(--cookie-light);
    color: var(--cookie-text);
    box-shadow: 0 20px 35px -25px var(--cookie-shadow);
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 480px;
    margin: 0 auto;
    font-family: var(--cookie-body-font);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-consent-banner.is-hidden {
    transform: translateY(30px);
    opacity: 0;
    pointer-events: none;
}

.cookie-consent-banner__body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.cookie-consent-banner__icon {
    font-size: 1.1rem;
    line-height: 1.2;
}

.cookie-consent-banner__content h2 {
    margin: 0 0 0.6rem;
    color: var(--cookie-heading);
    font-family: var(--cookie-heading-font);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

.cookie-consent-banner__content p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--cookie-text);
}

.cookie-consent-banner__content a {
    color: var(--cookie-dark);
    text-decoration: underline;
}

.cookie-consent-banner__content a:hover {
    color: var(--cookie-primary);
}

.cookie-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
}

/* Botones: mismo lenguaje que .theme-btn-s2 (subrayado que aparece al hover, sin relleno, sin radio) */
.cookie-btn {
    display: inline-block;
    background: none;
    border: none;
    margin: 0;
    padding: 2px 2px;
    cursor: pointer;
    color: var(--cookie-dark);
    font-family: var(--cookie-heading-font);
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-image: linear-gradient(to bottom, transparent 55%, var(--cookie-primary) 55%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: 0 0;
    transition: background-position 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                background-size 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s;
}

.cookie-btn:hover,
.cookie-btn:focus {
    color: var(--cookie-dark);
    background-position: 0 -7px;
    background-size: 100%;
}

.cookie-btn--ghost {
    color: var(--cookie-text);
}

.cookie-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
}

.cookie-consent-modal.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.cookie-consent-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.cookie-consent-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    min-width: 0;
    background: var(--cookie-light);
    color: var(--cookie-text);
    box-shadow: 0 25px 60px -20px var(--cookie-shadow);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    font-family: var(--cookie-body-font);
}

.cookie-consent-modal__header,
.cookie-consent-modal__footer {
    padding: 1.5rem;
    border-bottom: 1px solid var(--cookie-border);
    display: flex;
    justify-content: space-between;
    background: var(--cookie-light);
}

.cookie-consent-modal__footer {
    border-top: 1px solid var(--cookie-border);
    border-bottom: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
}

.cookie-consent-modal__content {
    padding: 1.25rem 1.75rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.cookie-consent-modal__header h2 {
    margin: 0;
    color: var(--cookie-heading);
    font-family: var(--cookie-heading-font);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.3rem;
}

.cookie-consent-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--cookie-dark);
    transition: color 0.2s ease;
}

.cookie-consent-modal__close:hover,
.cookie-consent-modal__close:focus {
    color: var(--cookie-primary);
}

.cookie-consent-modal__content > p a {
    color: var(--cookie-dark);
    text-decoration: underline;
}

.cookie-consent-modal__content > p a:hover {
    color: var(--cookie-primary);
}

.cookie-preference {
    margin-bottom: 1.25rem;
    border: 1px solid var(--cookie-border);
    padding: 1rem 1.25rem;
    background: var(--cookie-bg-muted);
}

.cookie-preference header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-preference p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--cookie-text);
}

.cookie-preference__details {
    margin-top: 0.75rem;
    overflow: auto;
}

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

.cookie-preference__details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--cookie-dark);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cookie-preference__details-toggle:hover,
.cookie-preference__details-toggle:focus {
    color: var(--cookie-primary);
}

.cookie-preference__toggle-icon {
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.cookie-preference.is-open .cookie-preference__toggle-icon {
    transform: rotate(-135deg);
    margin-top: 1px;
}

.cookie-preference.is-open .cookie-preference__details-toggle {
    color: var(--cookie-primary);
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.cookie-table th,
.cookie-table td {
    border: 1px solid var(--cookie-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
    color: var(--cookie-text);
}

.cookie-table th {
    background: rgba(0, 248, 133, 0.14);
    color: var(--cookie-dark);
    font-weight: 700;
}

/* Switch cuadrado, sin border-radius */
.cookie-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--cookie-dark);
    cursor: pointer;
}

.cookie-toggle input {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 22px;
    flex: 0 0 auto;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.25);
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cookie-toggle input:disabled {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(0, 0, 0, 0.25);
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-toggle input:checked {
    background: var(--cookie-primary);
    border-color: var(--cookie-primary);
    opacity: 1;
}

.cookie-toggle input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--cookie-light);
    transition: transform 0.2s ease;
}

.cookie-toggle input:checked::after {
    transform: translateX(20px);
}

.cookie-toggle__label {
    font-family: var(--cookie-body-font);
    font-size: 0.95rem;
    font-weight: 700;
}

.cookie-consent--modal-open {
    overflow: hidden;
}

/* Bloque de sustitución para contenido diferido (ej. iframe de Google Maps) hasta que se acepten sus cookies */
.cookie-consent-block {
    background-color: var(--cookie-bg-muted);
    border: 1px solid var(--cookie-border);
    padding: 32px;
    text-align: center;
    font-family: var(--cookie-body-font);
}

.cookie-consent-block p {
    color: var(--cookie-text);
    margin-bottom: 0;
}

.cookie-consent-block__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.cookie-consent-block.is-hidden {
    display: none;
}

[data-cookieconsent-src][data-cookieconsent-blocked="true"] {
    display: none;
}

@media (max-width: 680px) {
    .cookie-consent-banner {
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
    }

    .cookie-consent-banner__body {
        flex-direction: column;
    }

    .cookie-consent-banner__actions {
        justify-content: flex-start;
    }

    .cookie-consent-modal__footer {
        justify-content: center;
        flex-wrap: wrap;
    }
}
