/* ===============================================================
 * ACCESIBILIDAD + POLISH — carga tras base.css
 * =============================================================== */

/* Age gate: shake al intentar entrar sin aceptar */
@keyframes agegate-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.age-gate__label.is-shake {
    animation: agegate-shake 0.4s ease;
    color: #c04040;
}
[data-age-enter][aria-disabled="true"] {
    opacity: 0.65;
    filter: grayscale(0.35);
}
[data-age-enter].is-ready {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 0 3px rgba(74, 124, 46, 0.25);
}

/* Respetar preferencia de reducir movimiento (a11y + a11y de vestibular) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
}

/* Skip-to-content visible al enfocar */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 16px;
    padding: 12px 20px;
    background: var(--color-gold);
    color: var(--color-bg);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 2px;
    z-index: 1000;
    transition: top 180ms;
    text-decoration: none;
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
    top: 16px;
    outline: 3px solid var(--color-text);
    outline-offset: 2px;
}

/* Focus-visible reforzado en interactivos principales */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 3px;
    border-radius: 2px;
    box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.22);
}

/* aria-current="page" en navegación */
[aria-current="page"] {
    color: var(--color-gold) !important;
    font-weight: 600;
}

/* Mejora lectura en bloques largos — altura de línea editorial */
.editorial-prose p,
.blog-article__content p,
p.lead,
article p {
    line-height: 1.75;
}

/* Legibilidad mínima — tap target 44x44px mínimo según WCAG 2.5.5 AAA */
.btn, .icon-btn, .nav-main__parent, .shop-sidebar__check, .blog-cat {
    min-height: 44px;
}

/* Tipografía: reforzar jerarquía de eyebrow/secundarios */
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    font-weight: 700;
}

/* Mejor contrast del color text-dim (usado en metadatos) */
.text-dim {
    color: var(--color-text-muted);
}

/* Visibilidad del enlace dentro de párrafos editoriales — siempre subrayado */
.editorial-prose a,
.blog-article__content a,
article p a {
    color: var(--color-gold);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: var(--color-gold-dark);
    transition: text-decoration-color 180ms, color 180ms;
}
.editorial-prose a:hover,
.blog-article__content a:hover,
article p a:hover {
    text-decoration-color: var(--color-gold);
    color: var(--color-gold-light);
}

/* Formularios: etiqueta visible obligatoria */
.label, label.label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-text);
    margin-bottom: 6px;
}

/* Inputs con padding generoso — mejor usabilidad táctil */
.input, .select, .textarea {
    padding: 12px 14px;
    min-height: 44px;
}

/* Estado de error explícito */
.input[aria-invalid="true"],
.input.is-error,
.select[aria-invalid="true"] {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(196, 69, 54, 0.18);
}

/* Mensajes de error vinculados al campo — más visibles */
.form-error {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: 6px;
    display: flex;
    gap: 6px;
    align-items: center;
}
.form-error::before {
    content: "⚠";
    font-weight: 700;
}

/* Hidden accesible — oculto visualmente pero no a lectores */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mejora contraste de muted (WCAG AA) — suave pero legible */
.text-muted { color: #b9b3a9; }  /* Era #a8a39a — subido a ratio ~5.2:1 */

/* Cards: sombra más suave por defecto, más marcada en hover */
.product-card,
.blog-card {
    transition: transform 220ms var(--ease-editorial, ease),
                border-color 220ms var(--ease-editorial, ease),
                box-shadow 220ms var(--ease-editorial, ease);
}

/* Scrollbar más sutil */
::-webkit-scrollbar-thumb { background: var(--color-gold-dark); opacity: 0.6; }

/* Mejora de lectura en long-form */
.blog-article__content {
    font-size: 1.08rem;
}
@media (max-width: 640px) {
    .blog-article__content { font-size: 1.02rem; }
}

/* Estilos para subrayar palabras clave en leyendas cortas */
mark {
    background: rgba(201, 169, 97, 0.18);
    color: var(--color-text);
    padding: 0 3px;
    border-radius: 2px;
}

/* Print: oculta UI no relevante al imprimir (p.ej. una ficha para llevar) */
@media print {
    .site-header, .site-footer, .offcanvas,
    .mobile-cta-dock, .announcement-bar,
    .age-gate, .cookie-banner, .first-order-popup,
    .shop-sidebar, .shop-toolbar, form, .btn {
        display: none !important;
    }
    body { background: #fff !important; color: #000 !important; }
    a { color: #000 !important; text-decoration: underline !important; }
}
