:root {
  --ink: #17211f;
  --muted: #5d6b68;
  --line: #dfe8e4;
  --paper: #fbfcfa;
  --soft: #eef6f3;
  --green: #25745f;
  --green-dark: #155743;
  --blue: #3f72a2;
  --coral: #c86655;
  --gold: #b98b33;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(23, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

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

.contact-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 34px;
  padding: 6px 18px;
  color: var(--white);
  background: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 252, 250, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 220px;
}

.brand img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: 54px;
  object-fit: contain;
  object-position: left center;
}

.eyebrow,
.trust-strip span,
.cart-empty span {
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.96rem;
}

.cart-button,
.primary-action,
.secondary-action,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.cart-button {
  gap: 10px;
  padding: 0 14px;
  color: var(--white);
  background: var(--ink);
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: var(--white);
  border-radius: 999px;
  font-size: 0.84rem;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: center;
  padding: clamp(42px, 6vw, 90px) clamp(18px, 4vw, 56px);
  background:
    linear-gradient(90deg, rgba(251, 252, 250, 0.96) 0%, rgba(251, 252, 250, 0.86) 40%, rgba(251, 252, 250, 0.12) 72%),
    url("assets/hero-alergico.png") center right / cover no-repeat;
}

.hero-copy {
  width: min(620px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow),
.service-band p {
  max-width: 580px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-copy p.hero-kicker {
  margin-bottom: 16px;
  color: var(--green-dark);
  font-size: clamp(2.5rem, 5.25vw, 4.85rem);
  font-weight: 800;
  line-height: 0.98;
}

.hero-copy p.hero-bold-copy {
  font-weight: 800;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action {
  padding: 0 18px;
  font-weight: 800;
}

.primary-action {
  color: var(--white);
  background: var(--green);
}

.primary-action:hover {
  background: var(--green-dark);
}

.secondary-action {
  color: var(--green-dark);
  background: var(--soft);
  border: 1px solid #cde2da;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.trust-strip div {
  padding: 22px clamp(18px, 4vw, 56px);
  border-right: 1px solid var(--line);
}

.trust-strip div:last-child {
  border-right: 0;
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip strong {
  margin-bottom: 4px;
}

.section {
  padding: clamp(48px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.catalog-status,
.result-count {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.catalog-status {
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.category-card {
  position: relative;
  isolation: isolate;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 116, 95, 0.14), rgba(63, 114, 162, 0.14)),
    var(--white);
}

.category-card.has-photo {
  color: var(--ink);
  background: var(--white);
  border-color: rgba(37, 116, 95, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.category-card__image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(0.6px) saturate(0.9);
  opacity: 0.48;
  transform: scale(1.02);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.category-card.has-photo::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 0;
  background: var(--category-bg) center / cover no-repeat;
  filter: blur(1px) saturate(0.85);
  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.category-card.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.78) 64%, rgba(255, 255, 255, 0.94) 100%),
    linear-gradient(135deg, rgba(37, 116, 95, 0.08), rgba(63, 114, 162, 0.04));
  pointer-events: none;
}

.category-card.has-photo:hover .category-card__image,
.category-card.has-photo:hover::before {
  opacity: 0.62;
  transform: scale(1.06);
}

.category-card strong,
.category-card span {
  display: block;
}

.category-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.category-card.has-photo strong,
.category-card.has-photo span {
  position: relative;
  z-index: 2;
  color: var(--ink);
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.65);
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px auto minmax(280px, 1.4fr);
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}

.search-field,
.select-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.search-field input,
.select-field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--white);
}

.select-field select {
  cursor: pointer;
}

.search-field input:focus,
.select-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(37, 116, 95, 0.14);
}

.stock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.stock-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-buttons button {
  min-height: 40px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.filter-buttons button.is-active {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.result-count {
  margin-bottom: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-load-more {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.product-card.is-out-of-stock {
  opacity: 0.78;
}

.product-media {
  height: 210px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: #f7faf8;
  font-size: 3rem;
  font-weight: 800;
}

.product-media span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  background: var(--white);
}

.product-card:nth-child(3n) .product-media span {
  background: linear-gradient(135deg, var(--coral), var(--gold));
}

.product-card:nth-child(4n) .product-media span {
  background: linear-gradient(135deg, var(--blue), var(--green-dark));
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-body h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.28;
}

.product-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-row strong {
  font-size: 1.12rem;
}

.stock-badge {
  padding: 5px 8px;
  color: var(--green-dark);
  background: var(--soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-card.is-out-of-stock .stock-badge {
  color: var(--coral);
  background: #fff1ee;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.add-button,
.detail-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.add-button {
  color: var(--white);
  background: var(--ink);
}

.detail-button {
  color: var(--green-dark);
  background: var(--soft);
  border: 1px solid #cde2da;
}

.add-button:disabled {
  color: var(--muted);
  background: var(--soft);
  cursor: not-allowed;
}

.product-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 28px));
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.product-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.product-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.product-modal__body {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.35fr);
  gap: 22px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.product-detail-media {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-self: start;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-detail-media img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  padding: 18px;
}

.product-detail-media span {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 360px;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--green), var(--blue));
  border-radius: 8px;
  font-size: 4rem;
  font-weight: 900;
}

.product-detail-content {
  display: grid;
  gap: 14px;
  align-content: start;
}

.product-detail-content h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.detail-price {
  justify-content: flex-start;
}

.ficha-section {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ficha-section h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.ficha-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.detail-add {
  margin-top: 4px;
}

.legacy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 38px;
  padding: 0 12px;
  color: var(--green-dark);
  background: var(--soft);
  border: 1px solid #cde2da;
  border-radius: 8px;
  font-weight: 800;
}

.service-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(42px, 6vw, 78px) clamp(18px, 4vw, 56px);
  color: var(--white);
  background: var(--ink);
}

.service-band .eyebrow,
.service-band p {
  color: rgba(255, 255, 255, 0.72);
}

.service-band .primary-action {
  flex: 0 0 auto;
  background: var(--coral);
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 22px;
  padding: clamp(26px, 4vw, 42px) clamp(18px, 4vw, 56px);
  color: var(--white);
  background: var(--ink);
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  margin-bottom: 8px;
}

.site-footer span {
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.55;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  height: 100vh;
  padding: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.cart-panel.is-open {
  transform: translateX(0);
}

.cart-panel__header,
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.icon-button {
  width: 42px;
  color: var(--ink);
  background: var(--soft);
  font-weight: 800;
}

.cart-items {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 12px 0;
}

.cart-item {
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-item h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-control button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

.cart-empty {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 220px;
  text-align: center;
}

.cart-empty.is-hidden {
  display: none;
}

.cart-summary {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cart-total-line {
  margin-bottom: 14px;
}

.cart-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cart-total-line--grand {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.delivery-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.delivery-form strong {
  font-size: 0.92rem;
}

.delivery-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.delivery-form input {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 8px;
}

.form-grid--triple {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.82fr) minmax(0, 0.7fr);
}

.form-grid--address {
  grid-template-columns: minmax(0, 1fr) 76px;
}

.checkout-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.cart-summary .secondary-action {
  margin-top: 8px;
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.full {
  width: 100%;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: rgba(23, 33, 31, 0.42);
}

.backdrop.is-open {
  display: block;
}

@media (max-width: 980px) {
  .nav {
    display: none;
  }

  .hero {
    min-height: 720px;
    align-items: end;
    background:
      linear-gradient(180deg, rgba(251, 252, 250, 0.22) 0%, rgba(251, 252, 250, 0.95) 58%, var(--paper) 100%),
      url("assets/hero-alergico.png") center top / cover no-repeat;
  }

  .trust-strip,
  .category-grid,
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-band {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

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

  .filter-buttons {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .product-modal__body {
    grid-template-columns: 1fr;
  }

  .product-detail-media,
  .product-detail-media span {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .contact-strip {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .topbar {
    gap: 10px;
  }

  .header-main {
    min-height: 68px;
    gap: 10px;
  }

  .brand {
    min-width: 0;
  }

  .cart-button span {
    display: none;
  }

  .brand img {
    width: 162px;
    height: 44px;
  }

  .hero {
    min-height: 650px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .trust-strip,
  .category-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }

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

  .product-actions {
    grid-template-columns: 1fr;
  }

  .product-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .trust-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
