/* =========================================================
   CATÁLOGO
========================================================= */

.catalogo-page {
  position: relative;
  padding: 120px 0 80px;
  overflow: hidden;
  background: radial-gradient(
      1200px 520px at 50% 0%,
      rgba(34, 197, 94, 0.18),
      transparent 60%
    ),
    radial-gradient(
      900px 420px at 10% 20%,
      rgba(45, 212, 191, 0.14),
      transparent 60%
    ),
    radial-gradient(
      900px 420px at 90% 30%,
      rgba(34, 197, 94, 0.12),
      transparent 60%
    ),
    linear-gradient(180deg, #f7fbff 0%, #eef6f6 55%, #ffffff 100%);
}

.catalogo-page::before {
  content: "";
  position: absolute;
  inset: -120px -140px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.88;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Cdefs%3E%3CradialGradient id='g' cx='50%25' cy='20%25' r='70%25'%3E%3Cstop offset='0%25' stop-color='%2322c55e' stop-opacity='.16'/%3E%3Cstop offset='70%25' stop-color='%2322c55e' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='1600' height='900' fill='url(%23g)'/%3E%3Cg fill='none' stroke='%2322c55e' stroke-opacity='.18' stroke-width='3'%3E%3Cpath d='M-80 250 C 220 120, 520 380, 820 250 S 1420 120, 1720 250'/%3E%3Cpath d='M-120 360 C 190 220, 520 520, 860 360 S 1460 220, 1780 360'/%3E%3Cpath d='M-140 480 C 160 340, 560 660, 940 480 S 1500 340, 1820 480'/%3E%3Cpath d='M-180 620 C 120 480, 620 780, 1020 620 S 1540 480, 1880 620'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='240' cy='170' r='2' opacity='.5'/%3E%3Ccircle cx='520' cy='120' r='1.6' opacity='.46'/%3E%3Ccircle cx='980' cy='160' r='2.2' opacity='.42'/%3E%3Ccircle cx='1220' cy='110' r='1.6' opacity='.42'/%3E%3Ccircle cx='1420' cy='210' r='2' opacity='.34'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(
      700px 340px at 50% 10%,
      rgba(255, 255, 255, 0.65),
      transparent 65%
    );
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(0.2px);
}

.catalogo-page .container {
  position: relative;
  z-index: 2;
}

.catalogo-page__header {
  text-align: center;
  margin-bottom: 40px;
}

.catalogo-page__title {
  margin: 0 0 10px;
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 42px);
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.catalogo-page__subtitle {
  margin: 0 auto 28px;
  max-width: 720px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.55;
}

.catalogo-page__filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.catalogo-page__input,
.catalogo-page__select {
  min-width: 240px;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: #0f172a;
}

.catalogo-page__btn {
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.18);
}

.catalogo-page__results {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
}

.catalogo-page__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.catalogo-page__empty {
  text-align: center;
  padding: 70px 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.06);
}

/* =========================================================
   CARD PRODUCTO
========================================================= */

.catalogo-card {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
  transition: 0.25s ease;
  cursor: pointer;
}

.catalogo-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.12);
}

.catalogo-card__media {
  position: relative;
  height: 260px;
  background: #f8fafc;
}

.catalogo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalogo-card__body {
  padding: 18px;
}

.catalogo-card__category {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.catalogo-card__brand {
  display: block;
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.catalogo-card__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.catalogo-card__desc {
  margin: 0;
  min-height: 48px;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
}

.catalogo-card__stock {
  margin-top: 12px;
}

.catalogo-card__footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalogo-card__price {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}

.catalogo-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  text-decoration: none;
  font-weight: 800;
  background: #111827;
  color: #fff;
  cursor: pointer;
}

.catalogo-card__cta--disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
}

/* =========================================================
   BADGES / STOCK
========================================================= */

.catalogo-card__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
}

.catalogo-card__badge--ok {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.catalogo-card__badge--low {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.catalogo-card__badge--out {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.catalogo-stock {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.catalogo-stock--ok {
  background: #dcfce7;
  color: #166534;
}

.catalogo-stock--low {
  background: #fef3c7;
  color: #92400e;
}

.catalogo-stock--out {
  background: #fee2e2;
  color: #991b1b;
}

/* =========================================================
   PAGINACIÓN
========================================================= */

.catalogo-pagination {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.catalogo-pagination__pages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.catalogo-pagination__btn,
.catalogo-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.06);
  transition: 0.2s ease;
}

.catalogo-pagination__btn:hover,
.catalogo-pagination__page:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.1);
}

.catalogo-pagination__page--active {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  border-color: rgba(8, 75, 32, 0.28);
}

.catalogo-pagination__btn--disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* =========================================================
   MODAL PRODUCTO
========================================================= */

body.modal-open {
  overflow: hidden;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.product-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(960px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  margin: 20px auto;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 40px 120px rgba(2, 6, 23, 0.28);
  padding: 24px;
  transform: translateY(22px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
  will-change: transform, opacity;
}

.product-modal.is-open,
.product-modal.is-closing {
  pointer-events: auto;
}

.product-modal.is-open .product-modal__backdrop {
  opacity: 1;
}

.product-modal.is-open .product-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.product-modal.is-closing .product-modal__backdrop {
  opacity: 0;
}

.product-modal.is-closing .product-modal__dialog {
  transform: translateY(22px) scale(0.96);
  opacity: 0;
}

.product-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.product-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.product-modal__media {
  background: #f8fafc;
  border-radius: 22px;
  overflow: hidden;
  min-height: 360px;
}

.product-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-modal__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-modal__category {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-modal__brand {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-modal__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  font-weight: 900;
  color: #0f172a;
}

.product-modal__desc {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.product-modal__specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.product-modal__spec {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
}

.product-modal__label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.product-modal__value {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

.product-modal__qty {
  margin-top: 4px;
}

.product-modal__qtyLabel {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
  color: #0f172a;
}

.product-modal__qtyControls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-modal__qtyBtn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.product-modal__qtyInput {
  width: 90px;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.product-modal__qtyHint {
  display: block;
  margin-top: 10px;
  color: #64748b;
}

.product-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.product-modal__cartBtn,
.product-modal__waBtn {
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    opacity 0.18s ease;
}

.product-modal__cartBtn:hover,
.product-modal__waBtn:hover {
  transform: translateY(-1px);
}

.product-modal__cartBtn {
  background: #0f172a;
  color: #ffffff;
}

.product-modal__cartBtn.is-disabled,
.product-modal__cartBtn:disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.product-modal__waBtn {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.18);
}

.product-modal__waBtn.is-disabled,
.product-modal__waBtn:disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.product-modal__note {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
  .catalogo-page__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .product-modal__grid {
    grid-template-columns: 1fr;
  }

  .product-modal__media {
    min-height: 260px;
  }

  .product-modal__specs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .catalogo-page__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .catalogo-page {
    padding: 100px 0 60px;
  }

  .catalogo-page__filters {
    flex-direction: column;
    align-items: stretch;
  }

  .catalogo-page__input,
  .catalogo-page__select,
  .catalogo-page__btn {
    width: 100%;
  }

  .catalogo-page__grid {
    grid-template-columns: 1fr;
  }

  .catalogo-card__media {
    height: 220px;
  }

  .product-modal__dialog {
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 18px;
    border-radius: 22px;
  }

  .product-modal__actions {
    flex-direction: column;
  }

  .product-modal__cartBtn,
  .product-modal__waBtn {
    width: 100%;
  }
}
