/* --- CONFIGURACIÓN BASE --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #050505;
    color: #eeeeee;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

*[id] {
    scroll-margin-top: 100px;
}

.font-goldman {
    font-family: 'Goldman', cursive;
}

/* --- FILTRO AMARILLO PARA ICONOS NEGROS --- */
.icon-yellow {
    filter: invert(84%) sepia(78%) saturate(712%) hue-rotate(350deg) brightness(100%) contrast(94%);
}

/* --- ESTÉTICA RACING / ALTA PERFORMANCE --- */
.skew-container {
    transform: skewX(-12deg);
    overflow: hidden;
}

.unskew {
    transform: skewX(12deg);
}

.skew-box {
    transform: skewX(-15deg);
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(10, 10, 10, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #f1c40f;
    transition: all 0.3s ease;
}

.skew-box:hover {
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.9) 0%, rgba(20, 20, 20, 0.95) 100%);
    border-color: rgba(241, 196, 15, 0.5);
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.2);
}

.skew-box > * {
    transform: skewX(15deg);
}

.clip-diagonal {
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%);
}

.clip-diagonal-reverse {
    clip-path: polygon(0 60px, 100% 0, 100% 100%, 0% 100%);
}

.glow-gold {
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

/* Marco tecnológico para videos */
.video-frame {
    position: relative;
    background: #000;
    border: 1px solid rgba(241, 196, 15, 0.3);
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.1);
    overflow: hidden;
}

.video-frame::before,
.video-frame::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #f1c40f, transparent);
    z-index: 10;
}

.video-frame::before {
    top: 0;
}

.video-frame::after {
    bottom: 0;
}

/* --- BOTONES Y TARJETAS GENÉRICAS --- */
.card-glass {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.card-glass:hover {
    border-color: rgba(241, 196, 15, 0.3);
    transform: translateY(-5px);
}

.btn-goldman {
    background-color: #f1c40f;
    color: #000;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    transition: all 0.3s ease;
    position: relative;
}

.btn-goldman:hover {
    background-color: #d4ac0d;
    transform: scale(1.05);
    /* El shadow nativo es recortado por el clip-path. Se usa drop-shadow para que resplandezca por fuera */
    filter: drop-shadow(0 0 15px rgba(241, 196, 15, 0.5));
}

/* --- DETALLES DE LÍNEA ALEMANA --- */
/* FIX: position:relative para evitar que los after se desprendan del DOM y se superpongan */
.alemanpos, .aleman {
    position: relative;
}

.alemanpos::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right,
            #000000 0%, #000000 33.33%,
            #FF0000 33.33%, #FF0000 66.66%,
            #FFCE00 66.66%, #FFCE00 100%);
}

.aleman::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 80px;
    width: 25%;
    height: 5px;
    background: linear-gradient(to right,
            #000000 0%, #000000 33.33%,
            #FF0000 33.33%, #FF0000 66.66%,
            #FFCE00 66.66%, #FFCE00 100%);
}

/* --- TARJETA DE PRODUCTO 3D (Catálogo) --- */
.product-card {
    position: relative;
    /* FIX: Espacio prudente para que la llanta respire sin chocar */
    margin-top: 70px;
    padding: 1.5rem 1rem 1rem 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid transparent;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    z-index: 1;
}

@media (min-width: 768px) {
    .product-card {
        padding: 2rem 1.5rem 1.5rem 1.5rem;
        margin-top: 80px;
    }
}

.product-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right,
            #000000 0%, #000000 33.33%,
            #FF0000 33.33%, #FF0000 66.66%,
            #FFCE00 66.66%, #FFCE00 100%);
}

.product-card:hover {
    background-color: #111111;
    border-color: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid #f1c40f;
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.9);
    z-index: 10; /* FIX: Evita choques y eclipses con las tarjetas de los lados */
}

/* FIX: Contenedor fluyente con márgenes negativos (más dócil que el position:absolute que colisionaba) */
.tire-image-container {
    position: relative;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-top: -65px; 
    margin-bottom: 1.5rem;
    z-index: 5;
}

@media (min-width: 768px) {
    .tire-image-container {
        height: 130px;
        margin-top: -85px;
    }
}

.tire-image-container img {
    height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 15px 10px rgba(0, 0, 0, 0.6));
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0));
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0));
    transform-origin: bottom center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .tire-image-container img {
    transform: translateY(-10px) scale(1.15);
}

.spacer-top {
    height: 75px;
}

@media (min-width: 768px) {
    .spacer-top {
        height: 110px;
    }
}

/* --- CATEGORÍAS (ANIMACIÓN DE CAPAS) --- */
.category-card {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    background-color: #000;
}

.category-card:hover {
    border-color: rgba(241, 196, 15, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: translateY(-5px);
}

.category-card .bg-image-archived {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 1;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.category-card:hover .bg-image-archived {
    transform: scale(1.1);
    opacity: 0.15;
}

/* FIX: Los gradientes directos no se transicionan suavemente, por lo que usamos pseudo-elementos para el fundido */
.category-card .gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.8) 30%, rgba(0, 0, 0, 0) 70%);
    z-index: 2;
}

.category-card .gradient-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.category-card:hover .gradient-overlay::after {
    opacity: 1;
}

.category-card .tire-hover-image {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    width: 80%;
    z-index: 3;
    opacity: 0;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.category-card:hover .tire-hover-image {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.7);
}

.category-card .text-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    z-index: 4;
    transition: transform 0.5s ease;
}

.category-card:hover .text-content {
    transform: translateY(-10px);
}

.category-card.active {
    border-color: #f1c40f;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.3);
}

/* --- ZOOM DEL MODAL --- */
.zoom-container {
    position: relative;
    cursor: crosshair;
    overflow: hidden;
    background-color: #fff;
    border-radius: 1rem;
    width: 100%;
    max-width: 550px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.zoom-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.zoom-lens {
    position: absolute;
    border: 1px solid #d4ac0d;
    width: 150px;
    height: 150px;
    background-color: rgba(241, 196, 15, 0.1);
    display: none;
    z-index: 10;
    cursor: crosshair;
    pointer-events: none;
}

.zoom-result {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-repeat: no-repeat;
    display: none;
    z-index: 20;
    background-color: #fff;
    border-radius: 1rem;
}

.zoom-container:hover .zoom-lens,
.zoom-container:hover .zoom-result {
    display: block;
}

.zoom-container:hover img {
    opacity: 0.3;
}

/* --- MODAL Y AUXILIARES --- */
.modal-overlay {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: none;
}

.no-scroll {
    overflow: hidden;
}

.pagination-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

p strong,
p b,
.prose strong,
.prose b {
    color: #ffffff;
    font-weight: 700;
}

.img-grayscale {
    filter: grayscale(100%) opacity(60%) !important;
    transition: all 0.3s ease;
}

.badge-stock {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 20;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.55rem;
    font-family: 'Goldman', cursive;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .badge-stock {
        top: 1rem;
        right: 1rem;
        padding: 0.25rem 0.75rem;
        font-size: 0.65rem;
    }
}

.badge-soldout {
    background-color: #ef4444;
    color: white;
}

.badge-comingsoon {
    background-color: #3b82f6;
    color: white;
}

.badge-available {
    background-color: transparent;
    color: #f1c40f;
    border: 1px solid #f1c40f;
}

/* --- FILTROS (CHECKBOXES RECTOS) --- */
.filter-group-title {
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}

.custom-checkbox {
    appearance: none;
    background-color: transparent;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.1em;
    height: 1.1em;
    border: 2px solid #444;
    border-radius: 0;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-checkbox::before {
    content: "";
    width: 0.6em;
    height: 0.6em;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: black;
}

.custom-checkbox:checked {
    background-color: #f1c40f;
    border-color: #f1c40f;
}

.custom-checkbox:checked::before {
    transform: scale(1);
}

/* --- BOTONES DEL SIDEBAR --- */
.btn-sidebar-aplicar {
    background-color: #f1c40f;
    color: #000;
    font-weight: bold;
    font-family: 'Goldman', cursive;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-radius: 0;
    width: 100%;
    transition: all 0.2s;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.btn-sidebar-aplicar:hover {
    background-color: #d4ac0d;
    transform: scale(1.02);
}

.btn-sidebar-limpiar {
    background-color: transparent;
    color: #fff;
    border: 1px solid #444;
    font-weight: bold;
    font-family: 'Goldman', cursive;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-radius: 0;
    width: 100%;
    transition: all 0.2s;
}

.btn-sidebar-limpiar:hover {
    background-color: #222;
    border-color: #f1c40f;
    color: #f1c40f;
}

/* --- INPUTS Y SELECTS RECTOS --- */
.input-recto {
    border-radius: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #0a0a0a;
    transition: border-color 0.3s;
}

.input-recto:focus {
    border-color: #f1c40f;
    box-shadow: none;
}

/* --- RESPONSIVE WORKAROUND --- */
@media (max-width: 767px) {
    #mobile-filters {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    #mobile-filters.open {
        transform: translateX(0);
    }
}

/* --- SCROLLBARS --- */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f1c40f;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #333333 #0a0a0a;
}

.gold-flare-divider {
    width: 100%;
    max-width: 400px;
    height: 2px;
    margin: 15px auto;
    background: linear-gradient(to right, transparent 0%, #f1c40f 50%, transparent 100%);
    box-shadow: 0 0 10px #f1c40f, 0 0 20px #f1c40f;
    border-radius: 50%;
}