/* ==============================================
 * styles.css — Tienda Motoboxes (frontend público)
 * Fecha: 2026-03-26
 * ============================================== */

/* ---- Custom Properties ---- */
:root {
    --red: #CA0F1C;
    --red-hover: #a80c17;
    --red-light: rgba(202, 15, 28, 0.08);
    /* Rojo "premium" para secciones con fondo rojo a plena superficie:
       punto intermedio entre el primario brillante (#CA0F1C) y el rojo
       oscuro que probamos antes (#8d0a14). Menos agresivo sin perder
       energía ni caer en tono vinoso/apagado. */
    --red-dark: #b20d19;
    --black: #090000;
    --dark: #111111;
    --dark-bg: #0a0a0a;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;

    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;

    --container: 1200px;
    --header-height: 72px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --transition: 0.25s ease;
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--black);
    background: var(--white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    will-change: transform;
}

/* Hover genérico aplicable a TODOS los .btn: el botón "se levanta" 3px y
   gana una sombra suave. Los hover específicos (btn-primary, btn-outline-*)
   sobrescriben color/background pero heredan el transform+shadow. */
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}

/* Feedback táctil al clicar: "se clava" ligeramente */
.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* Foco accesible por teclado */
.btn:focus-visible {
    outline: 3px solid rgba(202, 15, 28, 0.4);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--red-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(202, 15, 28, 0.35);
}

.btn-outline-white {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline-white:hover {
    background: var(--white);
    color: var(--black);
}

.btn-outline-dark {
    background: transparent;
    color: var(--black);
    border: 2px solid var(--gray-300);
}

.btn-outline-dark:hover {
    border-color: var(--black);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 16px;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 13px;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* ==============================
   HEADER
   ============================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* Transparente por defecto: el header "flota" sobre el hero */
    background: transparent;
    height: var(--header-height);
    border-bottom: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), backdrop-filter var(--transition);
}

/* Al hacer scroll, oscurecemos el header con blur para que siga legible
   cuando pasa por encima de las secciones blancas inferiores. */
.site-header.scrolled {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

/* En páginas interiores (todo lo que NO es home) el header siempre es oscuro,
   ya desde el primer load, porque el fondo de esas páginas suele ser claro
   y con el header transparente el logo/nav no se verían. */
body.page-inside .site-header {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-logo img {
    height: 58px;
    width: auto;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-nav a {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    /* Header siempre sobre fondo oscuro (hero o scrolled con blur oscuro) */
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding: 4px 0;
    transition: color var(--transition);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red);
    transition: width var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--white);
}

.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}


.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Carrito en círculo rojo sólido con sombra roja desplazada detrás,
   mismo patrón visual que los iconos de features/categorías/contacto.
   Así destaca claramente sobre cualquier fondo de header (transparente
   sobre hero oscuro en home, oscuro sólido en páginas interiores). */
.header-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--red);
    border: none;
    box-shadow: 0 6px 16px rgba(202, 15, 28, 0.32);
    transition: transform .2s ease, box-shadow .2s ease;
}

/* Sombra "copia" difuminada detrás del círculo principal, offset diagonal */
.header-cart::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -10px;
    width: 100%;
    height: 100%;
    background: rgba(202, 15, 28, 0.28);
    border-radius: 50%;
    z-index: -1;
    filter: blur(4px);
}

.header-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(202, 15, 28, 0.45);
}

.header-cart svg {
    width: 22px;
    height: 22px;
    stroke: var(--white);
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--red);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    /* Barras claras para que lean sobre el header transparente/oscuro */
    background: var(--white);
    border-radius: 2px;
    transition: all var(--transition);
}

.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==============================
   HERO
   ============================== */
.hero {
    position: relative;
    /* Fondo dark como base + imagen de la moto anclada a la derecha.
       auto 100% escala la moto a la altura completa del hero → ocupa
       desde arriba hasta abajo como en la referencia. */
    background-color: var(--dark-bg);
    background-image: url('/images/banner-moto.jpg');
    background-repeat: no-repeat;
    /* Desplazamos la moto 250px más allá del borde derecho del contenedor
       para que el texto respire y la moto quede claramente a la derecha. */
    background-position: right -600px center;
    background-size: auto 100%;
    color: var(--white);
    min-height: 720px;
    display: flex;
    align-items: center;
    margin-top: 0;
    padding-top: var(--header-height);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Degradado horizontal: muy oscuro a la izquierda (legibilidad del texto)
       y transparente a la derecha para dejar ver la moto. */
    background: linear-gradient(100deg,
        rgba(10, 10, 10, 1) 0%,
        rgba(10, 10, 10, 1) 42%,
        rgba(10, 10, 10, 0.55) 65%,
        rgba(10, 10, 10, 0.15) 85%,
        rgba(10, 10, 10, 0) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 650px;
    padding: 80px 0;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--red);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--gray-400);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 60px;
    padding-top: 40px;
    position: relative;
    /* border-top reemplazado por un pseudo-elemento animado (ver ::before).
       Dejamos border-top: none explícito para documentar la decisión. */
    border-top: none;
}

/* Línea separadora animada encima de las cifras (9.500+ / 20+ / 100%).
   Tramo corto que se desliza de izquierda a derecha y vuelve en bucle,
   en sintonía con las líneas animadas de la CTA. */
.hero-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    will-change: transform;
    animation: hero-stats-line-sway 7s ease-in-out infinite;
}

@keyframes hero-stats-line-sway {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(150%); } /* 150% de su propia anchura (40%) = 60% del padre */
}

@media (prefers-reduced-motion: reduce) {
    .hero-stats::before {
        animation: none;
        width: 100%;
        background: rgba(255, 255, 255, 0.25); /* volver a la raya continua discreta */
    }
}

.hero-stat-number {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: var(--white);
    /* Dígitos de ancho fijo para que la animación del contador no "salte" */
    font-variant-numeric: tabular-nums;
}

.hero-stat-number span {
    color: var(--red);
}

/* ==============================
   PAGE HERO (páginas interiores: Contacto, Aviso legal, etc.)
   ============================== */
.page-hero {
    position: relative;
    background: var(--dark-bg);
    color: var(--white);
    /* El padding-top deja espacio suficiente bajo el header fijo (72px) + aire */
    padding-top: 160px;
    padding-bottom: 80px;
    padding-left: 0;
    padding-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

/* Modificador específico de la página de contacto: fondo panorámico
   con overlay oscuro en dos capas (gradiente vertical suave + overlay
   izquierdo más opaco para garantizar legibilidad del texto). */
.page-hero--contacto {
    background-color: var(--dark-bg);
    background-image:
        linear-gradient(100deg, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.55) 50%, rgba(10,10,10,0.35) 100%),
        url('/images/fondo-contacto.jpg');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
}

.page-hero .breadcrumb {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-hero .breadcrumb a {
    color: var(--gray-400);
    transition: color var(--transition);
}

.page-hero .breadcrumb a:hover {
    color: var(--white);
}

.page-hero .breadcrumb-current {
    color: var(--white);
    font-weight: 600;
}

.page-hero .section-label {
    margin-bottom: 14px;
}

.page-hero-title {
    font-family: var(--font-heading);
    font-size: 52px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}

.page-hero-subtitle {
    font-size: 17px;
    color: var(--gray-400);
    max-width: 620px;
    line-height: 1.6;
}

/* ==============================
   SECCIÓN CONTACTO
   ============================== */
/* Fondo gris plano — las cards (info negra + form blanca) tienen ya su
   propio peso visual; meter imagen aquí saturaba el conjunto. */
.section-contacto {
    background: var(--gray-100);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 48px;
    align-items: start;
}

/* Flash messages */
.contact-flash {
    padding: 16px 20px;
    margin-bottom: 32px;
    font-size: 15px;
    font-weight: 600;
    border-left: 4px solid;
    background: var(--white);
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.contact-flash--success {
    border-left-color: #16a34a;
    color: #14532d;
    background: #f0fdf4;
}

.contact-flash--error {
    border-left-color: var(--red);
    color: #7a0a12;
    background: #fef2f2;
}

/* Columna info: card oscura con borde rojo superior (look de Motoboxes) */
.contact-info {
    background: #111;
    color: var(--white);
    padding: 40px 36px;
    border-top: 5px solid var(--red);
    box-shadow: 0 18px 38px rgba(0,0,0,0.18);
}

.contact-info h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--white);
}

.contact-info-lead {
    font-size: 15px;
    color: var(--gray-400);
    line-height: 1.55;
    margin-bottom: 32px;
}

.contact-info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.contact-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* Icono con el mismo estilo que el carrusel de features de la home:
   círculo rojo sólido + círculo-sombra desplazado y difuminado detrás. */
.contact-info-icon {
    position: relative;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(202, 15, 28, 0.28);
}

.contact-info-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -12px;
    width: 100%;
    height: 100%;
    background: rgba(202, 15, 28, 0.25);
    border-radius: 50%;
    z-index: -1;
    filter: blur(4px);
}

.contact-info-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--white);
    fill: none;
}

.contact-info-list h4 {
    font-size: 13px;
    font-weight: 700;
    margin: 2px 0 4px;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.contact-info-list a,
.contact-info-list span {
    font-size: 16px;
    color: var(--gray-300);
    line-height: 1.45;
}

.contact-info-list a {
    transition: color .15s ease;
}

.contact-info-list a:hover {
    color: var(--white);
}

.contact-whatsapp-btn {
    width: 100%;
    justify-content: center;
}

/* Columna formulario: blanco con sombra + borde fino negro */
.contact-form {
    background: var(--white);
    padding: 44px 40px;
    border: 1px solid #111;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.contact-form h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--black);
}

.contact-form-lead {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.55;
    margin-bottom: 28px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-row .form-field {
    margin-bottom: 0;
}

.form-field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-field .required {
    color: var(--red);
}

.form-field input,
.form-field textarea {
    font-family: inherit;
    font-size: 15px;
    color: var(--black);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 13px 16px;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    width: 100%;
    resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(202, 15, 28, 0.12);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--gray-400);
}

.contact-form-note {
    font-size: 13px;
    color: var(--gray-500);
    margin: 6px 0 24px;
    line-height: 1.5;
}

.contact-form-note a {
    color: var(--red);
    font-weight: 600;
}

/* Checkbox de política de privacidad: ocultamos el nativo y pintamos uno
   propio con pseudo-elementos para que case con la estética del form. */
.form-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 8px 0 24px;
}

.form-checkbox-wrap input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    margin-top: 1px;
    transition: border-color .15s ease, background .15s ease;
}

.form-checkbox-wrap input[type="checkbox"]:hover {
    border-color: var(--red);
}

.form-checkbox-wrap input[type="checkbox"]:focus-visible {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(202, 15, 28, 0.15);
}

.form-checkbox-wrap input[type="checkbox"]:checked {
    background: var(--red);
    border-color: var(--red);
}

.form-checkbox-wrap input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 11px;
    border: solid var(--white);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.form-checkbox-wrap label {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.5;
    cursor: pointer;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.form-checkbox-wrap label a {
    color: var(--red);
    font-weight: 600;
}

.form-checkbox-wrap label .required {
    color: var(--red);
}

/* ========================
   MODAL DE ÉXITO (contacto)
   ======================== */
/* Overlay a pantalla completa con el diálogo centrado. Se renderiza
   por PHP solo cuando hay flash de éxito y se elimina del DOM al cerrar. */
.success-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
    animation: successModalFadeIn .25s ease-out;
    box-sizing: border-box;
}

@keyframes successModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.success-modal-dialog {
    position: relative;
    background: var(--white);
    max-width: 480px;
    width: 100%;
    padding: 48px 36px 36px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: successModalSlideIn .3s cubic-bezier(.2,.9,.3,1.1);
    border-top: 5px solid var(--red);
}

@keyframes successModalSlideIn {
    from { transform: translateY(30px) scale(.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.success-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 50%;
    transition: background .15s ease, color .15s ease;
}

.success-modal-close:hover {
    background: var(--gray-100);
    color: var(--black);
}

.success-modal-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--red);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 24px rgba(202, 15, 28, 0.3);
    position: relative;
}

.success-modal-icon::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -16px;
    width: 100%;
    height: 100%;
    background: rgba(202, 15, 28, 0.22);
    border-radius: 50%;
    z-index: -1;
    filter: blur(6px);
}

.success-modal-dialog h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--black);
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}

.success-modal-dialog p {
    color: var(--gray-600);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 8px;
}

.success-modal-footer {
    font-size: 13px !important;
    color: var(--gray-400) !important;
    margin-top: 14px !important;
}

.success-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}

.success-modal-actions .btn {
    min-width: 140px;
    justify-content: center;
}

.contact-form .btn {
    min-width: 220px;
}

/* ==============================
   BUSCADOR DEL CATÁLOGO
   ============================== */
/* ==============================
   FILTRO IN-PAGE DEL CATÁLOGO
   ============================== */
/* Wrapper: input + dropdowns, filtro instantáneo en la misma página. */
.catalog-filter {
    max-width: 800px;
    margin: 0 auto 40px;
}

/* Fila principal: icono + input de texto (+ botón Buscar solo en modo redirect) */
.catalog-filter-search {
    display: flex;
    align-items: stretch;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.catalog-filter-search:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(202, 15, 28, 0.12), 0 6px 18px rgba(0, 0, 0, 0.08);
}

.catalog-filter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px 0 18px;
    color: var(--gray-400);
    flex-shrink: 0;
}

.catalog-filter-icon svg {
    width: 20px;
    height: 20px;
}

.catalog-filter-search input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    padding: 16px 12px;
    color: var(--black);
    font-family: inherit;
    min-width: 0;
}

.catalog-filter-search input[type="search"]::placeholder {
    color: var(--gray-400);
}

.catalog-filter-search input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
}

.catalog-filter-submit {
    border: none;
    background: var(--red);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 28px;
    cursor: pointer;
    transition: background .15s ease;
    flex-shrink: 0;
}

.catalog-filter-submit:hover {
    background: var(--red-hover);
}

/* --------------------------------------------------------------
   Variante COMPACTA del buscador de piezas in-page (marca / modelo
   / año / categoría). Buscador pequeño y discreto bajo el título,
   con desplegable de resultados en carrusel.
   -------------------------------------------------------------- */
.catalog-filter--compact {
    max-width: 520px;
    margin: 0 auto 24px;
    /* Ancla del desplegable de resultados; z-index alto para que el popup quede
       SIEMPRE por encima de las tarjetas/secciones de abajo */
    position: relative;
    z-index: 300;
}

/* Compacto pero visible: caja blanca con sombra suave y botón rojo.
   (La primera versión en gris plano pasaba TAN desapercibida que la
   usuaria pidió recuperar algo de presencia sin crecer de tamaño.) */
.catalog-filter--compact .catalog-filter-search {
    background: var(--white);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

.catalog-filter--compact .catalog-filter-icon {
    padding: 0 6px 0 12px;
}

.catalog-filter--compact .catalog-filter-icon svg {
    width: 16px;
    height: 16px;
}

.catalog-filter--compact .catalog-filter-search input[type="search"] {
    font-size: 14px;
    padding: 10px 10px;
}

.catalog-filter--compact .catalog-filter-submit {
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 0 18px;
}

/* --------------------------------------------------------------
   Desplegable de resultados del buscador de piezas (cf-popup).
   Se desliza hacia abajo desde el buscador; dentro, carrusel
   horizontal de mini-tarjetas (4 visibles en desktop) con flechas
   y botón "Consultar esta búsqueda".
   -------------------------------------------------------------- */
.cf-popup {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    width: min(760px, 92vw);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
    padding: 14px;
    z-index: 300;
    /* Oculto por defecto. NO transicionamos 'visibility' a propósito: en algunos
       navegadores (Safari) transicionar visibility deja el popup oculto de forma
       permanente. Solo animamos opacity/transform; visibility conmuta al instante. */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
}

.cf-popup.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* El JS alterna [hidden] en carrusel/vacío/botón; debe ganar a los display propios */
.cf-popup [hidden] {
    display: none !important;
}

.cf-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cf-arrow {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.cf-arrow:hover {
    border-color: var(--red);
    color: var(--red);
}

.cf-arrow svg {
    width: 16px;
    height: 16px;
}

.cf-arrow.is-hidden {
    display: none;
}

/* Tira deslizante: scroll horizontal con snap, sin scrollbar visible */
.cf-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cf-strip::-webkit-scrollbar {
    display: none;
}

/* Mini-tarjeta de pieza: 4 por vista en desktop (3 gaps de 10px) */
.cf-item {
    flex: 0 0 calc((100% - 30px) / 4);
    scroll-snap-align: start;
    display: block;
    text-decoration: none;
    color: inherit;
}

.cf-item img,
.cf-item-noimg {
    width: 100%;
    height: 92px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--gray-100);
    display: block;
}

.cf-item-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    margin: 8px 0 4px;
    color: var(--black);
}

.cf-item:hover .cf-item-title {
    color: var(--red);
}

.cf-item-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
}

/* Etiqueta de pieza de otra moto compatible con la de esta página */
.cf-item-compat {
    display: inline-block;
    background: #1d4ed8;
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    margin: 0 0 4px;
}

.cf-empty {
    text-align: center;
    padding: 18px 10px;
}

.cf-empty p {
    font-size: 14.5px;
    color: var(--gray-500);
    margin: 0 0 4px;
}

.cf-empty .cf-empty-sub {
    font-size: 13px;
    color: var(--gray-400);
}

.cf-foot {
    margin-top: 12px;
    text-align: center;
}

.cf-consultar {
    border: none;
    background: var(--red);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
}

.cf-consultar:hover {
    background: var(--red-hover);
}

@media (max-width: 900px) {
    .cf-item {
        flex-basis: calc((100% - 20px) / 3);
    }
}

@media (max-width: 560px) {
    .cf-item {
        flex-basis: calc((100% - 10px) / 2);
    }
}

@media (max-width: 640px) {
    .catalog-filter {
        margin-bottom: 28px;
    }
    .catalog-filter-search input[type="search"] {
        font-size: 15px;
        padding: 13px 8px;
    }
    .catalog-filter-submit {
        padding: 0 18px;
        font-size: 13px;
        letter-spacing: 0.5px;
    }
    .catalog-filter-icon {
        padding: 0 4px 0 14px;
    }
}

/* Honeypot: invisible para humanos, pero no oculto con display:none
   (algunos bots lo detectan). Lo sacamos del viewport. */
.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==============================
   SECCIÓN MAPA (contacto)
   ============================== */
/* Fondo panorámico con overlay blanco translúcido: la imagen se ve sutilmente
   detrás del header ("Dónde estamos / Pol. Ind. La Fuensanta"). El iframe
   del mapa ocupa la parte inferior, así que la imagen respira arriba. */
.section-mapa {
    position: relative;
    background-color: var(--gray-100);
    background-image:
        linear-gradient(rgba(245, 245, 245, 0.88), rgba(245, 245, 245, 0.88)),
        url('/images/fondo-contacto2.jpg');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    padding: 0;
}

.section-mapa .container {
    padding: 0 0 64px;
    max-width: 1200px;
}

.section-mapa-header {
    text-align: center;
    padding: 56px 20px 32px;
}

.section-mapa-header h2 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--black);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.section-mapa-header p {
    color: var(--gray-500);
    font-size: 15px;
    margin: 0;
}

.section-mapa-frame {
    position: relative;
    width: 100%;
    height: 440px;
    border: 1px solid #111;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    overflow: hidden;
}

.section-mapa-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.hero-stat-label {
    font-size: 14px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ==============================
   SECTIONS
   ============================== */
.section {
    padding: 80px 0;
}

.section-dark {
    background: var(--dark-bg);
    color: var(--white);
}

.section-gray {
    background: var(--gray-50);
}

.section-red {
    /* Rojo más oscuro/tostado para áreas amplias: más fácil a la vista
       y da sensación más premium que el rojo primario saturado. */
    background: var(--red-dark);
    color: var(--white);
}

/* ==============================
   Bloque de contenido SEO (pie de páginas de catálogo)
   Texto rico (descripción de marca/modelo/año) VISIBLE y legible. Ancho de
   lectura limitado, tipografía cómoda y acentos de marca en los encabezados.
   Estilos pensados para el HTML que genera el editor Quill (h2/h3, p, ul/ol,
   strong, a, blockquote, alineaciones .ql-align-*).
   ============================== */
.seo-content {
    padding: clamp(48px, 7vw, 80px) 0;
    border-top: 1px solid var(--gray-200);
}
.seo-content-inner {
    max-width: 820px;
    margin: 0 auto;
    color: var(--gray-700);
    font-size: 16px;
    line-height: 1.75;
}
.seo-content-inner > *:first-child {
    margin-top: 0;
}
.seo-content-inner h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    line-height: 1.3;
    color: var(--black);
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--red);
}
.seo-content-inner h3 {
    font-family: var(--font-heading);
    font-size: 19px;
    color: var(--black);
    margin: 28px 0 10px;
}
.seo-content-inner p {
    margin: 0 0 16px;
}
.seo-content-inner ol {
    margin: 0 0 20px;
    padding-left: 22px;
}
.seo-content-inner ol li {
    margin-bottom: 8px;
}
/* Listas con viñeta: bullet rojo de marca en vez del disco por defecto */
.seo-content-inner ul {
    list-style: none;
    margin: 0 0 20px;
    padding-left: 0;
}
.seo-content-inner ul li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
}
.seo-content-inner ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 11px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
}
.seo-content-inner a {
    color: var(--red);
    text-decoration: underline;
}
.seo-content-inner a:hover {
    color: var(--red-hover);
}
.seo-content-inner strong {
    color: var(--black);
    font-weight: 700;
}
.seo-content-inner blockquote {
    margin: 0 0 20px;
    padding: 12px 20px;
    border-left: 3px solid var(--red);
    background: var(--white);
    color: var(--gray-600);
    font-style: italic;
}
/* Alineaciones que puede aplicar el editor Quill */
.seo-content-inner .ql-align-center { text-align: center; }
.seo-content-inner .ql-align-right { text-align: right; }
.seo-content-inner .ql-align-justify { text-align: justify; }

/* CTA intermedio rojo ("Empieza a buscar tu recambio") entre features y
   categorías. Título grande, chips visuales con el flujo de búsqueda
   (Marca → Modelo → Año), subtítulo y botón grande abajo. */
.section-cta-moto {
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Rayas decorativas en los laterales del banner. Cada línea cruza una
   distancia grande en bucle (casi hasta donde empieza la del otro lado)
   y vuelve, en direcciones opuestas → sensación de "respiración".
   El importe del desplazamiento es responsive via clamp():
     - mínimo 160px (móviles estrechos)
     - ideal 40vw (crece con la pantalla)
     - máximo 680px (desktop ancho, no se sale) */
.section-cta-moto {
    --cta-sway: clamp(160px, 40vw, 680px);
}

.section-cta-moto::before,
.section-cta-moto::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 2px;
    background: rgba(255,255,255,0.35);
    pointer-events: none;
    will-change: transform;
}
.section-cta-moto::before {
    top: 34px;
    left: 10%;
    animation: cta-line-sway-right 8s ease-in-out infinite;
}
.section-cta-moto::after {
    bottom: 34px;
    right: 10%;
    animation: cta-line-sway-left 8s ease-in-out infinite;
}

/* Oscilación hacia la derecha (y vuelta). Usada por ::before,
   que nace anclada arriba-izquierda. Recorre ~40vw, casi hasta
   encontrarse con la línea de abajo. */
@keyframes cta-line-sway-right {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(var(--cta-sway)); }
}

/* Oscilación hacia la izquierda (y vuelta). Usada por ::after,
   que nace anclada abajo-derecha — simétrica a la anterior. */
@keyframes cta-line-sway-left {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(calc(var(--cta-sway) * -1)); }
}

/* Accesibilidad: los usuarios con "reducir movimiento" activado
   (macOS/iOS Accessibility) ven las líneas quietas. */
@media (prefers-reduced-motion: reduce) {
    .section-cta-moto::before,
    .section-cta-moto::after {
        animation: none;
    }
}

.section-cta-moto .cta-banner {
    padding: 64px 20px;
    position: relative;
    z-index: 1;
}

/* Chips de los 3 pasos del filtrado (Marca → Modelo → Año) */
.cta-moto-steps {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 26px;
    flex-wrap: wrap;
}
.cta-moto-step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    padding: 10px 20px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--white);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.cta-moto-step svg {
    width: 18px;
    height: 18px;
    stroke: var(--white);
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}
.cta-moto-arrow {
    display: inline-flex;
    align-items: center;
    opacity: 0.55;
}
.cta-moto-arrow svg {
    width: 16px;
    height: 16px;
    stroke: var(--white);
    fill: none;
    stroke-width: 2.5;
}

.section-cta-moto .cta-banner h2 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 14px;
}
.section-cta-moto .cta-banner p {
    font-size: 17px;
    margin-bottom: 32px;
    max-width: 620px;
}
.section-cta-moto .cta-banner strong {
    font-weight: 800;
    color: var(--white);
    border-bottom: 2px solid rgba(255,255,255,0.45);
    padding-bottom: 1px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--red);
    margin-bottom: 18px;
}

/* Líneas decorativas a ambos lados del label */
.section-label::before,
.section-label::after {
    content: '';
    width: 36px;
    height: 2px;
    background: var(--red);
    display: inline-block;
}

.section-dark .section-label {
    color: var(--red);
}

.section-title {
    font-size: 52px;
    font-weight: 800;
    color: var(--black);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.section-dark .section-title {
    color: var(--white);
}

.section-subtitle {
    font-size: 17px;
    color: var(--gray-500);
    max-width: 600px;
    margin: 12px auto 0;
}

.section-dark .section-subtitle {
    color: var(--gray-400);
}

/* ==============================
   SECCIÓN CATEGORÍAS (fondo + cards)
   ============================== */
/* Fondo con imagen + overlay semi-transparente para mantener legibilidad */
.section-categorias {
    position: relative;
    background-color: var(--gray-100);
    background-image: url('/images/fondo-seccion-categorias.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    overflow: hidden;
}

.section-categorias::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(245, 245, 245, 0.82);
    pointer-events: none;
}

.section-categorias > .container {
    position: relative;
    z-index: 1;
}

/* Grid base de categorías: 4 columnas con wrap a múltiples filas.
   Lo usan marcas, modelos, años y productos. */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

/* Carrusel horizontal de categorías en la home: todas las cards en una
   línea, con autoplay + flechas prev/next manejadas por JS. Los estilos
   flex/scroll están SCOPEADOS al wrapper .categories-carousel para no
   romper el grid normal en las páginas de marcas/modelos/años. */
.categories-carousel {
    position: relative;
    padding: 0 56px;
}

.categories-carousel .categories-grid {
    display: flex;
    gap: 28px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 4px;
}

.categories-carousel .categories-grid::-webkit-scrollbar {
    display: none;
}

.categories-carousel .categories-grid .category-card {
    flex: 0 0 calc((100% - 84px) / 4);
    scroll-snap-align: start;
}

/* Flechas de navegación prev/next */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: background .25s ease, transform .25s ease;
}

.carousel-arrow:hover {
    background: var(--red);
    transform: translateY(-50%) scale(1.08);
}

.carousel-arrow svg {
    width: 22px;
    height: 22px;
}

.carousel-arrow--prev { left: 0; }
.carousel-arrow--next { right: 0; }

/* Card base: blanca con sombra suave (usada en marcas/modelos/años/productos).
   El estilo oscuro solo aplica dentro del carrusel de la home, donde se
   sobrescribe más abajo con el selector .categories-carousel .category-card */
.category-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.category-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.14);
    border-color: var(--red);
}

/* ----- Estado del producto (color por tipo) y disponibilidad -----
   ESTADO: badge SÓLIDO (fondo de color + texto blanco), MISMO color y forma en
   toda la web (ficha, listados, home, buscador). Nuevo=verde, Buen estado=naranja,
   Con desperfectos=rojo, Reacondicionado=amarillo. Se pinta con el partial
   partials/estado_badge.php para no repetir la lógica en cada vista. */
.estado-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    line-height: 1.3;
    color: #fff;
    white-space: nowrap;
}
.estado-badge--nuevo            { background: #16a34a; }             /* verde */
.estado-badge--buen_estado      { background: #ea580c; }             /* naranja */
.estado-badge--con_desperfectos { background: var(--red); }          /* rojo */
.estado-badge--reacondicionado  { background: #eab308; color: #3f2d00; } /* amarillo (texto oscuro por contraste) */

/* Posición en la esquina de la imagen en las tarjetas de listado */
.estado-badge--corner {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: 11px;
    padding: 4px 9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* DISPONIBILIDAD: forma DISTINTA a la de estado (píldora con punto), para que
   no se confunda con las etiquetas de estado. Solo aparece en la ficha. */
.dispo-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid currentColor;
    background: var(--white);
    color: var(--gray-700);
}
.dispo-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.dispo-badge--en_stock      { color: #15803d; }
.dispo-badge--reservado     { color: #c2410c; }
.dispo-badge--solo_recogida { color: var(--red); }
.dispo-badge--consultar_envio { color: var(--gray-700); }

/* ----- Botón WhatsApp (verde de marca WhatsApp) ----- */
.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: 1px solid #25D366;
}
.btn-whatsapp:hover { background: #1da851; border-color: #1da851; color: #fff; }

/* Referencias bajo el título de la ficha: dos líneas, pequeñas y en gris */
.pd-refs { margin: 0 0 14px; }
.pd-refs p { color: var(--gray-500); font-size: 13px; margin: 0 0 2px; line-height: 1.5; }

/* ----- Ficha: Descripción (70%) + Compatibilidad (30%) lado a lado ----- */
.producto-detalle-cols { display: flex; gap: 40px; align-items: flex-start; }
.pd-col-descripcion { flex: 1 1 70%; min-width: 0; }
.pd-col-compat {
    flex: 0 0 30%;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.pd-compat-item { font-size: 15px; color: var(--gray-700); margin: 0; }
.pd-compat-list { margin: 8px 0 0; padding-left: 18px; }
.pd-compat-list li { font-size: 14px; line-height: 1.7; }
.pd-compat-list a { color: var(--red); font-weight: 600; }
@media (max-width: 768px) {
    .producto-detalle-cols { flex-direction: column; gap: 28px; }
    .pd-col-compat { flex-basis: auto; width: 100%; }
}

/* Badge "Compatible" (venta cruzada): AZUL, para distinguirlo del estado.
   Doble clase (.product-badge.product-badge--compat) para ganar en especificidad
   a .product-badge (que llega después en el CSS y si no lo pintaría rojo). */
.product-badge.product-badge--compat { background: #1d4ed8; }

/* Nota "(compatible con tu búsqueda)" bajo la marca en los resultados de /buscar */
.product-brand-compat {
    color: #1d4ed8;
    font-weight: 600;
}

/* ----- Buscador general del hero (home) ----- */
.hero-search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 560px;
    margin: 0 0 28px;
    background: #fff;
    border-radius: 50px;
    padding: 6px 6px 6px 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.hero-search-icon { width: 20px; height: 20px; color: var(--gray-500); flex-shrink: 0; }
.hero-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--black);
    background: transparent;
    min-width: 0;
}
.hero-search-btn {
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 50px;
    transition: background 0.15s ease;
}
.hero-search-btn:hover { background: var(--red-hover); }
@media (max-width: 560px) {
    .hero-search { flex-wrap: wrap; border-radius: 16px; padding: 12px; }
    .hero-search-input { width: 100%; padding: 4px 0; }
    .hero-search-btn { width: 100%; }
}

/* OVERRIDE: en el carrusel de la home las cards son negras con texto blanco,
   ángulos rectos y sombra más intensa. Scoped al carrusel para no tocar
   las cards que se reutilizan en marcas/modelos/años/productos. */
.categories-carousel .category-card {
    background: #111;
    border: none;
    border-radius: 0;
    padding: 44px 24px 40px;
    min-height: 260px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.categories-carousel .category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
    border-color: transparent;
}

/* En el carrusel de la home ocultamos el icono para dejar protagonismo a la
   imagen de fondo. El texto lleva doble text-shadow (halo oscuro para contraste
   + halo blanco sutil para "fusionar" la palabra con la foto). */
.categories-carousel .category-card .category-icon {
    display: none;
}

.categories-carousel .category-card h3 {
    color: var(--white);
    font-size: 22px;
    font-weight: 800;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.85),
        0 0 14px rgba(255, 255, 255, 0.35);
}

.categories-carousel .category-card p {
    color: var(--gray-300);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ----- Imágenes de fondo por categoría (SOLO en el carrusel de la home) -----
   Patrón de dos capas: gradiente negro al 50% sobre la imagen para atenuarla y
   que el texto blanco se lea, pero dejando ver la foto. Al hacer hover bajamos
   el overlay al 35% → la imagen gana intensidad. (Se probó sin overlay pero el
   texto no se leía; se restauró el 2026-07-21.) */
.categories-carousel .category-card--motor        { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-motor.jpg'); }
.categories-carousel .category-card--carroceria   { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-carroceria.jpg'); }
.categories-carousel .category-card--electricidad { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-electricidad.jpg'); }
.categories-carousel .category-card--chasis       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-chasis.jpg'); }
.categories-carousel .category-card--transmision  { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-transmision.jpg'); }
.categories-carousel .category-card--frenos       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-frenos.jpg'); }
.categories-carousel .category-card--escape       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-escape.jpg'); }
.categories-carousel .category-card--ruedas       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-ruedas.jpg'); }
.categories-carousel .category-card--accesorios   { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-accesorios.jpg'); }

/* Propiedades comunes a todas las cards del carrusel con imagen */
.categories-carousel .category-card[class*="category-card--"] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hover: overlay más transparente → imagen más visible */
.categories-carousel .category-card--motor:hover       { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-motor.jpg'); }
.categories-carousel .category-card--carroceria:hover  { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-carroceria.jpg'); }
.categories-carousel .category-card--electricidad:hover { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-electricidad.jpg'); }
.categories-carousel .category-card--chasis:hover      { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-chasis.jpg'); }
.categories-carousel .category-card--transmision:hover { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-transmision.jpg'); }
.categories-carousel .category-card--frenos:hover      { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-frenos.jpg'); }
.categories-carousel .category-card--escape:hover      { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-escape.jpg'); }
.categories-carousel .category-card--ruedas:hover      { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-ruedas.jpg'); }
.categories-carousel .category-card--accesorios:hover  { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-accesorios.jpg'); }

/* ==============================
   GRID ESTÁTICO DE CATEGORÍAS (página /categorias)
   ============================== */
/* Mismo estilo visual que el carrusel de la home (cards negras con imagen de
   fondo) pero renderizado en grid estático de filas y columnas sin autoplay.
   Las imágenes se referencian con :is() para no duplicar las 18 reglas de
   background-image: el navegador aplica la misma regla si el padre es
   .categories-carousel O .categories-dark-grid. */
.categories-dark-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

/* Base oscura de las cards (misma que .categories-carousel) */
.categories-dark-grid .category-card {
    background: #111;
    border: none;
    border-radius: 0;
    padding: 44px 24px 40px;
    min-height: 260px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.categories-dark-grid .category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
    border-color: transparent;
}
.categories-dark-grid .category-card .category-icon { display: none; }
.categories-dark-grid .category-card h3 {
    color: var(--white);
    font-size: 22px;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,.85), 0 0 14px rgba(255,255,255,.35);
}

/* Imágenes de fondo por categoría (reutilizamos las mismas del carrusel) */
.categories-dark-grid .category-card--motor        { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-motor.jpg'); }
.categories-dark-grid .category-card--carroceria   { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-carroceria.jpg'); }
.categories-dark-grid .category-card--electricidad { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-electricidad.jpg'); }
.categories-dark-grid .category-card--chasis       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-chasis.jpg'); }
.categories-dark-grid .category-card--transmision  { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-transmision.jpg'); }
.categories-dark-grid .category-card--frenos       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-frenos.jpg'); }
.categories-dark-grid .category-card--escape       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-escape.jpg'); }
.categories-dark-grid .category-card--ruedas       { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-ruedas.jpg'); }
.categories-dark-grid .category-card--accesorios   { background-image: linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)), url('/images/categoria-accesorios.jpg'); }

/* Propiedades compartidas */
.categories-dark-grid .category-card[class*="category-card--"] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hover: imagen gana intensidad */
.categories-dark-grid .category-card--motor:hover        { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-motor.jpg'); }
.categories-dark-grid .category-card--carroceria:hover   { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-carroceria.jpg'); }
.categories-dark-grid .category-card--electricidad:hover { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-electricidad.jpg'); }
.categories-dark-grid .category-card--chasis:hover       { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-chasis.jpg'); }
.categories-dark-grid .category-card--transmision:hover  { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-transmision.jpg'); }
.categories-dark-grid .category-card--frenos:hover       { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-frenos.jpg'); }
.categories-dark-grid .category-card--escape:hover       { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-escape.jpg'); }
.categories-dark-grid .category-card--ruedas:hover       { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-ruedas.jpg'); }
.categories-dark-grid .category-card--accesorios:hover   { background-image: linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.35)), url('/images/categoria-accesorios.jpg'); }

/* Responsive */
@media (max-width: 1024px) {
    .categories-dark-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .categories-dark-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .categories-dark-grid .category-card { min-height: 200px; padding: 28px 18px 24px; }
    .categories-dark-grid .category-card h3 { font-size: 18px; }
}

/* Icono: círculo rojo sólido + círculo-sombra desplazado (mismo estilo que features-row) */
.category-icon {
    position: relative;
    width: 78px;
    height: 78px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    box-shadow: 0 8px 22px rgba(202, 15, 28, 0.28);
    transition: transform .35s ease;
}

.category-icon::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -14px;
    width: 100%;
    height: 100%;
    background: rgba(202, 15, 28, 0.22);
    border-radius: 50%;
    z-index: -1;
    filter: blur(5px);
}

.category-card:hover .category-icon {
    transform: scale(1.06);
}

.category-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--white);
    fill: none;
    stroke-width: 2;
}

.category-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--black);
    letter-spacing: -0.2px;
    margin: 0;
    position: relative;
    z-index: 2;
}

.category-card p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 6px;
    position: relative;
    z-index: 2;
}

/* El icono también necesita estar por encima del posible fondo de imagen */
.category-card .category-icon {
    position: relative;
    z-index: 2;
}

/* Nota: se eliminó la regla específica .category-card--motor. Ahora todas
   las cards comparten la misma imagen base vía .category-card. Si quieres
   dar imagen específica a alguna categoría, vuelve a crear una regla
   .category-card--<slug> con el mismo patrón de dos capas. */

/* ==============================
   PRODUCTS GRID
   ============================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

.product-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--red);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--gray-100);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--red);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.product-info {
    padding: 16px;
}

.product-brand {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-compat {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--red);
}

.product-price-old {
    font-size: 14px;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 400;
    margin-left: 6px;
}

/* Wrapper <form> del botón "+" (quick-add) para no romper el layout del pie */
.product-add-form {
    margin: 0;
    display: inline-flex;
}
.product-add-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--black);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.product-add-btn:hover {
    background: var(--red);
    transform: scale(1.1);
}

.product-add-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--white);
    fill: none;
    stroke-width: 2;
}

.product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    color: var(--gray-400);
}

.product-placeholder svg {
    width: 48px;
    height: 48px;
    stroke: var(--gray-300);
    fill: none;
    stroke-width: 1.5;
}

/* ==============================
   BRANDS
   ============================== */
.brands-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.brand-logo {
    height: 40px;
    width: auto;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all var(--transition);
}

.brand-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    transition: all var(--transition);
    min-width: 140px;
}

.brand-item:hover {
    background: var(--white);
    box-shadow: var(--shadow);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==============================
   MARCAS MARQUEE (carrusel infinito)
   ============================== */
/* Wrapper: oculta lo que queda fuera + fades laterales con mask-image */
.marcas-marquee {
    position: relative;
    overflow: hidden;
    padding: 28px 0 8px;
    /* Fade suave en bordes izquierdo/derecho para que los logos aparezcan
       y desaparezcan en vez de cortarse bruscamente. */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
}

/* Track: contiene 2× las marcas duplicadas para loop sin costuras.
   width:max-content hace que el contenedor sea exactamente del ancho
   de su contenido (sin wrap). La animación lo desplaza -50% (exactamente
   la mitad, que equivale a un pase completo), y al volver al 0% el
   segundo set ya está en la posición del primero → loop imperceptible. */
.marcas-marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    gap: 68px;
    animation: marcas-marquee-scroll 40s linear infinite;
}

/* Pausar al pasar el ratón — ayuda a que el usuario pueda hacer click
   en un logo concreto sin que se le escape. */
.marcas-marquee:hover .marcas-marquee-track {
    animation-play-state: paused;
}

@keyframes marcas-marquee-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

/* Un logo dentro del marquee */
.marca-marquee-item {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    min-width: 120px;
    padding: 0 16px;
    opacity: 0.55;
    filter: grayscale(100%);
    transition: opacity .25s ease, filter .25s ease, transform .25s ease;
}

.marca-marquee-item:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05);
}

.marca-marquee-item img {
    max-height: 56px;
    max-width: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.marca-marquee-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Accesibilidad: respetar prefers-reduced-motion — los usuarios con esa
   preferencia del sistema ven los logos sin animación. */
@media (prefers-reduced-motion: reduce) {
    .marcas-marquee-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        width: auto;
        gap: 40px;
    }
    .marcas-marquee {
        -webkit-mask-image: none;
                mask-image: none;
    }
}

@media (max-width: 768px) {
    .marcas-marquee-track {
        gap: 44px;
        animation-duration: 30s; /* un poco más rápido en móvil */
    }
    .marca-marquee-item {
        height: 48px;
        min-width: 90px;
        padding: 0 10px;
    }
    .marca-marquee-item img {
        max-height: 44px;
        max-width: 110px;
    }
}

/* ==============================
   PRODUCT DETAIL
   ============================== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.product-detail-image {
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

/* Imagen principal del carrusel — contenedor con flechas prev/next */
.pd-gallery-main {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    margin-bottom: 14px;
}

/* La imagen se adapta a su proporción natural (vertical u horizontal).
   max-height limita para que no estire la página en exceso. */
.pd-gallery-main img {
    width: 100%;
    display: block;
    object-fit: contain;
    max-height: 680px;
    transition: opacity .18s ease;
}

/* Flechas de navegación prev/next sobre la imagen principal */
.pd-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transition: opacity .2s ease, background .2s ease, transform .2s ease;
}

/* Flechas visibles al hacer hover sobre la galería */
.pd-gallery-main:hover .pd-gallery-arrow {
    opacity: 1;
}

.pd-gallery-arrow:hover {
    background: var(--red);
    transform: translateY(-50%) scale(1.08);
}

.pd-gallery-arrow svg {
    width: 22px;
    height: 22px;
}

.pd-gallery-arrow--prev { left: 12px; }
.pd-gallery-arrow--next { right: 12px; }

/* Strip de thumbnails debajo de la imagen principal */
.pd-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
}

.pd-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: var(--gray-50);
    padding: 0;
    opacity: 0.6;
    transition: opacity .15s ease, border-color .15s ease;
}

.pd-thumb:hover {
    opacity: 0.9;
    border-color: var(--gray-400);
}

.pd-thumb--active {
    opacity: 1;
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(202, 15, 28, 0.2);
}

.pd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback para imágenes viejas sin el nuevo markup */
.product-detail-image > img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    object-fit: contain;
    background: var(--gray-50);
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .product-detail-image {
        position: static;
    }

    .pd-gallery-main img {
        max-height: 450px;
    }

    .pd-thumb {
        width: 60px;
        height: 60px;
    }

    /* En móvil las flechas siempre visibles (no hay hover) */
    .pd-gallery-arrow {
        opacity: 0.8;
        width: 38px;
        height: 38px;
    }
    .pd-gallery-arrow svg { width: 18px; height: 18px; }
    .pd-gallery-arrow--prev { left: 8px; }
    .pd-gallery-arrow--next { right: 8px; }
}

/* ==============================
   CTA BANNER
   ============================== */
.cta-banner {
    text-align: center;
    padding: 64px 20px;
}

.cta-banner h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
}

.cta-banner p {
    font-size: 17px;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-banner .btn-primary {
    background: var(--white);
    color: var(--red);
}

.cta-banner .btn-primary:hover {
    background: var(--gray-100);
    box-shadow: var(--shadow-lg);
}

/* ==============================
   FEATURES ROW
   ============================== */
/* Fondo con imagen de ruedas + overlay blanco semi-transparente */
.section-features {
    position: relative;
    background-image: url('/images/fondo-ruedas.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    overflow: hidden;
}

.section-features::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    pointer-events: none;
}

.section-features > .container {
    position: relative;
    z-index: 1;
}

.features-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    padding: 72px 0;
    /* Sin border-top: la sección ya respira por sí sola */
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
}

/* Icono: círculo rojo con icono blanco + círculo-sombra desplazado detrás */
.feature-icon {
    position: relative;
    width: 76px;
    height: 76px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(202, 15, 28, 0.25);
}

/* Círculo-sombra: copia del círculo principal desplazada a la izquierda y
   difuminada, para conseguir el efecto "duplicado suave" del ejemplo. */
.feature-icon::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -14px;
    width: 100%;
    height: 100%;
    background: rgba(202, 15, 28, 0.22);
    border-radius: 50%;
    z-index: -1;
    filter: blur(4px);
}

.feature-icon svg {
    width: 34px;
    height: 34px;
    stroke: var(--white);
    fill: none;
    stroke-width: 2;
}

.feature-item h4 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--black);
    letter-spacing: -0.2px;
}

.feature-item p {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.55;
    max-width: 220px;
}

/* ==============================
   FOOTER
   ============================== */
.site-footer {
    background: var(--dark-bg);
    color: var(--gray-400);
    padding: 64px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    margin: 16px 0;
    max-width: 300px;
}

.footer-logo img {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-col h4 {
    font-family: var(--font-heading);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    font-size: 14px;
    color: var(--gray-400);
    transition: color var(--transition);
}

.footer-col ul li a:hover {
    color: var(--white);
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.footer-contact-item svg {
    width: 18px;
    height: 18px;
    stroke: var(--red);
    fill: none;
    stroke-width: 2;
    min-width: 18px;
}

.footer-bottom {
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.footer-legal a {
    color: var(--gray-400);
    margin-left: 24px;
}

.footer-legal a:hover {
    color: var(--white);
}

/* ==============================
   WHATSAPP FLOAT
   ============================== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: transform var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: var(--white);
}

/* ==============================
   ANIMATIONS
   ============================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 40px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Tablet: grid base a 2 columnas (marcas/modelos/años) */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Tablet: ~2 cards visibles en el carrusel de la home */
    .categories-carousel .categories-grid .category-card {
        flex: 0 0 calc((100% - 28px) / 2);
    }
    .categories-carousel {
        padding: 0 44px;
    }

    .features-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stats {
        gap: 32px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    /* Logo ligeramente más pequeño en móvil para no comerse el header */
    .header-logo img {
        height: 44px;
    }
    .header-cart {
        width: 42px;
        height: 42px;
    }
    .header-cart svg {
        width: 20px;
        height: 20px;
    }

    .header-nav {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        /* Panel desplegable oscuro a juego con el header transparente */
        background: rgba(10, 10, 10, 0.96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 24px;
        z-index: 999;
    }

    .header-nav.open {
        display: flex;
    }

    .header-nav a {
        font-size: 20px;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        min-height: auto;
        /* En móvil usamos cover para que la moto llene todo el hero
           detrás del texto (el degradado oscuro mantiene la legibilidad). */
        background-size: cover;
        background-position: 75% center;
    }

    .hero::before {
        /* En móvil el texto ocupa todo el ancho: oscurecemos más globalmente
           pero dejamos traslucir algo de la moto detrás. */
        background: linear-gradient(180deg,
            rgba(10, 10, 10, 0.88) 0%,
            rgba(10, 10, 10, 0.7) 60%,
            rgba(10, 10, 10, 0.55) 100%);
    }

    .hero-content {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .hero-stat {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .section {
        padding: 56px 0;
    }

    .section-title {
        font-size: 28px;
    }

    /* Página contacto: grid apilado + hero más compacto */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .contact-info,
    .contact-form {
        padding: 28px 22px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .form-row .form-field {
        margin-bottom: 20px;
    }
    .page-hero {
        padding-top: 120px;
        padding-bottom: 56px;
    }
    .page-hero-title {
        font-size: 34px;
    }

    /* Móvil: grid base a 2 columnas (marcas/modelos/años) */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    /* Móvil: 1 card visible en el carrusel de la home */
    .categories-carousel .categories-grid .category-card {
        flex: 0 0 calc(100% - 8px);
        min-height: 220px;
    }
    .categories-carousel {
        padding: 0;
    }
    .carousel-arrow {
        width: 40px;
        height: 40px;
        top: auto;
        bottom: -56px;
        transform: none;
    }
    .carousel-arrow:hover {
        transform: scale(1.08);
    }
    .carousel-arrow--prev { left: calc(50% - 48px); }
    .carousel-arrow--next { right: calc(50% - 48px); }

    .category-card {
        padding: 20px 16px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .brands-row {
        gap: 24px;
    }

    .features-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .cta-banner h2 {
        font-size: 24px;
    }
    /* Override del CTA de "Empieza a buscar tu recambio" en móvil */
    .section-cta-moto .cta-banner h2 {
        font-size: 28px;
    }
    .section-cta-moto .cta-banner {
        padding: 48px 20px;
    }
    /* En móvil quitamos las rayas decorativas y hacemos los chips más compactos */
    .section-cta-moto::before,
    .section-cta-moto::after {
        display: none;
    }
    .cta-moto-step {
        padding: 8px 14px;
        font-size: 11px;
        letter-spacing: 1.3px;
    }
    .cta-moto-step svg { width: 15px; height: 15px; }
    .cta-moto-steps { gap: 8px; margin-bottom: 20px; }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   TIENDA — carrito, checkout, pago, confirmación
   ============================== */
.shop-section {
    padding-top: calc(var(--header-height) + 48px);
    padding-bottom: 80px;
    min-height: 60vh;
}
.shop-breadcrumb { font-size: 14px; color: var(--gray-500); margin-bottom: 20px; }
.shop-breadcrumb a { color: var(--gray-500); }
.shop-breadcrumb a:hover { color: var(--red); }
.shop-breadcrumb span { margin: 0 8px; }
.shop-breadcrumb .current { color: var(--black); font-weight: 600; margin: 0; }
.shop-title {
    font-family: var(--font-heading);
    font-size: 32px; font-weight: 800; color: var(--black);
    margin-bottom: 24px;
}

/* Mensajes flash */
.shop-flash { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; font-size: 14px; font-weight: 500; }
.shop-flash-success { background: #dcfce7; color: #14532d; }
.shop-flash-error   { background: #fee2e2; color: #7a0a12; }
.shop-flash-warning { background: #fef3c7; color: #78350f; }
.shop-flash-info    { background: #e0f2fe; color: #075985; }

/* Botón a ancho completo */
.btn-block { display: flex; width: 100%; justify-content: center; }

/* Badge del carrito en el header */
.header-cart { position: relative; }
.cart-badge {
    position: absolute; top: -6px; right: -6px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--red); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px;
    text-align: center; border-radius: 9px;
}

/* ----- Carrito ----- */
.cart-empty { text-align: center; padding: 60px 20px; background: var(--gray-50); border-radius: var(--radius-lg); }
.cart-empty p { font-size: 18px; color: var(--gray-500); margin-bottom: 20px; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
    display: grid; grid-template-columns: 88px 1fr auto auto; gap: 16px; align-items: center;
    padding: 14px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
}
.cart-item-img {
    width: 88px; height: 88px; border-radius: var(--radius); overflow: hidden;
    background: var(--gray-50); display: flex; align-items: center; justify-content: center;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-noimg svg { width: 32px; height: 32px; stroke: var(--gray-300); }
.cart-item-meta { font-size: 12px; color: var(--red); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.cart-item-name { font-size: 16px; font-weight: 600; color: var(--black); margin-top: 2px; }
.cart-item-price { font-size: 18px; font-weight: 700; color: var(--black); white-space: nowrap; }
.cart-item-remove button {
    width: 32px; height: 32px; border: none; background: var(--gray-100); color: var(--gray-600);
    border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; transition: var(--transition);
}
.cart-item-remove button:hover { background: var(--red); color: #fff; }

/* Resumen (carrito y checkout) */
.cart-summary, .checkout-summary {
    background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    padding: 24px; position: sticky; top: calc(var(--header-height) + 16px);
}
.cart-summary h2, .checkout-summary h2 { font-family: var(--font-heading); font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--gray-600); padding: 8px 0; }
.summary-total {
    display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; color: var(--black);
    padding: 14px 0; margin: 8px 0 16px; border-top: 2px solid var(--gray-200);
}
.cart-continue { display: block; text-align: center; margin-top: 14px; font-size: 14px; color: var(--gray-600); }
.cart-continue:hover { color: var(--red); }
.summary-items { list-style: none; margin: 0 0 12px; padding: 0; }
.summary-items li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--gray-200); }
.summary-item-price { white-space: nowrap; font-weight: 600; }

/* ----- Checkout ----- */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
.checkout-main { display: flex; flex-direction: column; gap: 20px; }
.checkout-block { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; }
.checkout-block h2 { font-family: var(--font-heading); font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.shop-section .form-group { margin-bottom: 16px; }
.shop-section .form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--gray-700); }
.shop-section .form-control {
    width: 100%; padding: 12px 14px; font-size: 15px; font-family: var(--font-body);
    border: 1px solid var(--gray-300); border-radius: var(--radius); background: #fff; color: var(--black);
    transition: var(--transition);
}
.shop-section .form-control:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-light); }
.shop-section textarea.form-control { resize: vertical; min-height: 80px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-error { color: var(--red); font-size: 13px; margin-top: 4px; display: block; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.entrega-info strong { display: block; margin-bottom: 4px; }
.entrega-info p { font-size: 14px; color: var(--gray-600); }
.pay-option {
    display: flex; align-items: center; gap: 10px; padding: 14px;
    border: 1px solid var(--gray-300); border-radius: var(--radius); margin-bottom: 10px;
    cursor: pointer; transition: var(--transition);
}
.pay-option:hover { border-color: var(--red); }
.pay-option input { accent-color: var(--red); }
.pay-secure { font-size: 13px; color: var(--gray-500); margin-top: 6px; }
/* Aviso para invitados: la transferencia requiere cuenta */
.pay-transfer-login { font-size: 13px; color: var(--gray-600); background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: 8px; padding: 10px 12px; margin: 4px 0 0; }
.pay-transfer-login a { color: var(--red); font-weight: 600; }

/* ----- Método de envío (checkout) ----- */
.ship-option {
    display: flex; align-items: center; gap: 12px; padding: 14px;
    border: 1px solid var(--gray-300); border-radius: var(--radius); margin-bottom: 10px;
    cursor: pointer; transition: var(--transition);
}
.ship-option:hover { border-color: var(--red); }
.ship-option input { accent-color: var(--red); flex-shrink: 0; }
.ship-option > span:not(.ship-cost) { flex: 1; line-height: 1.4; }
.ship-option small { color: var(--gray-500); font-weight: 400; }
.ship-option--static { cursor: default; background: var(--gray-50); }
.ship-cost { font-weight: 700; white-space: nowrap; }
.ship-consulta { font-size: 13px; color: var(--red); margin-top: 8px; line-height: 1.5; }
.ship-consulta a { color: var(--red); font-weight: 600; text-decoration: underline; }
.req-mark { color: var(--red); }

/* ----- Páginas legales (aviso legal, privacidad, cookies, envíos, garantía) ----- */
.legal-content { max-width: 760px; }
.legal-content .legal-updated { font-size: 13px; color: var(--gray-500); margin: -8px 0 28px; }
.legal-content h2 { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin: 32px 0 12px; }
.legal-content h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 700; margin: 22px 0 10px; }
.legal-content p { font-size: 15px; line-height: 1.7; color: var(--gray-700); margin-bottom: 12px; }
.legal-content ul { margin: 0 0 14px 22px; }
.legal-content li { font-size: 15px; line-height: 1.7; color: var(--gray-700); margin-bottom: 8px; }
.legal-content a { color: var(--red); font-weight: 600; }
/* Al navegar a un ancla (p.ej. /condiciones-generales#motores) el header fijo
   taparía el título: reservamos su altura al posicionar el scroll */
.legal-content [id] { scroll-margin-top: calc(var(--header-height) + 24px); }
/* Tabla de cookies (/cookies): min-width + wrapper con scroll horizontal para
   que las 5 columnas no se aplasten en móvil */
.legal-table-wrap { overflow-x: auto; margin: 0 0 14px; }
.legal-content table { width: 100%; min-width: 640px; border-collapse: collapse; }
.legal-content th,
.legal-content td { border: 1px solid var(--gray-300); padding: 8px 10px; text-align: left; vertical-align: top; font-size: 14px; line-height: 1.5; color: var(--gray-700); }
.legal-content th { background: var(--gray-100); font-family: var(--font-heading); font-weight: 700; }

/* ----- Paginación pública de catálogo (partials/paginacion.php) ----- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 36px 0 4px; }
.pager-num,
.pager-arrow { display: inline-block; min-width: 40px; padding: 9px 13px; border: 1px solid var(--gray-300); border-radius: 8px; background: #fff; color: var(--gray-700); font-weight: 600; font-size: 14px; text-align: center; text-decoration: none; }
.pager a:hover { border-color: var(--red); color: var(--red); }
.pager-current { background: var(--red); border-color: var(--red); color: #fff; }
.pager-gap { color: var(--gray-500); padding: 0 2px; }

/* Checkbox de aceptación de condiciones (checkout) */
.legal-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 10px; cursor: pointer; }
.legal-check input { margin-top: 3px; flex-shrink: 0; accent-color: var(--red); }
.legal-check span { font-size: 13px; line-height: 1.5; color: var(--gray-600); }
.legal-check a { color: var(--red); font-weight: 600; text-decoration: underline; }

/* ----- Aviso de cookies ----- */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
    max-width: 560px;
    margin: 0 auto;
    background: var(--dark-bg, #0a0a0a);
    color: #eee;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.cookie-banner p { font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.cookie-banner a { color: #fff; font-weight: 600; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
/* background transparente explícito: sin él, el fondo gris por defecto del
   navegador (ButtonFace) dejaba el texto claro ilegible sobre claro */
.cookie-banner .btn-outline { background: transparent; border-color: rgba(255, 255, 255, 0.4); color: #eee; }
/* main.js alterna los botones del banner con el atributo hidden;
   .btn{display:inline-flex} lo anularía sin esta regla */
.cookie-banner [hidden] { display: none !important; }
/* Panel "Gestionar cookies": preferencias por categoría dentro del banner */
.cookie-prefs { border-top: 1px solid rgba(255, 255, 255, 0.2); padding: 12px 0; margin-bottom: 12px; }
.cookie-pref { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; margin: 0 0 10px; cursor: pointer; }
.cookie-pref:last-child { margin-bottom: 0; }
.cookie-pref input { margin-top: 3px; flex-shrink: 0; accent-color: var(--red); }
.cookie-pref input:disabled { opacity: 0.6; cursor: not-allowed; }

/* ----- Aviso "añadido al carrito" (toast) ----- */
.cart-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1300;
    width: 330px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 16px;
    transform: translateY(14px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.cart-toast.visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cart-toast-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.cart-toast-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.cart-toast-icon.error { background: var(--red); }
.cart-toast-title { display: block; font-size: 14px; }
.cart-toast-text {
    margin-top: 2px;
    font-size: 13px;
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cart-toast-actions { display: flex; gap: 8px; }
.cart-toast-actions .btn { flex: 1; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
    .cart-toast { transition: none; }
}

/* ----- Redirección al pago ----- */
.pago-redirect { text-align: center; padding: 40px 20px; }
.pago-spinner {
    width: 48px; height: 48px; margin: 0 auto 24px;
    border: 4px solid var(--gray-200); border-top-color: var(--red); border-radius: 50%;
    animation: pago-spin 0.8s linear infinite;
}
@keyframes pago-spin { to { transform: rotate(360deg); } }

/* ----- Confirmación / KO ----- */
.pedido-confirmado { max-width: 560px; margin: 0 auto; text-align: center; }
.confirmado-icon { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.confirmado-icon svg { width: 36px; height: 36px; stroke: #fff; }
.confirmado-icon.ok { background: #16a34a; }
.confirmado-icon.pending { background: #d97706; }
.confirmado-icon.ko { background: var(--red); }
.confirmado-sub { color: var(--gray-600); font-size: 16px; margin-bottom: 28px; }
.confirmado-card { text-align: left; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 28px; }
.confirmado-numero { font-size: 15px; margin-bottom: 14px; }
.confirmado-email { font-size: 14px; color: var(--gray-600); margin-top: 12px; }
.ko-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Datos bancarios para el pago por transferencia (página + resumen) */
.transfer-datos { background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px; padding: 6px 16px; margin: 8px 0 12px; }
.transfer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.transfer-row:last-child { border-bottom: none; }
.transfer-label { font-size: 13px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }
.transfer-value { font-size: 15px; font-weight: 600; text-align: right; word-break: break-word; }
.transfer-iban { letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.transfer-importe, .transfer-concepto { color: var(--red); font-weight: 800; }
.transfer-aviso { font-size: 13px; color: var(--gray-600); background: rgba(202, 15, 28, 0.06); border-radius: 6px; padding: 10px 12px; margin: 0 0 16px; }
/* Botones bajo la tarjeta de transferencia (pasarela): acción principal + navegación */
.transfer-acciones { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }

/* Pieza vendida (ficha de producto) */
.producto-vendido {
    flex: 1 1 220px; display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 28px; background: var(--gray-200); color: var(--gray-600); font-weight: 700; border-radius: var(--radius);
}

/* Responsive tienda */
@media (max-width: 880px) {
    .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .cart-summary, .checkout-summary { position: static; }
    .form-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .cart-item { grid-template-columns: 64px 1fr auto; }
    .cart-item-img { width: 64px; height: 64px; }
    .cart-item-price { grid-column: 2; }
    .cart-item-remove { grid-row: 1; grid-column: 3; }
}

/* ----- Cuenta / acceso ----- */
.header-account { display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.85); transition: color var(--transition); }
.header-account:hover { color: #fff; }
.header-account svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
.checkout-login-prompt { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px; font-size: 14px; color: var(--gray-700); }
.checkout-login-prompt a { color: var(--red); font-weight: 600; }
.checkout-block-note { font-size: 13px; color: var(--gray-500); margin: -8px 0 14px; }
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; max-width: 900px; }
.auth-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 28px; }
.auth-single { max-width: 460px; }
.auth-card h2 { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.cuenta-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.cuenta-subtitle { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin: 24px 0 16px; }
.pedidos-list { display: flex; flex-direction: column; gap: 10px; }
.pedido-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px 18px; }
.pedido-row-num { display: flex; flex-direction: column; }
.pedido-row-fecha { font-size: 12px; color: var(--gray-500); }
.pedido-row-total { font-weight: 700; white-space: nowrap; }
.pedido-estado { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.pedido-estado-pagado { background: #dcfce7; color: #14532d; }
.pedido-estado-preparando { background: #fef3c7; color: #78350f; }
.pedido-estado-enviado, .pedido-estado-entregado { background: #e0f2fe; color: #075985; }
.pedido-estado-cancelado { background: #fee2e2; color: #7a0a12; }
@media (max-width: 720px) {
    .auth-layout { grid-template-columns: 1fr; }
}

/* ----- Área de cuenta (dashboard) ----- */
.cuenta-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.cuenta-nav { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 10px; position: sticky; top: calc(var(--header-height) + 16px); }
.cuenta-nav a { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 600; color: var(--gray-700); transition: var(--transition); }
.cuenta-nav a:hover { background: var(--gray-50); color: var(--black); }
.cuenta-nav a.active { background: var(--red); color: #fff; }
.cuenta-nav-logout { margin-top: 6px; border-top: 1px solid var(--gray-200); color: var(--gray-500) !important; }
.cuenta-content { min-width: 0; }
.cuenta-hello { font-size: 16px; margin-bottom: 20px; line-height: 1.5; }
.cuenta-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.cuenta-card { display: flex; flex-direction: column; gap: 4px; padding: 20px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); transition: var(--transition); }
.cuenta-card:hover { border-color: var(--red); box-shadow: var(--shadow); }
.cuenta-card-num { font-family: var(--font-heading); font-size: 28px; font-weight: 800; color: var(--black); line-height: 1; }
.cuenta-card > span:not(.cuenta-card-num):not(.cuenta-card-sub) { font-size: 14px; color: var(--gray-600); font-weight: 600; }
.cuenta-card-sub { font-size: 12px; color: var(--gray-500); }
.cuenta-subtitle { font-family: var(--font-heading); font-size: 18px; font-weight: 700; margin: 8px 0 14px; }
.cuenta-form-sub { font-family: var(--font-heading); font-size: 15px; font-weight: 700; margin: 18px 0 12px; padding-top: 12px; border-top: 1px solid var(--gray-200); }
.pedido-row-link { text-decoration: none; transition: var(--transition); }
.pedido-row-link:hover { border-color: var(--red); }
.pedido-detalle-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ----- Favoritos (Me gusta) ----- */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.fav-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }
.fav-card-img { display: flex; align-items: center; justify-content: center; height: 150px; background: var(--gray-50); overflow: hidden; }
.fav-card-img img { width: 100%; height: 100%; object-fit: cover; }
.fav-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.fav-card-name { font-size: 15px; font-weight: 600; color: var(--black); }
.fav-card-price { font-size: 17px; font-weight: 800; color: var(--black); }
.fav-card-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 8px; }
.fav-nodisp { flex: 1; font-size: 13px; font-weight: 600; color: var(--gray-500); background: var(--gray-100); padding: 8px; text-align: center; border-radius: var(--radius); }
.fav-remove { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--gray-300); background: #fff; color: var(--gray-500); border-radius: var(--radius); font-size: 18px; line-height: 1; cursor: pointer; transition: var(--transition); }
.fav-remove:hover { border-color: var(--red); color: var(--red); }

/* ----- Botón "Me gusta" (ficha de producto) ----- */
.btn-like { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 100%; min-height: 52px; border: 1px solid var(--gray-300); background: #fff; border-radius: var(--radius); cursor: pointer; transition: var(--transition); }
.btn-like svg { width: 24px; height: 24px; stroke: var(--gray-500); fill: none; transition: var(--transition); }
.btn-like:hover { border-color: var(--red); }
.btn-like:hover svg { stroke: var(--red); }
.btn-like.is-fav { border-color: var(--red); background: var(--red-light); }
.btn-like.is-fav svg { stroke: var(--red); fill: var(--red); }

@media (max-width: 760px) {
    .cuenta-layout { grid-template-columns: 1fr; }
    .cuenta-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .cuenta-nav a { flex: 0 0 auto; }
    .cuenta-nav-logout { border-top: none; margin-top: 0; }
}
