/* ======================= THEME ======================= */
:root {
  --bg: #1b2a23;
  --text: #f6fffb;
  --muted: #d0eadb;
  --line: rgba(246, 255, 251, 0.22);
  --accent: #22c55e;
  --accent2: #16a34a;
  --shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
  --radius: 18px;
  --container: 1100px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans";
}

/* ======================= BASE ======================= */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(34, 197, 94, 0.18), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(34, 197, 94, 0.14), transparent 55%),
    var(--bg);
}

.container {
  width: min(var(--container), 92%);
  margin-inline: auto;
}

.container--wide {
  width: min(1600px, 96%);
  margin-inline: auto;
}

.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.srOnly {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ======================= HEADER / NAV ======================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(27, 42, 35, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  height: 60px;
  width: auto;
  display: block;
}

.brand__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.55);
  font-weight: 900;
}

.brand__name {
  font-weight: 900;
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav__link {
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.nav__link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.10);
}

.nav__cta {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.55);
}

.nav__toggle {
  display: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

/* ======================= SECTIONS / TYPO ======================= */
.section { padding: 64px 0; }

.section--alt {
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__head { margin-bottom: 18px; }

.section__head h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.8vw, 34px);
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

/* ======================= CARDS / PANELS / STATS ======================= */
.card,
.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel--dark {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.28), rgba(34, 197, 94, 0.14));
}

.stat {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  padding: 12px 14px;
  border-radius: 16px;
  min-width: 120px;
}

.stat__num { font-weight: 900; }
.stat__label { color: var(--muted); font-size: 0.9rem; }

.pill,
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.badge,
.chip {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.24);
}

.pills { display: flex; gap: 8px; flex-wrap: wrap; }

.checklist,
.bullets {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

/* ======================= HERO ======================= */
.hero { padding-top: 46px; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 22px;
  align-items: start;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 60ch;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.hero__stats { display: flex; gap: 14px; flex-wrap: wrap; }

/* ======================= BUTTONS ======================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}

.btn--primary {
  border-color: rgba(34, 197, 94, 0.75);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.99), rgba(22, 163, 74, 0.99));
}

.btn--ghost:hover { background: rgba(255, 255, 255, 0.16); }

.btn--danger {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
}

.btn--danger:hover { background: rgba(239, 68, 68, 0.18); }

/* ======================= LAYOUTS ======================= */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start; /* evita estiramientos raros */
}

.split > .card,
.split > .panel { align-self: start; }

/* ======================= FORMS ======================= */
.filters {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.field--right { justify-self: end; }

.field label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
} /* ✅ ESTA LLAVE ES IMPORTANTE */

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  padding: 10px 12px;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  max-height: 220px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(208, 234, 219, 0.65);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(34, 197, 94, 0.75);
  outline: none;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

/* ======================= FOOTER / LINKS ======================= */
.footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  background: rgba(0, 0, 0, 0.14);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.link { color: #def7ea; text-decoration: none; }
.link:hover { color: #f6fffb; text-decoration: underline; }

/* ======================= CATALOGO GRID ======================= */
.products {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.product {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ✅ AQUÍ: el “sobrante” del recuadro en BLANCO */
.product__img {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;

  background: #fff; /* ✅ lo que no se complete será blanco */
  border: 1px solid rgba(255, 255, 255, 0.10);

  display: flex;
  align-items: center;
  justify-content: center;
}

.product__img img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ✅ NO recorta */
  display: block;
  background: #fff; /* ✅ por si el PNG tiene transparencia */
}

.product__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.product__cat,
.product__brand {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.product__name {
  margin: 2px 0 0;
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 900;
}

.product__price { font-weight: 900; white-space: nowrap; }

.product__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 2.6em;
}

.product__actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ======================= MODAL ======================= */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 999;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal__card {
  width: min(1200px, 96%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 18px;
  background: rgba(18, 22, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  position: relative;
  padding: 16px;
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  z-index: 2;
}

.modal__close:hover { background: rgba(255, 255, 255, 0.14); }

.modalGrid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

/* deja “aire” para que el precio no choque con la X */
.modalGrid > div:last-child { padding-right: 72px; }
@media (max-width: 900px) { .modalGrid > div:last-child { padding-right: 0; } }

/* ✅ imagen modal completa + sobrante blanco */
.modalGallery__main {
  width: 100%;
  min-height: 520px;
  border-radius: 16px;
  overflow: hidden;

  background: #fff; /* ✅ sobrante blanco */
  border: 1px solid rgba(255, 255, 255, 0.10);

  display: flex;
  align-items: center;
  justify-content: center;
}

.modalGallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.modalThumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.modalThumb {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  cursor: pointer;
  background: #fff; /* ✅ sobrante blanco */
}

.modalThumb img {
  width: 100%;
  height: 70px;
  object-fit: contain; /* ✅ para no recortar thumbs */
  display: block;
  background: #fff;
}

.modalTitle {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 1000;
}

.miniLine {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.specs {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.modalOverlay[hidden],
.modal[hidden] { display: none !important; }

/* ======================= ADMIN (como demo) ======================= */
.adminHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 0 18px;
}

.adminTitle {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: 0.2px;
}

.adminSub {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.adminHead__right {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.adminCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.adminCard {
  border: 1px solid rgba(246, 255, 251, 0.18);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0;
}

/* ✅ sobrante blanco en admin */
.adminCard__img {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;

  background: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);

  display: flex;
  align-items: center;
  justify-content: center;
}

.adminCard__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.adminCard__meta {
  padding: 0 14px 12px;
  display: grid;
  gap: 6px;
}

.adminCard__sub { margin: 0; font-size: 13px; color: rgba(246, 255, 251, 0.72); }
.adminCard__title { margin: 0; font-weight: 900; font-size: 18px; line-height: 1.15; }
.adminCard__price { margin: 0; font-weight: 900; letter-spacing: 0.3px; }

.adminCard__actions {
  margin-top: auto;
  padding: 12px 14px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.iconBtn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 255, 251, 0.18);
  background: rgba(0, 0, 0, 0.12);
  color: rgba(246, 255, 251, 0.92);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.iconBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.10);
}

.iconBtn--danger { border-color: rgba(239, 68, 68, 0.45); }
.iconBtn--danger:hover { border-color: rgba(239, 68, 68, 0.75); background: rgba(239, 68, 68, 0.10); }
.iconBtn svg { width: 18px; height: 18px; }

.adminCard.addCard {
  border: 2px dashed rgba(246, 255, 251, 0.30);
  background: rgba(0, 0, 0, 0.12);
  box-shadow: none;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  min-height: 430px;
}

.adminCard.addCard:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.08);
}

.addCard__inner { text-align: center; padding: 18px; }

.addCard__circle {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.16);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  margin: 0 auto 10px;
}

.addCard__txt { margin: 0; text-align: center; color: rgba(246, 255, 251, 0.92); font-weight: 900; }
.addCard__hint { margin: 6px 0 0; color: rgba(246, 255, 251, 0.70); font-size: 13px; }

/* ======================= AUTH / LOGIN ======================= */
.authPage {
  min-height: calc(100vh - 144px);
  display: grid;
  place-items: center;
  padding: 34px 0;
}

.authWrap { width: min(520px, 92%); }
.authCard { padding: 20px; }

.authHead { margin-bottom: 14px; text-align: left; }
.authHead h2 { margin: 0 0 6px; font-size: 1.55rem; }
.authHead p { margin: 0; }

.authForm { display: grid; gap: 12px; }

.authBtn {
  width: 160px;
  justify-self: start;
  margin-top: 6px;
}

.authCard .field input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(246, 255, 251, 0.18);
}

.authCard .field input:focus {
  border-color: rgba(34, 197, 94, 0.85);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

/* =========================
   SELECTS – ESTILO SANMEX
========================= */
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 100%;
  padding: 12px 44px 12px 14px;

  background-color: #1f3b2e;
  color: #f6fffb;

  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 14px;

  font-size: 0.95rem;
  cursor: pointer;

  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;

  background-image:
    linear-gradient(45deg, transparent 50%, #22c55e 50%),
    linear-gradient(135deg, #22c55e 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 55%,
    calc(100% - 16px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.field select:hover {
  background-color: #224734;
  border-color: #22c55e;
}

.field select:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.field select option {
  background-color: #1b2a23;
  color: #f6fffb;
}

.field select option[value="all"] { color: #d0eadb; }

/* ======================= MAP ======================= */
.map { margin-top: 14px; overflow: hidden; border-radius: 16px; }
.map__title { margin: 0 0 8px 0; font-size: 14px; font-weight: 700; }
.map iframe { display: block; width: 100%; height: 260px; border: 0; }

/* ======================= MODAL FORM (producción) ======================= */
#modalBody label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 10px 0 6px;
}

#modalBody input,
#modalBody select,
#modalBody textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  padding: 12px;
}

#modalBody textarea { resize: vertical; min-height: 90px; }

#modalBody input::placeholder,
#modalBody textarea::placeholder { color: rgba(208, 234, 219, 0.65); }

#modalBody input:focus,
#modalBody select:focus,
#modalBody textarea:focus {
  border-color: rgba(34, 197, 94, 0.75);
  outline: none;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

#modalBody .formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: end;
}

#modalBody .formGrid .full { grid-column: 1 / -1; }
@media (max-width: 900px) { #modalBody .formGrid { grid-template-columns: 1fr; } }

/* ======================= RESPONSIVE ======================= */
@media (max-width: 900px) {
  .hero__grid,
  .grid3,
  .split,
  .modalGrid { grid-template-columns: 1fr; }

  .adminHead { flex-direction: column; align-items: stretch; }
  .adminHead__right { justify-content: flex-start; margin-top: 8px; }
  .modalGallery__main { min-height: 360px; }
}

@media (max-width: 720px) {
  .nav__toggle { display: inline-flex; }

  .nav {
    position: absolute;
    right: 4%;
    top: 64px;
    width: 92%;
    display: none;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(27, 42, 35, 0.97);
    backdrop-filter: blur(10px);
  }

  .nav.nav--open { display: flex; }

  .filters { grid-template-columns: 1fr; }
  .field--right { justify-self: start; }

  .modalThumbs { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 520px) {
  .authBtn { width: 100%; justify-self: stretch; }
}

/* ======================= CATALOGO BREAKPOINTS ======================= */
@media (max-width: 1300px) {
  .products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ✅ móvil: 1 tarjeta por fila (NO tocamos tamaño de imagen) */
@media (max-width: 600px) {
  .products { grid-template-columns: 1fr !important; }
  .product { width: 100%; max-width: 100%; }
}
