/* ============================================================
   Pluma — Tienda pública (claro, papel y tinta)
   La papelería respira en claro; el panel va oscuro.
   ============================================================ */

:root {
  --tinta:        #0a2540;
  --tinta-medio:  #40607f;
  --tinta-tenue:  #7893ad;
  --papel:        #fbfaf7;
  --papel-2:      #f2f0ea;
  --linea:        rgba(10, 37, 64, 0.11);
  --azul:         #2f8ef4;
  --azul-claro:   #e8f2ff;
  --azul-hondo:   #1e6fd9;
  --verde:        #0f9d63;
  --ambar:        #d97706;
  --rojo:         #dc2626;
  --radio:        16px;
  --sombra:       0 4px 20px rgba(10, 37, 64, 0.07);
  --sombra-alta:  0 12px 40px rgba(10, 37, 64, 0.12);
}

* { box-sizing: border-box; }

html { overflow-x: clip; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--papel);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px;
}

[hidden] { display: none !important; }
.oculto { display: none !important; }

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

a { color: var(--azul-hondo); text-decoration: none; }
a:hover { color: var(--azul); }

h1, h2, h3, h4 {
  margin: 0 0 .5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--tinta);
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

.contenedor {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ------------------------------------------------------------
   Cabecera
   ------------------------------------------------------------ */
.cab {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linea);
}

.cab__interior {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1.25rem;
  max-width: 1180px;
  margin: 0 auto;
}

.cab__marca { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.cab__logo {
  width: 42px; height: 42px;
  max-width: 42px; max-height: 42px;
  object-fit: contain;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(10,37,64,.1);
  flex-shrink: 0;
}
.cab__nombre {
  font-weight: 750;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--tinta);
}
.cab__bajada {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tinta-tenue);
  line-height: 1;
}

.cab__nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
  align-items: center;
}
.cab__nav a {
  padding: .45rem .8rem;
  border-radius: 10px;
  font-size: .91rem;
  font-weight: 550;
  color: var(--tinta-medio);
  white-space: nowrap;
}
.cab__nav a:hover { background: var(--azul-claro); color: var(--azul-hondo); }

.carrito-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--tinta);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  min-height: 44px;
}
.carrito-btn:hover { background: #123a63; color: #fff; }

.carrito-cuenta {
  background: var(--azul);
  color: #fff;
  border-radius: 999px;
  min-width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .74rem;
  font-weight: 700;
  padding: 0 5px;
}

/* ------------------------------------------------------------
   Portada
   ------------------------------------------------------------ */
.portada {
  position: relative;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem);
  overflow: hidden;
}
.portada::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(47,142,244,.13) 0%, transparent 42%),
    radial-gradient(circle at 12% 76%, rgba(47,142,244,.08) 0%, transparent 46%);
  pointer-events: none;
}
.portada__interior {
  position: relative;
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
}
.portada__etiqueta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: var(--azul-claro);
  color: var(--azul-hondo);
  font-size: .78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 1rem;
}
.portada__titulo { margin-bottom: 1rem; }
.portada__titulo em {
  font-style: normal;
  color: var(--azul-hondo);
  position: relative;
  white-space: nowrap;
}
.portada__titulo em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: .06em;
  height: .32em;
  background: rgba(47,142,244,.22);
  border-radius: 2px;
  z-index: -1;
}
.portada__texto {
  font-size: clamp(1rem, .95rem + .25vw, 1.12rem);
  color: var(--tinta-medio);
  max-width: 46ch;
  margin-bottom: 1.75rem;
}
.portada__acciones { display: flex; gap: .7rem; flex-wrap: wrap; }

.portada__arte {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.portada__arte img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  background: var(--papel-2);
}
.portada__arte img:nth-child(1) { grid-row: span 2; aspect-ratio: 1/2.06; }

/* ------------------------------------------------------------
   Botones
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .65rem 1.3rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn--primario { background: var(--tinta); color: #fff; }
.btn--primario:hover { background: #123a63; color: #fff; transform: translateY(-1px); box-shadow: var(--sombra); }

.btn--azul { background: var(--azul); color: #fff; }
.btn--azul:hover { background: var(--azul-hondo); color: #fff; }

.btn--borde { background: transparent; border-color: var(--linea); color: var(--tinta); }
.btn--borde:hover { background: var(--papel-2); color: var(--tinta); }

.btn--bloque { width: 100%; }
.btn--sm { min-height: 40px; padding: .45rem .9rem; font-size: .87rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ------------------------------------------------------------
   Secciones
   ------------------------------------------------------------ */
.seccion { padding: clamp(2rem, 4vw, 3.5rem) 0; }
.seccion__cabeza { text-align: center; margin-bottom: 2rem; }
.seccion__cabeza p { color: var(--tinta-medio); max-width: 52ch; margin: 0 auto; }

/* Filtros de categoría */
.chips {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .25rem 0 1rem;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--linea);
  background: #fff;
  color: var(--tinta-medio);
  font-size: .88rem;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  min-height: 42px;
  transition: all .13s;
}
.chip:hover { border-color: var(--azul); color: var(--azul-hondo); }
.chip.activo { background: var(--tinta); border-color: var(--tinta); color: #fff; }

/* ------------------------------------------------------------
   Rejilla de productos
   ------------------------------------------------------------ */
.productos {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
}

.tarjeta-prod {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
  min-width: 0;
}
.tarjeta-prod:hover { transform: translateY(-3px); box-shadow: var(--sombra-alta); }

.tarjeta-prod__foto {
  position: relative;
  aspect-ratio: 1;
  background: var(--papel-2);
  overflow: hidden;
}
.tarjeta-prod__foto img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.tarjeta-prod:hover .tarjeta-prod__foto img { transform: scale(1.04); }

.etiqueta-oferta {
  position: absolute;
  top: .6rem; left: .6rem;
  background: var(--rojo);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.etiqueta-agotado {
  position: absolute;
  inset: 0;
  background: rgba(251,250,247,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--tinta-medio);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .85rem;
  backdrop-filter: blur(2px);
}

.tarjeta-prod__cuerpo {
  padding: .9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}
.tarjeta-prod__cat {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tinta-tenue);
  font-weight: 650;
}
.tarjeta-prod__nombre {
  font-weight: 650;
  font-size: .98rem;
  line-height: 1.32;
  color: var(--tinta);
}
.tarjeta-prod__desc {
  font-size: .82rem;
  color: var(--tinta-tenue);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tarjeta-prod__pie {
  margin-top: auto;
  padding-top: .6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.precio {
  font-weight: 750;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--tinta);
}
.precio--tachado {
  font-size: .82rem;
  font-weight: 500;
  color: var(--tinta-tenue);
  text-decoration: line-through;
  margin-left: .35rem;
}
.precio--consultar { font-size: .95rem; color: var(--tinta-medio); font-weight: 600; }

/* ------------------------------------------------------------
   Vacío
   ------------------------------------------------------------ */
.vacio {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--tinta-tenue);
}
.vacio i { font-size: 3rem; opacity: .35; display: block; margin-bottom: 1rem; }

/* ------------------------------------------------------------
   Barra inferior móvil
   ------------------------------------------------------------ */
.barra-movil {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(251,250,247,.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--linea);
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.barra-movil a, .barra-movil button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  padding: .35rem .7rem;
  font-size: .66rem;
  color: var(--tinta-tenue);
  background: none;
  border: none;
  cursor: pointer;
  min-width: 58px;
  font-family: inherit;
  position: relative;
}
.barra-movil i { font-size: 1.25rem; }
.barra-movil .activo { color: var(--azul-hondo); font-weight: 650; }
.barra-movil .cuenta-mini {
  position: absolute;
  top: 0; right: 6px;
  background: var(--azul);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------
   Pie
   ------------------------------------------------------------ */
.pie {
  background: var(--tinta);
  color: #b9cee2;
  padding: 2.5rem 0 2rem;
  margin-top: 2rem;
}
.pie__rejilla {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  margin-bottom: 1.5rem;
}
.pie h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; margin-bottom: .7rem; }
.pie a { color: #b9cee2; font-size: .9rem; display: block; padding: .18rem 0; }
.pie a:hover { color: #fff; }
.pie__legal {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 1.2rem;
  font-size: .8rem;
  text-align: center;
  color: #8aa8c4;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 880px) {
  .portada__interior { grid-template-columns: minmax(0, 1fr); }
  .portada__arte { order: -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portada__arte img:nth-child(1) { grid-row: span 1; aspect-ratio: 1; }
  .cab__nav { display: none; }
}

@media (max-width: 620px) {
  .productos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .tarjeta-prod__cuerpo { padding: .7rem .75rem .9rem; }
  .tarjeta-prod__nombre { font-size: .88rem; }
  .tarjeta-prod__desc { display: none; }
  .precio { font-size: 1rem; }
  .contenedor { padding: 0 1rem; }
  .portada__arte { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portada__arte img:nth-child(3) { display: none; }
}

@media (min-width: 881px) {
  .barra-movil { display: none; }
  body { padding-bottom: 0; }
}

@media print {
  .cab, .barra-movil, .pie, .btn { display: none !important; }
  body { background: #fff; }
}
