:root {
  --green-950: #0b3f25;
  --green-900: #11542f;
  --green-800: #176b3a;
  --green-700: #1f8549;
  --green-100: #eaf6ee;
  --green-50: #f4fbf6;
  --cream: #fffaf0;
  --white: #ffffff;
  --text: #162019;
  --muted: #667068;
  --border: #dfe7e1;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(24, 63, 38, 0.10);
  --shadow-soft: 0 10px 30px rgba(24, 63, 38, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", Arial, sans-serif;
  color: var(--text);
  background: var(--cream);
}

button,
input,
select {
  font: inherit;
}

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

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

/* =========================
   BANNER
========================= */

.hero {
  position: relative;
  min-height: 700px;
  overflow: hidden;
  color: var(--white);
  background-image: url("images/portada-catalogo.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}


/* =========================
   BIENVENIDA CENTRAL ANIMADA
========================= */

.hero-message {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 70px 20px 145px;
  pointer-events: none;
}

.welcome-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: min(560px, 80vw);
  min-height: 250px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at center,
      rgba(14, 82, 34, 0.34) 0%,
      rgba(10, 61, 28, 0.18) 44%,
      rgba(0, 0, 0, 0) 72%
    );
  animation: welcomeFloat 7s ease-in-out infinite;
}

.welcome-ring::before {
  content: "";
  position: absolute;
  inset: 12% 14%;
  border-radius: 50%;
  border: 6px solid transparent;
  background:
    linear-gradient(
      135deg,
      #fff8cf 0%,
      #f2d36a 16%,
      #8f650e 32%,
      #fff2a7 48%,
      #a87516 64%,
      #ffe89a 82%,
      #fffbd9 100%
    ) border-box;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-shadow:
    0 0 10px rgba(255, 236, 156, 0.95),
    0 0 24px rgba(242, 205, 90, 0.82),
    0 0 48px rgba(176, 120, 18, 0.58);
  animation: metallicPulse 10s ease-in-out infinite;
}

.welcome-ring::after {
  content: "";
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 17% 30%, rgba(255,255,255,0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 81% 25%, rgba(255,230,110,0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 76%, rgba(255,255,255,0.90) 0 1.7px, transparent 2.8px),
    radial-gradient(circle at 28% 78%, rgba(255,218,92,0.92) 0 1.8px, transparent 2.8px);
  animation: sparkle 11s ease-in-out infinite;
}

.hero-title {
  position: relative;
  z-index: 3;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-align: center;
  text-shadow:
    0 0 2px rgba(255,255,255,.95),
    0 0 8px rgba(124,255,150,.80),
    0 0 18px rgba(44,214,86,.60),
    0 4px 10px rgba(0,0,0,.35);
    animation: titleGlow 9s ease-in-out infinite;
}

.welcome-line {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18%;
  width: 42%;
  transform: translateX(-50%);
  color: #fff3a6;
  font-size: 1.35rem;
  text-align: center;
  text-shadow:
    0 0 8px rgba(255,255,255,0.90),
    0 0 18px rgba(255,219,95,0.85);
}

.welcome-line::before,
.welcome-line::after {
  content: "";
  display: inline-block;
  width: 37%;
  height: 3px;
  margin: 0 12px 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fff8d6, #d8a82b);
  box-shadow: 0 0 12px rgba(255, 224, 110, 0.88);
}

.welcome-line::after {
  background: linear-gradient(90deg, #d8a82b, #fff8d6, transparent);
}

@keyframes titleGlow {
  0%,
  40%,
  100% {
    filter: brightness(1);
    text-shadow:
      0 0 4px rgba(255,255,255,.95),
      0 0 10px rgba(120,255,150,.75),
      0 0 24px rgba(44,214,86,.55),
      0 8px 24px rgba(0,0,0,.45);
  }

  50% {
    transform: scale(1.01);
    filter: brightness(1.15);
    text-shadow:
      0 0 6px #fff,
      0 0 18px #8cff9c,
      0 0 34px #31d95c,
      0 8px 24px rgba(0,0,0,.45);
  }
}

@keyframes metallicPulse {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.97) rotate(-0.6deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.025) rotate(0.6deg);
  }
}

@keyframes welcomeFloat {
  0%,
  100% {
    transform: translateY(-5px);
  }

  50% {
    transform: translateY(8px);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.20);
  font-weight: 900;
  font-size: 1.35rem;
}

.brand strong,
.brand small {
  display: block;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand small {
  opacity: 0.95;
}

.back-home {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  min-height: 590px;
  padding-bottom: 42px;
}

.search-panel {
  position: relative;
  display: flex;
  align-items: center;
  width: min(920px, 100%);
  min-height: 68px;
  padding: 0 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.18);
}

.search-icon {
  margin-right: 12px;
  color: var(--green-800);
  font-size: 1.8rem;
}

.search-panel input {
  width: 100%;
  min-height: 66px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 1rem;
}

.clear-search {
  border: 0;
  background: transparent;
  color: #7a817c;
  font-size: 1.7rem;
  cursor: pointer;
}

/* =========================
   CATÁLOGO
========================= */

.catalog-shell {
  padding: 66px 0 76px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--green-700);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 3.5rem);
}

.results-count {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.category-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 26px 2px 12px;
  scrollbar-width: thin;
}

.category-chip {
  flex: 0 0 auto;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--green-900);
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.category-chip:hover,
.category-chip.active {
  border-color: var(--green-800);
  background: var(--green-800);
  color: var(--white);
  transform: translateY(-1px);
}

.catalog-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 20px 0 24px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.sort-control select {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--text);
}

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

.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow);
}

.product-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 235px;
  padding: 28px;
  background: linear-gradient(145deg, #edf8f1, #f9fcfa);
}

.product-media img {
  width: 100%;
  height: 180px;
  object-fit: contain;
}

.product-placeholder {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border-radius: 26px;
  background: var(--white);
  color: var(--green-700);
  box-shadow: 0 12px 30px rgba(23, 107, 58, 0.12);
  font-size: 2.8rem;
}

.product-content {
  padding: 20px;
}

.product-category {
  margin: 0 0 8px;
  color: var(--green-700);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-title {
  min-height: 52px;
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.4;
}

.product-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.product-price {
  margin: 0;
  color: var(--green-900);
  font-size: 1.45rem;
  font-weight: 900;
}

.view-button {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--green-100);
  color: var(--green-900);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.empty-state {
  padding: 90px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
}

.empty-state button {
  margin-top: 16px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--green-800);
  color: var(--white);
  font-weight: 900;
  cursor: pointer;
}

/* =========================
   BENEFICIOS
========================= */

.store-benefits {
  padding: 58px 0 110px;
  background: var(--green-950);
  color: var(--white);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.benefits-grid article {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.benefits-grid span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #d8f5df;
  color: var(--green-950);
  font-weight: 900;
}

.benefits-grid h3 {
  margin-bottom: 8px;
}

.benefits-grid p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

/* =========================
   MODAL
========================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 25, 15, 0.72);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(860px, 100%);
  overflow: hidden;
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  font-size: 1.55rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.modal-media {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 38px;
  background: var(--green-50);
}

.modal-media img {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
}

.modal-content {
  padding: 58px 42px 42px;
}

.modal-category {
  color: var(--green-700);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-content h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.08;
}

.modal-price {
  margin: 22px 0 8px;
  color: var(--green-900);
  font-size: 2rem;
  font-weight: 900;
}

.modal-stock,
.modal-note {
  color: var(--muted);
}

.modal-call {
  display: inline-block;
  margin-top: 18px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--green-800);
  color: var(--white);
  font-weight: 900;
}

.mobile-nav {
  display: none;
}

.hidden {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

/* =========================
   TABLET
========================= */

@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================
   CELULAR
========================= */

@media (max-width: 720px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    min-height: 650px;
    background-image: url("images/portada-catalogo.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .hero-message {
    padding: 70px 10px 150px;
  }

  .welcome-ring {
    width: min(520px, 92vw);
    min-height: 310px;
  }

  .welcome-ring::before {
    inset: 18% 22%;
    border-width: 4px;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .welcome-line {
    bottom: 23%;
    width: 84%;
    font-size: 1.05rem;
  }

  .welcome-line::before,
  .welcome-line::after {
    width: 30%;
    margin-inline: 7px;
  }

  .topbar {
    padding-top: 18px;
  }

  .back-home {
    display: none;
  }

  .hero-content {
    min-height: 560px;
    padding-bottom: 34px;
  }

  .search-panel {
    width: min(100%, 390px);
    min-height: 60px;
    margin-inline: auto;
    border-radius: 16px;
  }

  .search-panel input {
    min-height: 58px;
    font-size: 0.95rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-toolbar {
    justify-content: flex-start;
  }

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

  .product-media {
    min-height: 175px;
    padding: 18px;
  }

  .product-media img {
    height: 135px;
  }

  .product-content {
    padding: 16px;
  }

  .product-title {
    min-height: 66px;
    font-size: 0.96rem;
  }

  .product-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .modal-card {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-media {
    min-height: 260px;
  }

  .modal-content {
    padding: 34px 24px 28px;
  }

  .mobile-nav {
    position: fixed;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
  }

  .mobile-nav a {
    display: grid;
    justify-items: center;
    gap: 3px;
    color: var(--green-900);
    font-size: 0.74rem;
    font-weight: 900;
  }

  .mobile-nav span {
    font-size: 1.2rem;
  }
}

@media (max-width: 430px) {
  .container {
    width: min(100% - 22px, 1180px);
  }

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

  .product-title {
    min-height: auto;
  }

  .product-footer {
    align-items: center;
    flex-direction: row;
  }
}

.clear-search {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.clear-search.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Ocultar la X automática del navegador */
#product-search::-webkit-search-cancel-button,
#product-search::-webkit-search-decoration {
  appearance: none;
  -webkit-appearance: none;
  display: none;
}

/* Compatibilidad con navegadores antiguos de Microsoft */
#product-search::-ms-clear,
#product-search::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}