/* ==============================
   1) Variables (colores, medidas)
============================== */
:root{
  --card:#fff;
  --ink:#0b1320;
  --muted:#6b7280;
  --border:#eef1f5;

  /* Chips */
  --chip-bg:#50C878;
  --chip-text:#fff;

  /* Ribbon */
  --ribbon-bg:#fff;
  --ribbon-text:#111;

  /* Animaciones cards */
  --card-dur:.35s;
  --card-ease:ease;

  /* Header */
  --hdr-pad:14px;
  --loc-height:28px;
  --loc-gap:10px;

  /* Buscador pill (↑ más grande que la versión compacta) */
  --pill-h:36px; /* antes ~30px */
  --pill-radius:23px;
  --pill-shadow:0 14px 30px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.10);
  --pill-nudge:0px;

  /* Carrusel dots — ahora más pequeños */
  --dot-size:4px;   /* antes 6px */
  --dot-gap:4px;    /* antes 6px */

  /* Desktop container */
  --desktop-max: 1180px;
  --desktop-pad: 20px;   /* padding lateral dentro del contenedor */
}

/* ==============================
   2) Base
============================== */
body{
  background:#f6f7f9;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

/* ==============================
   3) Header (ubicación + sombra)
============================== */
.lp-home-header{
  position:sticky; top:0; z-index:50;
  background:#fff;
  padding:8px 10px 6px;             /* móvil compacto */
  box-shadow:0 1px 6px rgba(0,0,0,.05);
  margin: -8px -8px 0px -8px;
}
.lp-home-location{
  display:flex; align-items:center; gap:8px;
  margin-bottom:4px; color:#222;
  font-size:14px; font-weight:600;  /* más compacto */
  min-height:20px;
}
.lp-ico{ width:14px; height:14px }
.lp-location-btn{
  background:transparent; border:0; padding:0;
  font:inherit; color:inherit; cursor:pointer;
}

/* ==============================
   4) Buscador (sobre el banner)
============================== */
.search-overlay{
  position:relative;
  width:min(96%, 680px);
  height:var(--pill-h);
  margin:6px auto 8px;
  background:#e9e9e9;
  border-radius:12px;
}
.search-overlay input{
  position:absolute; inset:0;
  width:100%; height:var(--pill-h);
  border:0; outline:0; background:transparent;
  border-radius:inherit;
  padding:0 44px;                    /* un poco más angosto que antes */
  font-size:14.5px;                  /* ↑ respecto a la versión compacta */
  color:#0b1320;
  line-height:var(--pill-h);
  -webkit-appearance:none; appearance:none;
  transform:translateY(var(--pill-nudge));
}
.search-overlay input::placeholder{ line-height:var(--pill-h); }

/* Fallback iOS/Safari */
@supports (-webkit-touch-callout: none){
  .search-overlay input{
    line-height:normal;
    padding-top:calc((var(--pill-h) - 1em)/2 + var(--pill-nudge));
    padding-bottom:calc((var(--pill-h) - 1em)/2 - var(--pill-nudge));
    transform:none;
  }
}
.pill-ico{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; color:#7a7f87; opacity:.95; pointer-events:none;
}
.pill-clear{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  width:24px; height:24px; border-radius:50%;
  border:0; background:#50c878; color:#ffffff;
  font-size:16px; line-height:1; cursor:pointer;
}
.pill-clear[hidden]{ display:none !important; }
.pill-ticker{
  pointer-events:none;
  position:absolute; left:40px; right:38px; top:0;
  height:var(--pill-h);
  display:block; overflow:hidden;
  color:#777777; font-size:14.5px; line-height:var(--pill-h);
}
.pill-track{
  position:absolute; top:0; left:0; right:0;
  display:block;
  transform:translate3d(0,0,0);
  transition:transform .45s ease;
  will-change:transform;
}
.pill-item{
  height:var(--pill-h);
  display:flex; align-items:center; justify-content:center;
  line-height:var(--pill-h);
}
.search-overlay.has-value .pill-ticker,
.search-overlay.is-focus .pill-ticker{ opacity:0; transition:opacity .15s; }

/* ==============================
   5) HERO (banner) — móvil compacto
============================== */
.pub-hero{ position:relative; }
.pub-carousel{
  position:relative;
  width:100%;
  max-width:1100px;
  margin:0 auto;
  overflow:hidden;
  border-radius:12px;
  box-shadow:0 5px 14px rgba(0,0,0,.08);
  background:#f6f7f9;
  aspect-ratio:16/10;
  max-height:130px;
}
.pub-carousel a, .pub-carousel img{ display:block; width:100%; height:100%; }
.pub-carousel img{ object-fit:cover; transition:opacity .6s ease-in-out; }
.pub-dots{
  position:absolute; bottom:4px;     /* más pegados y discretos */
  left:50%; transform:translateX(-50%);
  display:flex; gap:var(--dot-gap); z-index:6;
}
.pub-dots button{
  width:var(--dot-size); height:var(--dot-size);
  border:none; border-radius:9999px;
  background:rgba(255,255,255,.95);
  box-shadow:0 1px 3px rgba(0,0,0,.22);
  opacity:.9; cursor:pointer;
  transition:opacity .18s, box-shadow .18s; /* sin transform */
}
.pub-dots button.active,
.pub-dots button.is-active{
  opacity:1;                         /* sin “agrandar” */
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.26);
}
@media (max-width:768px){
  .pub-carousel{ aspect-ratio:16/11; max-height:120px; }
  .search-overlay{ width:min(100%, 640px); }
}

/* ==============================
   6) Buscador base (fallback)
============================== */
.lp-home-search{ position:relative; margin-bottom:12px }
.lp-search-ico{
  position:absolute; left:14px; top:50%; transform:translateY(-50%); opacity:.6;
}
.lp-search-input{
  width:100%; height:44px; padding:0 42px 0 44px;
  border:1px solid #e6e6e6; border-radius:12px;
  font-size:15px; outline:none; background:#fafafa;
}
.lp-search-input:focus{ background:#fff; border-color:#d8d8d8 }
.lp-clear{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  width:28px; height:28px; border-radius:50%; border:0;
  background:#eee; font-size:18px; line-height:1; cursor:pointer;
}
#lp-search::-webkit-search-cancel-button{ -webkit-appearance:none; }
#lp-search::-webkit-search-results-button{ -webkit-appearance:none; }
#lp-search::-webkit-search-results-decoration{ -webkit-appearance:none; }
#lp-search::-ms-clear{ display:none; width:0; height:0; }

/* ==============================
   7) Carril de categorías (móvil)
============================== */
.catrail{
  display:flex; gap:8px; align-items:center;
  overflow-x:auto; padding:10px 2px; -webkit-overflow-scrolling:touch;
}
.catrail::-webkit-scrollbar{ height:6px; }
.catrail::-webkit-scrollbar-thumb{ background:#d7dbe6; border-radius:8px; }
.catcard{
  flex:0 0 auto;
  width:78px;                         /* ↓ más angosto */
  height:auto !important;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  border:1px solid #eef1f5; background:#fff;
  border-radius:16px; padding:6px 6px; text-align:center; cursor:pointer;
  box-shadow:0 3px 10px rgba(15,23,42,.06);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.catcard:focus-visible{ outline:3px solid rgba(59,130,246,.45); outline-offset:2px; }
.catcard-img{
  width:42px; height:42px;            /* ↓ más pequeño */
  flex:0 0 42px;
  border-radius:12px; margin:0 auto 6px; background:#fafafa; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.catcard-img img{ width:100%; height:100%; object-fit:contain; }
.catcard-name{
  font-weight:700; font-size:12px; line-height:1.15; color:#0b1320;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.catcard:hover{ transform:translateY(-2px); box-shadow:0 8px 18px rgba(15,23,42,.10); }
.catcard.is-active{ background:#50c878; color:#fff; }
.catcard.is-active .catcard-name{ color:#fff; }
@media (max-width:480px){
  .catcard{ width:74px; padding:5px 5px; }
  .catcard-img{ width:38px; height:38px; border-radius:11px; }
  .catcard-name{ font-size:11.5px; }
}

/* ==============================
   8) Grid de listado / Cards
============================== */
.index-wrap{ max-width:980px; margin:10px auto; padding:0 5px; }
.list{ display:grid; gap:10px; position:relative; z-index:0; }
.store-card{
  display:grid; grid-template-columns:110px 1fr; gap:14px; /* columna izquierda fija */
  padding:14px; background:var(--card);
  border:1px solid var(--border); border-radius:20px;
  box-shadow:0 5px 16px rgba(10,15,25,.06);
  transition:opacity var(--card-dur) var(--card-ease),
             transform .16s ease, box-shadow .16s ease;
  text-decoration:none; color:inherit; position:relative; z-index:1;
  will-change:opacity,transform;
}
.store-card:hover{ transform:translateY(-2px); box-shadow:0 10px 22px rgba(10,15,25,.10); }

/* 🟩 LOGO CUADRADO UNIFORME */
.store-media{
  position:relative;
  overflow:hidden;
  border-radius:18px;
  background:#fafafa;
  aspect-ratio:1/1;                   /* SIEMPRE cuadrado */
  display:grid; place-items:center;   /* centra el logo dentro */
}
.store-media img{
  width:100%; height:100%;
  object-fit:contain;                 /* no recorta logos, misma “caja” */
  display:block;
  background:#fff;                    /* fondo limpio si hay transparencia */
}
.ribbon{
  position:absolute; left:50%; top:50%; transform:translate(-50%, -50%);
  background:rgb(255 255 255 / 80%); color:var(--ribbon-text);
  padding:10px 0; border-radius:5px; font-weight:800; font-size:14px; line-height:1.15; text-align:center;
  box-shadow:0 8px 18px rgba(0,0,0,.12); pointer-events:none; max-width:90%; width:max-content;
}
.store-main{ min-width:0; display:flex; flex-direction:column; gap:8px }
.store-name{
  margin:0; color:var(--ink); font-weight:800; font-size:24px; line-height:1.15;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.chips{ display:flex; gap:5px; flex-wrap:wrap }
.chip{ background:var(--chip-bg); color:var(--chip-text); padding:6px 8px; border-radius:8px; font-weight:600; font-size:14px; }

/* Estados/animaciones */
.store-card.is-enter, .store-card.is-leave{ opacity:0; transform:translateY(8px) scale(.98); }
.store-card.--hidden{ display:none!important; }
.store-card.is-ghost{ position:absolute; pointer-events:none; }
.store-card.is-leave, .store-card.is-ghost{ z-index:0; }

@media (max-width:600px){
  .store-card{ grid-template-columns:85px 1fr; border-radius:15px }
  .store-name{ font-size:16px }
  .ribbon{ font-size:12px }
}
@media (prefers-reduced-motion:reduce){
  .store-card{ transition:none; }
}

/* ==============================
   9) Ajustes de iconos (FA) y alineaciones
============================== */
.lp-ico{
  /* antes solo width/height; FA usa font-size */
  font-size:18px;
  width:14px; height:14px;
  display:inline-flex; align-items:center; justify-content:center;
  color:#50c878;
}
.pill-ico{
  font-size:18px;
  width:18px; height:18px;
  color:#7a7f87; opacity:.95;
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  pointer-events:none;
}

/* Ubicación centrada en el header */
.lp-home-location{
  justify-content:center;
  text-align:center;
}
.lp-home-location .lp-ico{ margin-right:6px; }

/* Buscador: texto alineado a la izquierda */
.search-overlay input{ text-align:left; }

/* Ticker (placeholder animado) alineado a la izquierda */
.pill-ticker{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  text-align:left;
}
.pill-item{
  justify-content:flex-start;
  padding-left:0;
}
.pill-ticker{ left:40px; right:38px; }

/* ==============================
   10) DESKTOP TWEAKS (≥1024px)
   — Sin cambios en móvil
============================== */
@media (min-width:1024px){
  :root{
    --desktop-max: 1180px;   /* ancho total alineado */
    --desktop-pad: 24px;     /* padding lateral idéntico */
  }

  /* Header: sin padding lateral, usar contenedores internos */
  .lp-home-header{
    padding:12px 0 10px;
    margin-left:0; margin-right:0;
  }

  /* Contenedores alineados al mismo ancho */
  .lp-home-header .lp-home-location,
  .lp-home-header .search-overlay,
  .lp-home-header .pub-hero,         /* OJO: ahora centramos el wrapper, no el carrusel */
  .lp-home-header .catrail,
  .index-wrap{
    max-width: var(--desktop-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--desktop-pad);
    padding-right: var(--desktop-pad);
    box-sizing: border-box;
  }

  /* Buscador: ocupa el ancho del contenedor */
  .lp-home-header .search-overlay{
    width:auto;
    padding-left:0; padding-right:0;
  }

  /* Carrusel más grande y alineado a los bordes del contenedor */
  .pub-hero{ padding-top: 4px; }                          /* un respiro */
  .lp-home-header .pub-carousel{
    max-width:none;        /* el ancho lo controla .pub-hero */
    margin:0;              /* sin márgenes adicionales */
    width:100%;            /* llena el contenedor */
    aspect-ratio:16/6;     /* más panorámico en desktop */
    max-height:300px;      /* un poco más alto */
    border-radius:16px;
  }

  /* Chips: mismos bordes que todo */
  .catrail{
    overflow-x:auto;
    gap:12px;
    padding-top:14px; padding-bottom:14px;
  }

  /* Contenido principal alineado */
  .index-wrap{
    margin:16px auto 24px;
    padding-left: var(--desktop-pad);
    padding-right: var(--desktop-pad);
  }

  /* 🔳 Tres columnas fijas en escritorio */
  .list{
    display:grid;
    grid-template-columns: repeat(3, 1fr);  /* ← 3 columnas */
    gap:16px;
  }

  /* Tarjetas con un poquito más de aire en desktop */
  .store-card{
    padding:16px;
    border-radius:22px;
    grid-template-columns:120px 1fr;
  }
  .store-name{ font-size:22px; }

  /* Catcards un poco más grandes en desktop */
  .catcard{ width:86px; padding:8px 8px; }
  .catcard-img{ width:48px; height:48px; }
  .catcard-name{ font-size:12.5px; }
}
