/* style2.css — Rediseño completo + mejoras (centrado buscador, tabs, paginación, badges stock, micro-carrito)
   v20250811e */

/* =========================
   RESET + VARIABLES
   ========================= */
:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --ink:#1f2a37;
  --muted:#6b7280;

  --primary:#008701;
  --primary-2:#316b51;
  --primary-3:#008701;

  --shadow-1:0 10px 30px rgba(2,12,27,.08);
  --shadow-2:0 20px 60px rgba(2,12,27,.10);
  --radius:20px;

  --glow:0 0 12px rgba(0,229,255,.35), 0 0 24px rgba(124,255,196,.25);

  --font:"Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --font-alt:"Plus Jakarta Sans", var(--font);

  --container:1200px;

  --pg:#e5e7eb;          /* paginación */
  --pg-active:#0ee971;
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:var(--font);
  color:var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0,229,255,.06), transparent 60%),
    radial-gradient(800px 500px at -10% 20%, rgba(124,255,196,.06), transparent 60%),
    var(--bg);
}

/* =========================
   UTILS
   ========================= */
.container{max-width:var(--container); margin-inline:auto; padding-inline:20px}
.muted{color:var(--muted)}
.neon{color:var(--primary-3); text-shadow:var(--glow)}

.btn-primary,.btn-cta,.btn-ghost,.icon-pill{
  display:inline-flex; align-items:center; gap:.5rem;
  border:0; border-radius:14px; padding:.8rem 1rem;
  font-weight:600; cursor:pointer; text-decoration:none;
}
.icon-pill{padding:.55rem .7rem; border-radius:12px; background:#f5ffec; box-shadow:var(--shadow-1)}
.icon-pill i{font-size:20px}

.btn-primary{
  background:linear-gradient(135deg, var(--primary), #0e7b07);
  color:#fff; box-shadow:var(--shadow-1);
}
.btn-cta{
  background:linear-gradient(135deg, var(--primary-3), var(--primary-2));
  color:#ffffff; box-shadow:var(--glow), var(--shadow-1);
}
.btn-ghost{
  background:#f5ffec; color:#0f6f16; box-shadow:var(--shadow-1);
}
.btn-primary:hover,.btn-cta:hover{transform:translateY(-1px); filter:saturate(1.05)}
.btn-ghost:hover,.icon-pill:hover{transform:translateY(-1px)}

.badge-pill{
  min-width:20px; height:20px; border-radius:999px; background:#0ee971; color:#fff; font-size:.75rem;
  display:inline-flex; align-items:center; justify-content:center; padding:0 6px; margin-left:.25rem;
}

/* =========================
   PRELOADER
   ========================= */
#preloader{position:fixed; inset:0; display:grid; place-items:center; background:var(--bg); z-index:9999}
.spinner{display:flex; gap:10px}
.spinner span{
  width:12px; height:12px; border-radius:12px; background:var(--primary);
  box-shadow:var(--glow);
  animation:bounce .9s infinite ease-in-out;
}
.spinner span:nth-child(2){animation-delay:.15s}
spinner span:nth-child(3){animation-delay:.3s}
@keyframes bounce{0%,80%,100%{transform:scale(0)}40%{transform:scale(1)}}

/* =========================
   HEADER
   ========================= */
.site-header{
  position:sticky; top:0; inset-inline:0; z-index:100;
  backdrop-filter:saturate(1.2) blur(8px);
  background: color-mix(in srgb, #ffffff 72%, transparent);
  border-bottom:1px solid rgba(0,0,0,.06);
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 20px;
}
.logo img{height:52px; display:block}
.navbar{display:flex; gap:14px; align-items:center}
.navbar a{
  text-decoration:none; color:var(--ink); font-weight:600; padding:.5rem .75rem; border-radius:10px; position:relative;
}
.navbar a::after{
  content:""; position:absolute; left:12px; right:12px; bottom:6px; height:2px;
  background:linear-gradient(90deg, var(--primary-3), var(--primary-2)); border-radius:2px; transform:scaleX(0);
  transition:transform .25s ease;
}
.navbar a:hover::after{transform:scaleX(1)}
.desktop-only{display:none}
.menu-icon{background:transparent; border:0; font-size:28px; display:inline-flex}
@media (min-width:980px){ .desktop-only{display:inline-flex} .menu-icon{display:none} }

/* =========================
   HERO
   ========================= */
.hero{padding:clamp(40px, 6vw, 70px) 0}

/* Versión centrada para home */
.hero-centered .hero-inner{display:grid; grid-template-columns:1fr; align-items:center}
.hero-centered .hero-copy{max-width:820px; margin-inline:auto; text-align:center}

/* Versión 2 columnas (por si se reusa) */
.hero-inner{display:grid; grid-template-columns:1.05fr .95fr; gap:clamp(24px, 4vw, 48px); align-items:center}

.hero h1{font-family:var(--font-alt); font-size:clamp(34px, 4.8vw, 54px); line-height:1.08; margin:0 0 8px}
.hero p{color:var(--muted); margin:0}

/* =========================
   TABS COCHES/PIEZAS + BUSCADOR CENTRADO
   ========================= */
.tabs{display:flex; gap:10px; margin:14px auto 10px; justify-content:center; flex-wrap:wrap}
.tab-btn{
  background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:.65rem 1rem; font-weight:700; cursor:pointer;
  box-shadow:var(--shadow-1); display:inline-flex; align-items:center; gap:.5rem;
}
.tab-btn.active{background:linear-gradient(135deg, var(--primary-3), var(--primary-2)); color:#ffffff; box-shadow:var(--glow), var(--shadow-1)}

.search-wrap{max-width:900px; margin:0 auto}
.filters-sticky{position:sticky; top:72px; z-index:50; padding-top:8px}
.search-bar{display:flex; gap:10px; align-items:center; margin-top:16px; flex-wrap:wrap; justify-content:center}
.search-bar input{
  flex:1 1 560px; min-width:260px; padding:16px 16px; border-radius:14px; border:1px solid #e5e7eb;
  background:#fff; outline:none; box-shadow:var(--shadow-1);
}
.btn-filter{
  background:#fff; border:1px solid #e5e7eb; padding:.8rem 1rem; border-radius:14px; box-shadow:var(--shadow-1);
  display:inline-flex; align-items:center; gap:.5rem;
}

/* =========================
   FILTROS
   ========================= */
.filters{margin-top:12px; background:#ffffffcc; border:1px solid #e5e7eb; border-radius:16px; box-shadow:var(--shadow-1); overflow:hidden}
.filters-grid{display:grid; gap:14px; padding:16px; grid-template-columns:repeat(6, 1fr)}
.filters.collapsed{display:none}
.filters label{display:flex; flex-direction:column; gap:6px; font-weight:600; color:#374151}
.filters input,.filters select{padding:12px 12px; border-radius:12px; border:1px solid #e5e7eb; background:#fff}
.filters label span{font-size:.9rem}
.filters-actions{grid-column:span 2; display:flex; gap:10px; align-items:end; justify-content:flex-end}
@media (max-width:1100px){ .filters-grid{grid-template-columns:repeat(2,1fr)} .filters-actions{grid-column:span 2} }

/* =========================
   CATÁLOGO + CARDS
   ========================= */
.catalog{padding:30px 0}
.catalog-header{max-width:var(--container); margin-inline:auto; padding-inline:20px; margin-bottom:12px}

.grid-cards{
  --min:260px;
  display:grid; gap:16px;
  grid-template-columns:repeat(auto-fill, minmax(var(--min), 1fr));
  max-width:var(--container); margin-inline:auto; padding-inline:20px;
}
.grid-cards.compact{--min:220px}

.card{
  background:var(--card); border:1px solid #e5e7eb; border-radius:var(--radius);
  box-shadow:var(--shadow-1); overflow:hidden; display:flex; flex-direction:column;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; position:relative;
}
.card:hover{transform:translateY(-3px); box-shadow:var(--shadow-2); border-color:color-mix(in srgb, var(--primary) 20%, #e5e7eb)}
.card .badge{
  position:absolute; top:12px; left:12px; background:linear-gradient(135deg, var(--primary-2), var(--primary-3));
  color:#06353f; font-weight:800; font-size:.78rem; padding:.35rem .6rem; border-radius:999px; box-shadow:var(--glow);
}
.card .fav-btn{
  position:absolute; top:12px; right:12px; background:#fff; border:1px solid #e5e7eb; border-radius:999px;
  width:38px; height:38px; display:grid; place-items:center; box-shadow:var(--shadow-1);
}
.card .fav-btn.active i{color:#e11d48}

.card-media{aspect-ratio:16/10; background:#eef2ff; position:relative; overflow:hidden}
.card-media img{width:100%; height:100%; object-fit:cover; display:block; transition:transform .5s ease}
.card:hover .card-media img{transform:scale(1.04)}

.card-body{padding:14px}
.card h3{font-size:1.05rem; margin:0 0 6px; letter-spacing:.2px}
.card .meta{display:flex; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:.92rem}
.card .cta{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}
.card .cta .ghost{flex:1}
.card .cta .whatsapp{flex:1}

/* Badges (stock/condición) */
.badges-line{display:flex; gap:6px; flex-wrap:wrap}
.badge-soft{
  display:inline-flex; align-items:center; gap:6px;
  padding:.25rem .55rem; border-radius:999px; font-weight:700; font-size:.78rem; border:1px solid #e5e7eb;
}
.badge-green{background:#eafff5; color:#056c46}
.badge-blue{background:#e8f3ff; color:#0b4d7a}
.badge-gray{background:#f3f4f6; color:#374151}

/* Skeleton */
.is-skeleton .card-media{background:linear-gradient(90deg,#eef2ff,#f8fafc,#eef2ff); background-size:200% 100%; animation:shimmer 1.2s infinite}
.sk-line{height:12px; border-radius:6px; background:linear-gradient(90deg,#eef2ff,#f8fafc,#eef2ff); background-size:200% 100%; animation:shimmer 1.2s infinite; margin:10px 0}
.sk-short{width:70%} .sk-xs{width:40%}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* =========================
   PAGINACIÓN
   ========================= */
.pagination{display:flex; gap:6px; justify-content:center; align-items:center; margin:16px 0; flex-wrap:wrap}
.pg-btn{
  min-width:40px; height:40px; border-radius:10px; border:1px solid var(--pg); background:#fff; box-shadow:var(--shadow-1); cursor:pointer;
}
.pg-btn.active{background:var(--pg-active); color:#fff; border-color:var(--pg-active)}
.pg-btn:disabled{opacity:.5; cursor:not-allowed}

/* =========================
   MARCAS (rejilla centrada)
   ========================= */
.brands{padding:30px 0}
.brands h2{max-width:var(--container); margin:0 auto 10px; padding-inline:20px}
.brands-grid{
  max-width:var(--container); margin:0 auto; padding:18px 24px;
  display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));
  gap:28px; align-items:center; justify-items:center;
  background:#fff; border:1px solid #e5e7eb; border-radius:16px; box-shadow:var(--shadow-1);
}
.brands-grid img{height:60px; filter:grayscale(.15); opacity:.9; transition:filter .2s, opacity .2s, transform .2s}
.brands-grid img:hover{filter:none; opacity:1; transform:translateY(-2px)}

/* =========================
   ABOUT (texto oficial + métricas)
   ========================= */
.about{padding:40px 0}
.about-inner{display:grid; gap:24px; grid-template-columns:1.1fr .9fr; align-items:center; max-width:var(--container); margin:0 auto; padding-inline:20px}
.about-media img{width:100%; border-radius:20px; box-shadow: var(--shadow-2)}
.about-copy h2{font-size:clamp(22px, 3.2vw, 32px); margin:0 0 6px}
.about-copy p{color:var(--muted)}
.about-rich .stats{display:flex; gap:12px; flex-wrap:wrap; margin:14px 0}
.about-rich .stat{flex:1 1 160px; background:#fff; border:1px solid #e5e7eb; border-radius:14px; padding:12px; box-shadow:var(--shadow-1); text-align:center}
.about-rich .stat .num{font-weight:800; font-size:1.3rem}
.about-rich .stat .label{color:var(--muted); font-size:.9rem}
.about-list{list-style:none; padding:0; margin:12px 0 18px; display:grid; gap:8px}
.about-list.big > div{display:flex; align-items:center; gap:10px; font-weight:600}
.cta-row{display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:6px}
@media (max-width:980px){ .about-inner{grid-template-columns:1fr} }

/* =========================
   CONTACTO (tarjetas)
   ========================= */
.contact{padding:40px 0; text-align:center}
.contact h2{margin:0 0 6px}
.contact-cards{display:grid; grid-template-columns:repeat(auto-fit, minmax(240px,1fr)); gap:16px; margin-top:12px}
.c-card{
  background:#fff; border:1px solid #e5e7eb; border-radius:16px; box-shadow:var(--shadow-1);
  padding:16px; text-align:left;
}
.c-card i{font-size:24px; color:#0ee971}
.c-card h3{margin:6px 0}
.c-card p{color:var(--muted)}
.contact-actions{display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin-top:18px}

/* =========================
   MODALES
   ========================= */
.modal{border:0; padding:0; border-radius:20px; box-shadow:var(--shadow-2); width:min(100% - 24px, 1080px)}
.modal.small{width:min(100% - 24px, 980px)}
.modal::backdrop{background:rgba(0,0,0,.35)}
.modal-content{display:grid; grid-template-columns:1.15fr .85fr; gap:16px; padding:16px; background:var(--card); position:relative}
.modal-close{position:absolute; right:10px; top:10px; border:0; background:#fff; width:38px; height:38px; display:grid; place-items:center; border-radius:10px; box-shadow:var(--shadow-1)}
.modal-gallery{position:relative}
.modal-gallery img{width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:16px}
.nav-btn{position:absolute; top:50%; transform:translateY(-50%); border:0; width:42px; height:42px; border-radius:50%; display:grid; place-items:center; background:#ffffffd9; box-shadow:var(--shadow-1)}
#prev-image{left:10px} #next-image{right:10px}
.thumbs{display:flex; gap:8px; margin-top:10px; overflow:auto; padding-bottom:6px}
.thumbs img{height:56px; border-radius:10px; border:2px solid transparent; cursor:pointer}
.thumbs img.active{border-color:var(--primary)}
.modal-info h3{margin:0 0 6px}
.specs{display:grid; grid-template-columns:repeat(2, 1fr); gap:8px; margin:8px 0}
.specs dt{font-weight:700; color:#374151}
.specs dd{margin:0; color:var(--muted)}
.modal-cta{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}
@media (max-width:980px){ .modal-content{grid-template-columns:1fr} }

/* =========================
   DRAWERS (Comparador y Micro-carrito)
   ========================= */
.drawer{
  position:fixed; right:0; top:0; height:100dvh; width:min(100%, 540px);
  background:#fff; border-left:1px solid #e5e7eb; box-shadow:var(--shadow-2);
  transform:translateX(100%); transition:transform .3s ease; z-index:150;
  display:flex; flex-direction:column;
}
.drawer.open{transform:translateX(0)}
.drawer-header{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #e5e7eb}
.drawer-list{display:flex; gap:10px; padding:12px 16px; overflow:auto; flex-wrap:wrap}
.drawer-list .mini{
  background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:8px; display:flex; align-items:center; gap:8px; min-width:220px; box-shadow:var(--shadow-1);
}
.drawer-list .mini img{width:64px; height:48px; object-fit:cover; border-radius:8px}
.drawer-table{padding:0 16px 12px; overflow:auto}
.drawer-table table{width:100%; border-collapse:collapse; background:#fff; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; box-shadow:var(--shadow-1)}
.drawer-table th,.drawer-table td{padding:10px 12px; border-bottom:1px solid #eef2ff; text-align:left; font-size:.95rem}
.drawer-table tr:last-child td{border-bottom:0}
.drawer-actions{margin-top:auto; padding:12px 16px; display:flex; gap:10px; border-top:1px solid #e5e7eb; justify-content:flex-end}

/* =========================
   FAB WHATSAPP + FOOTER
   ========================= */
.fab-wa{
  position:fixed; right:16px; bottom:16px; width:56px; height:56px; border-radius:50%;
  display:grid; place-items:center; background:linear-gradient(135deg, #25d366, #316b51); color:#06353f;
  box-shadow:var(--glow), var(--shadow-2); z-index:120; text-decoration:none; font-size:28px;
}
.fab-wa:hover{transform:translateY(-2px)}

.site-footer{padding:18px 0; border-top:1px solid #e5e7eb; background:#fff}
.footer-inner{max-width:var(--container); margin:0 auto; padding-inline:20px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}
.social a{color:#3b3b3b; font-size:20px; padding:6px}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width:640px){
  .grid-cards{--min:210px}
  .search-bar input{min-width:200px}
}
@media (min-width:1440px){
  .grid-cards{--min:300px}
}

/* =========================
   HERO (fondo panorámico solo PC)
   ========================= */
@media (min-width: 981px){
  .hero.hero-centered{
    /* Capa clara encima para que el texto oscuro siga siendo legible */
    background-image:
      linear-gradient(to bottom, rgba(255,255,255,.88), rgba(255,255,255,.90)),
      url("https://static.uwalls.es/products/11000/11581/u34725piw3mr_1200.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid #e5e7eb;
  }
}

/* =========================
   ABOUT — Showroom (solo PC)
   ========================= */
@media (min-width: 981px){
  .about-showroom{
    width:100%;
    display:grid;
    gap:10px;
    /* encaja con tu columna derecha */
  }
  .about-showroom .as-hero{
    position:relative;
    border-radius: var(--radius);
    border:1px solid #e5e7eb;
    box-shadow: var(--shadow-2);
    overflow:hidden;
    background:#fff;
    aspect-ratio: 16 / 10;
    isolation:isolate;
  }
  .about-showroom .as-hero::before{
    /* sutil borde/halo para integrarlo con el look neon/glow */
    content:"";
    position:absolute; inset:0;
    box-shadow: var(--glow) inset;
    pointer-events:none;
    border-radius: inherit;
  }
  .about-showroom .as-main{
    width:100%; height:100%; object-fit:cover; display:block;
    transform: scale(1.02);
    transition: opacity .35s ease, transform .8s ease;
  }
  .about-showroom .as-hero.ken .as-main{
    /* efecto Ken Burns suave */
    animation: kenburns 7s ease-in-out infinite alternate;
  }
  @keyframes kenburns{
    0%{ transform: scale(1.02) translate3d(0,0,0); }
    100%{ transform: scale(1.07) translate3d(2%, -2%, 0); }
  }

  .about-showroom .as-caption{
    position:absolute; left:12px; bottom:12px;
    background:#ffffffd9; backdrop-filter: blur(6px);
    border:1px solid #e5e7eb;
    padding:.4rem .6rem; border-radius:10px;
    font-weight:700; color:#06353f; box-shadow: var(--shadow-1);
  }

  .about-showroom .as-nav{
    position:absolute; top:50%; transform:translateY(-50%);
    width:42px; height:42px; border-radius:999px; border:0;
    display:grid; place-items:center; cursor:pointer; z-index:2;
    background:#ffffffd9; box-shadow:var(--shadow-1);
  }
  .about-showroom .as-nav.prev{ left:10px; }
  .about-showroom .as-nav.next{ right:10px; }
  .about-showroom .as-nav:hover{ transform:translateY(-50%) translateY(-1px); }

  .about-showroom .as-thumbs{
    display:grid; grid-template-columns:repeat(5, 1fr); gap:10px;
  }
  .about-showroom .as-thumbs button{
    position:relative; border:1px solid #e5e7eb; border-radius:14px; padding:0;
    aspect-ratio: 16 / 10; cursor:pointer; overflow:hidden; background:#fff;
    box-shadow: var(--shadow-1);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  }
  .about-showroom .as-thumbs button:hover{
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
  }
  .about-showroom .as-thumbs button[aria-selected="true"]{
    border-color: color-mix(in srgb, var(--primary) 26%, #e5e7eb);
    box-shadow: var(--glow), var(--shadow-1);
  }
  .about-showroom .as-thumbs img{
    width:100%; height:100%; object-fit:cover; display:block;
    transform: scale(1.01); transition: transform .35s ease;
  }
  .about-showroom .as-thumbs button:hover img{ transform: scale(1.05); }
}
