/* Estilos globales del sitio. Copia de lizi/src/styles/global.css. */
:root {
  --green-900: #0b442c;
  --green-800: #215834;
  --green-600: #458b45;
  --green-400: #61ce70;
  --green-50: #e1eee1;
  --gold: #b6823b;
  --gold-light: #edd288;
  --amber: #eeac4f;
  --text: #1f2a24;
  --muted: #5f6b64;
  --border: #e3e8e4;
  --bg: #ffffff;
  --bg-soft: #f6f9f6;
  --sale: #c0262d;
  --radius: 10px;
  --shadow: 0 6px 20px rgba(11, 68, 44, 0.08);
  --container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--green-900);
  margin: 0 0 0.5em;
}

button,
input,
textarea {
  font: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 48px 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  margin: 0;
}

.section-title a {
  color: var(--green-600);
  font-weight: 600;
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 12px 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  background: #c9d1cc;
  color: #fff;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--green-900);
  color: #fff;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-amber {
  background: var(--amber);
  color: var(--green-900);
}

/* El botón de un producto que ya está en el carrito. Lo pone cart.js, nunca el HTML de la página.
   El borde va de `box-shadow` y no de `border` porque `.btn` no tiene borde y añadirlo movería el texto. */
.btn-in-cart {
  background: var(--bg);
  color: var(--green-900);
  box-shadow: inset 0 0 0 2px var(--green-900);
}

.btn-in-cart:hover {
  background: var(--green-50);
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
}

.btn-block {
  width: 100%;
}

.price {
  color: var(--sale);
  font-weight: 600;
}

.price del {
  color: var(--muted);
  font-weight: 400;
  margin-right: 6px;
  font-size: 0.9em;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.badge-out {
  background: #eceeed;
  color: var(--muted);
}

.badge-sale {
  background: var(--sale);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 20px 0 8px;
}

.breadcrumb a:hover {
  color: var(--green-600);
}

.breadcrumb span[aria-hidden] {
  opacity: 0.5;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.qty button {
  width: 38px;
  height: 40px;
  border: 0;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--green-900);
}

.qty button:hover {
  background: var(--bg-soft);
}

.qty input {
  width: 44px;
  height: 40px;
  border: 0;
  text-align: center;
  -moz-appearance: textfield;
}

.qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.prose {
  color: #37433c;
}

.prose p {
  margin: 0 0 0.8em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--green-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
  max-width: calc(100% - 32px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast a {
  color: var(--gold-light);
  font-weight: 600;
  white-space: nowrap;
}

/* Listado con sidebar de categorías a la izquierda. */
.shop-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-areas: 'sidebar main';
  gap: 32px;
  align-items: start;
}

.shop-layout > aside {
  grid-area: sidebar;
}

.shop-layout > .shop-main {
  grid-area: main;
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
    grid-template-areas: 'sidebar' 'main';
    gap: 16px;
  }
}

.shop-layout .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

@media (max-width: 520px) {
  .shop-layout .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Sección gris con barra blanca de 3 columnas (Ofertas relámpago, Comprar es muy fácil). */
.feature-section {
  background: #f3f4f6;
}

.feature-section .feature-head h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  color: #1f2a37;
}

.feature-section .feature-head p {
  color: #5b6470;
  margin: 0 0 24px;
}

.feature-bar {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.feature-bar > li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 20px;
  font-size: 1.05rem;
  color: #1f2a37;
  position: relative;
}

.feature-bar > li + li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 30%;
  bottom: 30%;
  width: 1px;
  background: var(--border);
}

.feature-bar svg {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .feature-section .feature-head {
    text-align: center;
  }

  .feature-bar {
    grid-template-columns: 1fr;
  }

  .feature-bar > li {
    justify-content: flex-start;
    padding: 16px 20px;
  }

  .feature-bar > li + li::before {
    left: 20px;
    right: 20px;
    top: 0;
    bottom: auto;
    width: auto;
    height: 1px;
  }
}

@media (max-width: 520px) {
  .toast {
    left: 16px;
    right: 16px;
    max-width: none;
    transform: translateY(20px);
    justify-content: space-between;
  }

  .toast.show {
    transform: translateY(0);
  }
}

/* La barra de cuatro colores, de los estilos de lizi/src/layouts/Layout.astro: la dibujan tanto la cabecera
   como el pie, así que vive aquí y no en ninguna de sus dos hojas. */
.brand-bar {
  display: grid;
  grid-template-columns: 25% 37.5% 25% 12.5%;
  height: 5px;
}

.brand-bar span:nth-child(1) { background: var(--green-900); }
.brand-bar span:nth-child(2) { background: var(--green-800); }
.brand-bar span:nth-child(3) { background: var(--green-600); }
.brand-bar span:nth-child(4) { background: var(--green-400); }
