/* ===== Legal pages (términos, privacidad, cookies) ===== */

.legal-hero {
    padding-top: clamp(40px, 6vw, 64px);
    padding-bottom: 20px;
}

.legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--color-white);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.legal-body {
    padding-top: 0;
    padding-bottom: clamp(60px, 8vw, 100px);
}

.legal-layout {
    display: grid;
    gap: 32px;
    align-items: start;
}

.legal-toc {
    background: var(--color-white);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.legal-toc h2 {
    font-family: var(--font-body);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.legal-toc ol {
    list-style: none;
    display: grid;
    gap: 10px;
    counter-reset: toc;
}

.legal-toc li {
    counter-increment: toc;
    font-size: 14px;
    line-height: 1.4;
}

.legal-toc a {
    display: flex;
    gap: 8px;
}

.legal-toc a::before {
    content: counter(toc) '.';
    font-weight: 700;
    color: var(--color-pink-ink);
    flex-shrink: 0;
}

.legal-toc a:hover {
    color: var(--color-pink-ink);
}

.legal-article {
    background: var(--color-white);
    border-radius: var(--radius-card);
    padding: clamp(28px, 4vw, 48px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.legal-article section {
    padding-block: 0;
    margin-bottom: 36px;
    scroll-margin-top: 110px;
}

.legal-article section:last-child {
    margin-bottom: 0;
}

.legal-article h2 {
    font-size: clamp(22px, 3vw, 28px);
    margin-bottom: 14px;
}

.legal-article h3 {
    font-size: 17px;
    font-family: var(--font-body);
    font-weight: 700;
    margin: 20px 0 8px;
}

.legal-article p {
    color: rgba(0,0,0,0.78);
    margin-bottom: 12px;
}

.legal-article ul,
.legal-article ol {
    margin: 8px 0 16px 20px;
    display: grid;
    gap: 8px;
}

.legal-article li {
    color: rgba(0,0,0,0.78);
    line-height: 1.6;
}

.legal-article a {
    color: var(--color-pink-ink);
    text-decoration: underline;
}

.legal-article strong {
    font-weight: 700;
    color: var(--color-black);
}

.legal-note {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--color-lila);
    font-size: 14px;
    line-height: 1.55;
}

.legal-note strong {
    color: var(--color-pink-ink);
}

.legal-table-wrap {
    overflow-x: auto;
    margin: 12px 0 20px;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 480px;
}

.legal-table th,
.legal-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    vertical-align: top;
}

.legal-table th {
    font-family: var(--font-body);
    font-weight: 700;
    background: var(--color-lila);
}

@media (min-width: 960px) {
    .legal-layout {
        grid-template-columns: 240px 1fr;
    }

    .legal-toc {
        position: sticky;
        top: 100px;
    }
}

/* ===== Consent checkboxes inside forms ===== */

.consent-group {
    display: grid;
    gap: 12px;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.45;
}

.consent-row input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--color-pink);
}

.consent-row a {
    color: var(--color-pink-ink);
    text-decoration: underline;
    font-weight: 700;
}

.consent-row.has-error {
    color: #C23E7D;
}

.consent-row.has-error input[type="checkbox"] {
    outline: 2px solid #C23E7D;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Cookie consent banner ===== */

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 200;
    max-width: 620px;
    margin-inline: auto;
    background: var(--color-white);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
    transform: translateY(140%);
    transition: transform 0.4s ease;
}

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

.cookie-banner p {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(0,0,0,0.78);
    margin-bottom: 16px;
}

.cookie-banner a {
    color: var(--color-pink-ink);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cookie-actions .btn {
    padding: 12px 20px;
    font-size: 14px;
}

.btn-ghost {
    background: transparent;
    color: var(--color-black);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.12);
}

.btn-ghost:hover {
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.3);
}

.cookie-settings {
    display: none;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(0,0,0,0.1);
    gap: 14px;
}

.cookie-settings.is-open {
    display: grid;
}

.cookie-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cookie-category-text h4 {
    font-family: var(--font-body);
    font-size: 14px;
    margin-bottom: 4px;
}

.cookie-category-text p {
    font-size: 13px;
    margin-bottom: 0;
}

.cookie-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cookie-switch .track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-pill);
    background: rgba(0,0,0,0.2);
    transition: background 0.2s ease;
}

.cookie-switch .track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-white);
    transition: transform 0.2s ease;
}

.cookie-switch input:checked + .track {
    background: var(--color-pink);
}

.cookie-switch input:checked + .track::after {
    transform: translateX(18px);
}

.cookie-switch input:disabled + .track {
    background: var(--color-green);
    opacity: 0.6;
}

.cookie-settings-save {
    margin-top: 4px;
}

@media (max-width: 480px) {
    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 18px;
    }
}
