/* ==========================================================================
   Meteorites from Chile — estilos compartidos
   Complementa Tailwind (CDN). Aquí solo vive lo que no se resuelve limpiamente
   con utilidades: efectos de hover compuestos, estados de filtro y accesibilidad.
   ========================================================================== */

:root {
    color-scheme: dark;
    --tfc-accent: #d97706;      /* amber-600 */
    --tfc-accent-rgb: 217, 119, 6;  /* mismo tono, para usar con rgba() en tintes translúcidos */
    --tfc-surface: #131313;
    --tfc-border: #27272a;      /* zinc-800 */
}

[x-cloak] { display: none !important; }

html { scroll-behavior: smooth; }

/* Compensa el nav fijo (h-24 = 6rem) al saltar a un ancla */
[id] { scroll-margin-top: 7rem; }

/* --------------------------------------------------------------------------
   Accesibilidad
   -------------------------------------------------------------------------- */

:focus-visible {
    outline: 2px solid var(--tfc-accent);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100%;
    z-index: 200;
    background: #fff;
    color: #000;
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

.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;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   Media — reserva de espacio para evitar CLS
   -------------------------------------------------------------------------- */

img { max-width: 100%; }

/* Placeholder mientras carga / si la foto no existe */
.media-frame {
    position: relative;
    overflow: hidden;
    background-color: #0e0e0e;
    background-image: linear-gradient(135deg, #111 25%, #171717 25%, #171717 50%, #111 50%, #111 75%, #171717 75%);
    background-size: 12px 12px;
}
.media-frame > img { display: block; }

img[data-img-error] { object-fit: contain; opacity: 0.45; }

/* --------------------------------------------------------------------------
   Grilla de categorías (home) — efecto "oscar"
   -------------------------------------------------------------------------- */

.effect-oscar {
    background: #000;
    overflow: hidden;
    position: relative;
    border: 1px solid #1a1a1a;
}
.effect-oscar img {
    opacity: 0.8;
    transition: opacity 0.35s, transform 0.35s;
}
.effect-oscar:hover img,
.effect-oscar:focus-within img {
    opacity: 0.3;
    transform: scale(1.05);
}
.effect-oscar figcaption {
    position: absolute;
    inset: 0;
    padding: 1.5rem;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    pointer-events: none;
}
.effect-oscar .oscar-desc {
    opacity: 0;
    transition: opacity 0.5s;
}
.effect-oscar:hover .oscar-desc,
.effect-oscar:focus-within .oscar-desc { opacity: 1; }

/* --------------------------------------------------------------------------
   Catálogo / Colección
   -------------------------------------------------------------------------- */

.filter-list li {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    border-left: 2px solid transparent;
    color: #9ca3af; /* gray-400 — 8.9:1 sobre #1a1a1a */
}
.filter-list li:hover,
.filter-list li:focus-within { color: #ffffff; }

.filter-list li.active {
    color: #ffffff;
    border-left: 2px solid #ffffff;
    padding-left: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
}
.filter-list button,
.filter-list a {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.5rem;
}

.product-card {
    background: #fff;
    transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover,
.product-card:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */

.contact-input {
    background-color: rgba(19, 19, 19, 0.9);
    border: 1px solid var(--tfc-border);
    color: #ffffff;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.contact-input::placeholder { color: #9ca3af; }
.contact-input:focus {
    border-color: var(--tfc-accent);
    outline: none;
    background-color: #1a1a1a;
}
/* Solo marca en rojo tras interacción, no al cargar la página */
.contact-input:user-invalid { border-color: #dc2626; }

/* --------------------------------------------------------------------------
   Avisos informativos (banner de guía en el formulario de contacto)
   -------------------------------------------------------------------------- */

.alert-banner {
    border-left: 3px solid var(--tfc-accent);
    background-color: rgba(var(--tfc-accent-rgb), 0.08);
}
.alert-banner-title { color: var(--tfc-accent); }

/* --------------------------------------------------------------------------
   Slider de expediciones (Swiper)
   -------------------------------------------------------------------------- */

.swiper-hero { height: 80vh; }
.swiper-hero .swiper-button-next,
.swiper-hero .swiper-button-prev { color: #ffffff; }
