/**
 * Layout y fondos visibles antes de que cargue Tailwind CDN.
 * Evita FOUC en hero, header, catálogo y panel de filtros.
 */

/* Utilidades de posición / flex (above the fold) */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-px { height: 1px; }
.w-7 { width: 1.75rem; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.pointer-events-none { pointer-events: none; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-white { color: #fff; }
.uppercase { text-transform: uppercase; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.tracking-wide { letter-spacing: 0.025em; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-auto { margin-top: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-3xl { max-width: 48rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-xl { max-width: 36rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-\[4\.75rem\] { padding-top: 4.75rem; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.bg-\[\#0D0D0D\] { background-color: #0d0d0d; }
.bg-\[\#121212\] { background-color: #121212; }
.bg-\[\#0c0c0c\] { background-color: #0c0c0c; }
.bg-\[\#090909\] { background-color: #090909; }
.bg-black\/35 { background-color: rgba(0, 0, 0, 0.35); }
.text-\[\#C89D20\] { color: #c89d20; }
.text-\[\#B5B5B5\] { color: #b5b5b5; }
.text-\[\#9ca3af\] { color: #9ca3af; }
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.text-white\/88 { color: rgba(255, 255, 255, 0.88); }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }
.inline-flex { display: inline-flex; }
.rounded-sm { border-radius: 0.125rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-\[\#2a2a2a\] { border-color: #2a2a2a; }
.border-\[\#C89D20\] { border-color: #c89d20; }
.border-transparent { border-color: transparent; }

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:w-10 { width: 2.5rem; }
    .sm\:pt-\[5\.25rem\] { padding-top: 5.25rem; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:text-xs { font-size: 0.75rem; line-height: 1rem; }
    .sm\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .md\:py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
    .md\:gap-10 { gap: 2.5rem; }
    .md\:text-left { text-align: left; }
    .md\:mx-0 { margin-left: 0; margin-right: 0; }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:gap-5 { gap: 1.25rem; }
}

.min-h-\[100svh\] { min-height: 100svh; }

/* Hero: fondo + overlays sin Tailwind */
#inicio.hero-inicio .hero-inicio__bg-wrap {
    background: linear-gradient(145deg, #0a0a0a 0%, #1a1510 45%, #0d0d0d 100%);
}

.hero-inicio__overlay-v,
.hero-inicio__overlay-h {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-inicio__overlay-v {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.78) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

.hero-inicio__overlay-h {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.2) 55%,
        transparent 100%
    );
}

#inicio.hero-inicio .hero-inicio__bg-wrap img {
    opacity: 0;
    transition: opacity 0.35s ease;
}

#inicio.hero-inicio .hero-inicio__bg-wrap.is-loaded img {
    opacity: 1;
}

/* Pilares hero */
.hero-inicio__pilares {
    position: relative;
    z-index: 10;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
}

/* Panel catálogo: barra superior sin solapamiento */
#catalog-controls .catalog-controls-topbar > div {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    max-width: 90rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    #catalog-controls .catalog-controls-topbar > div {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    #catalog-controls .catalog-controls-topbar .justify-center {
        justify-content: flex-end;
    }
}

/* Evitar doble título "Filtros de inventario" (topbar + toolbar) */
#panelFiltros .fi-adv-toolbar .fi-adv-toolbar-title {
    display: none;
}

#panelFiltros .fi-adv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    background: #0c0c0c;
}

#vehiculos {
    background-color: #0d0d0d;
}

#catalog-controls {
    background-color: #0c0c0c;
    border: 1px solid #2a2a2a;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* Textura de márgenes: solo tras precarga (evita delay de pintado) */
html:not(.mc-textures-ready) body::before {
    background-image: linear-gradient(
        180deg,
        rgba(13, 13, 13, 0.82) 0%,
        rgba(10, 10, 10, 0.9) 100%
    );
}
