/* © 2026 Koizumi Electronics — Catálogo App Mode. */
:root {
  --catalog-app-height: 100dvh;
  --catalog-bg: #0b5260;
  --catalog-bg-2: #128395;
  --catalog-panel: rgba(10, 39, 49, 0.72);
  --catalog-line: rgba(207, 250, 252, 0.22);
  --catalog-text: rgba(248, 253, 255, 0.95);
  --catalog-muted: rgba(226, 242, 246, 0.74);
  --catalog-blue: #5ed8ea;
  --catalog-orange: #e1a04d;
  --catalog-green: #6ed5a3;
  --catalog-radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  min-height: var(--catalog-app-height, 100vh);
  color: var(--catalog-text);
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(94, 216, 234, 0.12), transparent 32%),
    radial-gradient(circle at 86% 80%, rgba(225, 160, 77, 0.11), transparent 34%),
    linear-gradient(135deg, var(--catalog-bg), var(--catalog-bg-2));
}
a, button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
body.catalog-modal-open { overflow: hidden; }

header, main, .suggestions, footer { width: min(1180px, calc(100vw - 24px)); margin-inline: auto; }
header { height: 70px; display: grid; align-items: center; }
.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(120px, 0.7fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--catalog-line);
  border-radius: 16px;
  background: rgba(8, 31, 41, 0.54);
  backdrop-filter: blur(14px);
}
.toolbar input, .toolbar select {
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(207, 250, 252, 0.18);
  border-radius: 10px;
  color: var(--catalog-text);
  background: rgba(5, 25, 34, 0.72);
  padding: 0 10px;
  outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: rgba(94, 216, 234, 0.72); }

main {
  height: calc(var(--catalog-app-height) - 70px - 116px - 38px);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 0.88fr) auto minmax(0, 1.12fr);
  gap: 8px;
  overflow: hidden;
}
.featured-hero, .dynamic-content, .external-section-shell, .suggestion-shell {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--catalog-line);
  border-radius: var(--catalog-radius);
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(8,31,41,.42)), var(--catalog-panel);
  box-shadow: 0 18px 38px rgba(0, 12, 18, 0.18);
}
.featured-hero { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 12px; }
.featured-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
h1, h2 { margin: 0; font-family: "Teko", "Bebas Neue", sans-serif; text-transform: uppercase; letter-spacing: .04em; line-height: .9; }
h1 { font-size: clamp(1.85rem, 4vw, 3.1rem); }
h1 span, h2 span { color: var(--catalog-blue); }
h2 { font-size: clamp(1.55rem, 3vw, 2.4rem); }
.summary { min-height: 30px; display: flex; align-items: center; justify-content: center; color: var(--catalog-muted); font-size: .82rem; font-weight: 850; }
.featured-grid, .suggestion-grid, .dynamic-content, .dynamic-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.dynamic-content, .dynamic-grid { position: relative; padding: 10px; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.product-card { min-width: 0; min-height: 0; }
.product-hit {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(54px, 0.38fr) minmax(0, 0.62fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(207, 250, 252, 0.15);
  border-radius: 14px;
  color: var(--catalog-text);
  background: rgba(255,255,255,.055);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.product-hit:hover, .product-hit:focus-visible { border-color: rgba(94, 216, 234, 0.58); outline: none; }
.product-img { min-width: 0; min-height: 0; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.88); overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: contain; }
.product-copy { min-width: 0; display: grid; align-content: center; gap: 3px; }
.product-copy small { color: var(--catalog-orange); font-size: .66rem; font-weight: 900; text-transform: uppercase; }
.product-copy strong { color: #fff; font-size: clamp(.78rem, 1.35vw, .98rem); line-height: 1.08; }
.product-copy em { color: var(--catalog-muted); font-size: .68rem; line-height: 1.18; font-style: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.product-copy b { color: var(--catalog-green); font-size: .78rem; }
.empty { display: grid; place-items: center; color: var(--catalog-muted); font-weight: 850; }
.empty[hidden] { display: none !important; }
.suggestions { height: 86px; margin-block: 8px; }
.suggestion-shell { height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px; }
.suggestion-head { display: grid; place-items: center start; min-width: 120px; }
.suggestion-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.suggestion-grid .product-copy em, .suggestion-grid .product-copy small { display: none; }
.suggestion-grid .product-hit { grid-template-columns: 44px minmax(0,1fr); padding: 6px; }
footer { height: 30px; display: grid; place-items: center; color: var(--catalog-muted); font-size: .72rem; }
footer p { margin: 0; }

.catalog-pager {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.catalog-arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(207,250,252,.28);
  border-radius: 50%;
  color: #fff;
  background: rgba(6, 28, 38, 0.82);
  pointer-events: auto;
  cursor: pointer;
}
.catalog-arrow[hidden] { visibility: hidden; display: grid !important; }
.catalog-arrow svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.catalog-arrow--prev svg { transform: rotate(180deg); }

.external-body { padding: 12px; }
.external-page { width: min(1120px, 100%); height: calc(var(--catalog-app-height) - 24px); margin: 0 auto; display: grid; overflow: hidden; }
.page-shell { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; overflow: hidden; }
.home-link { color: var(--catalog-text); text-decoration: none; font-weight: 900; }
.external-section-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 12px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.section-heading p { margin: 4px 0 0; color: var(--catalog-muted); font-size: .82rem; }
.section-chip { flex: 0 0 auto; border: 1px solid var(--catalog-line); border-radius: 999px; padding: 6px 10px; color: var(--catalog-blue); font-weight: 900; font-size: .72rem; }

.modal-layer { position: fixed; inset: 0; z-index: 190; background: rgba(0, 10, 16, 0.58); backdrop-filter: blur(8px); }
.modal-layer[hidden] { display: none !important; }
.catalog-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 14px; background: rgba(0,0,0,.16); }
.catalog-modal-card {
  width: min(760px, 96vw);
  max-height: min(620px, calc(var(--catalog-app-height) - 28px));
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(160px, .42fr) minmax(0, .58fr);
  gap: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--catalog-line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(20, 66, 76, 0.98), rgba(6, 28, 38, 0.98));
  padding: 14px;
}
.catalog-modal-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 34px; height: 34px; border: 1px solid var(--catalog-line); border-radius: 50%; color: #fff; background: rgba(0,0,0,.22); cursor: pointer; }
.catalog-modal-media { min-height: 0; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.92); overflow: hidden; }
.catalog-modal-media img { width: 100%; height: 100%; object-fit: contain; }
.catalog-modal-copy { min-width: 0; min-height: 0; display: grid; align-content: center; gap: 8px; padding-right: 34px; }
.catalog-modal-copy span { color: var(--catalog-orange); font-weight: 950; font-size: .72rem; text-transform: uppercase; }
.catalog-modal-copy h2 { color: #fff; }
.catalog-modal-copy p { margin: 0; color: var(--catalog-muted); font-size: .86rem; line-height: 1.32; }
.catalog-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.catalog-spec-grid b { display: grid; gap: 2px; padding: 8px; border: 1px solid rgba(207,250,252,.12); border-radius: 10px; color: var(--catalog-blue); font-size: .68rem; text-transform: uppercase; }
.catalog-spec-grid em { color: var(--catalog-text); font-style: normal; font-size: .72rem; line-height: 1.18; text-transform: none; }
.catalog-modal-price { color: var(--catalog-green); font-size: 1.16rem; }
.catalog-whatsapp { min-height: 38px; display: inline-grid; place-items: center; justify-self: start; padding: 0 14px; border-radius: 999px; color: #002b1b; background: var(--catalog-green); font-weight: 950; text-decoration: none; }

@media (max-width: 900px) {
  header { height: 118px; }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { height: calc(var(--catalog-app-height) - 118px - 88px - 28px); grid-template-rows: minmax(0, .78fr) auto minmax(0, 1.22fr); }
  .featured-grid, .dynamic-content, .dynamic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suggestions { height: 72px; }
  .suggestion-shell { grid-template-columns: 1fr; }
  .suggestion-head { display: none; }
  .suggestion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suggestion-grid .product-card:nth-child(n+3) { display: none; }
  footer { height: 24px; }
}

@media (max-width: 520px) {
  header, main, .suggestions, footer { width: calc(100vw - 16px); }
  header { height: 158px; }
  .toolbar { grid-template-columns: 1fr; gap: 6px; padding: 8px; }
  .toolbar input, .toolbar select { height: 25px; font-size: .76rem; }
  main { height: calc(var(--catalog-app-height) - 158px - 8px); grid-template-rows: auto minmax(0, 1fr); gap: 6px; }
  .featured-hero, .suggestions, footer { display: none; }
  .summary { min-height: 24px; font-size: .74rem; }
  .dynamic-content, .dynamic-grid { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px; }
  .product-hit { grid-template-columns: 58px minmax(0,1fr); padding: 6px; }
  .product-copy small { font-size: .62rem; }
  .product-copy strong { font-size: .82rem; }
  .product-copy em { font-size: .64rem; -webkit-line-clamp: 1; }
  .catalog-modal-card { grid-template-columns: 1fr; grid-template-rows: minmax(120px, .42fr) minmax(0, .58fr); gap: 8px; padding: 10px; }
  .catalog-modal-copy { gap: 5px; padding-right: 0; }
  .catalog-modal-copy p { font-size: .72rem; }
  .catalog-spec-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .catalog-spec-grid b { padding: 5px; font-size: .62rem; }
  .catalog-spec-grid em { font-size: .62rem; }
  .external-body { padding: 8px; }
  .external-page { height: calc(var(--catalog-app-height) - 16px); }
  .section-heading { align-items: start; }
  .section-heading p { display: none; }
}

@media (orientation: landscape) and (max-height: 520px) {
  header { height: 54px; }
  .toolbar { grid-template-columns: minmax(160px, 1.2fr) repeat(4, minmax(108px, .7fr)); padding: 7px; }
  .toolbar input, .toolbar select { height: 30px; font-size: .72rem; }
  main { height: calc(var(--catalog-app-height) - 54px - 28px); grid-template-rows: auto minmax(0,1fr); }
  .featured-hero, .suggestions, footer { display: none; }
  .dynamic-content, .dynamic-grid { grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(0,1fr)); padding: 7px; }
  .product-hit { grid-template-columns: 48px minmax(0,1fr); padding: 5px; }
  .product-copy em, .product-copy small { display: none; }
  .catalog-modal-card { max-height: calc(var(--catalog-app-height) - 16px); }
}
