:root {
  --bg: #0b0f14;
  --bg2: #121826;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --muted2: rgba(255, 255, 255, 0.55);
  --brand: #ff5a1f;
  --brand2: #ff8c42;
  --ok: #31d0aa;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius2: 14px;
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html.no-scroll,
html.no-scroll body {
  overflow: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 20% 0%, rgba(255, 90, 31, 0.26), transparent 70%),
    radial-gradient(920px 520px at 85% 0%, rgba(49, 208, 170, 0.16), transparent 68%),
    radial-gradient(1200px 620px at 20% 100%, rgba(255, 90, 31, 0.18), transparent 72%),
    radial-gradient(920px 520px at 85% 100%, rgba(49, 208, 170, 0.12), transparent 72%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

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

.shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  justify-self: start;
}

.topbar-title {
  justify-self: center;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.03em;
  font-size: 18px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tag {
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  justify-self: end;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
}

.ghost-btn,
.primary-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.primary-btn {
  border-color: rgba(255, 90, 31, 0.58);
  background: linear-gradient(180deg, rgba(255, 90, 31, 0.96), rgba(255, 90, 31, 0.72));
  box-shadow: 0 14px 35px rgba(255, 90, 31, 0.24);
}

.primary-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 140, 66, 0.8);
}

.back {
  margin-right: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-weight: 700;
}

.back:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 26px;
  flex: 1;
}

.hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.14), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy h1 {
  margin: 2px 0 4px;
  font-size: 32px;
  letter-spacing: 0.01em;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.35;
}

.hero-badge {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-badge-inner {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(49, 208, 170, 0.25);
  background: radial-gradient(120px 80px at 30% 20%, rgba(49, 208, 170, 0.22), rgba(255, 255, 255, 0.03));
  padding: 14px 16px;
}

.hero-badge-title {
  font-weight: 900;
  letter-spacing: 0.02em;
}

.hero-badge-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.searchbar {
  margin-top: 14px;
}

.searchbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.searchbar-row > input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
}

.clear-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.pager {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  width: 18px;
  height: 12px;
  display: inline-block;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  opacity: 0.9;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input[type="search"],
select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  outline: none;
}

input[type="search"]:focus,
select:focus {
  border-color: rgba(255, 140, 66, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.12);
}

.status {
  color: var(--muted);
  font-weight: 700;
}

.spacer {
  flex: 1;
}

.grid-inner {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: grid;
  grid-template-rows: 170px auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.32);
  transition: transform 140ms ease, border-color 140ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 90, 31, 0.34);
}

.card-media {
  background:
    radial-gradient(160px 120px at 20% 20%, rgba(255, 90, 31, 0.22), transparent 60%),
    radial-gradient(180px 120px at 80% 20%, rgba(49, 208, 170, 0.12), transparent 60%),
    rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img {
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.card-ph {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 14px;
}

.card-body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 88px;
}

.card-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  line-height: 1.15;
  min-width: 0;
}

.card-code {
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.card-desc {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  max-height: calc(2 * 1.15em);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-bottom {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.price-prefix {
  font-weight: 900;
  color: rgba(255, 255, 255, 0.82);
}

.price-int {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--brand2);
}

.price-dec {
  font-size: 12px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.68);
}

.footer {
  padding: 16px 18px 18px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  color: var(--muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 90, 31, 0.9);
  box-shadow: 0 0 0 5px rgba(255, 90, 31, 0.18);
}

.footer-link {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 800;
}

.footer-link:hover {
  color: rgba(255, 255, 255, 0.95);
}

/* Mobile drawer (subcategorías) */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 88vw);
  background: rgba(10, 14, 20, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  padding: 14px;
  overflow: auto;
  transform: translateX(100%);
  transition: transform 160ms ease;
}

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

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  font-weight: 900;
  letter-spacing: 0.03em;
}

.drawer-close {
  padding: 8px 12px;
}

.drawer-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.drawer-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 90, 31, 0.32);
  background: rgba(255, 255, 255, 0.05);
}

.drawer-item.active {
  border-color: rgba(255, 140, 66, 0.78);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.12);
}

.drawer-item-count {
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.82);
}

/* Product detail */
.product {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.gallery {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.gallery-hero {
  position: relative;
  height: 420px;
  background:
    radial-gradient(220px 160px at 30% 20%, rgba(255, 90, 31, 0.18), transparent 60%),
    radial-gradient(220px 160px at 80% 20%, rgba(49, 208, 170, 0.10), transparent 60%),
    rgba(0, 0, 0, 0.22);
}

.gallery-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 18px;
}

.gallery-hero-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
}

.ph-title {
  font-weight: 900;
}

.ph-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.gallery-thumbs {
  /* Fixed-size thumbs centered; avoids "offset" feel when images count < N */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.thumb-btn {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  height: 62px;
  width: 62px;
  flex: 0 0 62px;
  transition: transform 120ms ease, border-color 120ms ease;
}

.thumb-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 90, 31, 0.26);
}

.thumb-btn.active {
  border-color: rgba(255, 140, 66, 0.75);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.12);
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.product-header {
  padding: 4px 2px 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-header h1 {
  margin: 10px 0 6px;
  font-size: 28px;
  letter-spacing: 0.01em;
  line-height: 1.08;
}

.product-code {
  font-weight: 900;
  color: rgba(255, 255, 255, 0.72);
}

.buybox {
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.10), rgba(255, 255, 255, 0.03));
  padding: 14px;
}

.buybox-price {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.price-label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price-big {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--brand2);
}

.wa-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
}

.muted {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.panel-body {
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.45;
}

.attrs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.attr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.10);
}

.attr:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.attr-k {
  color: rgba(255, 255, 255, 0.70);
  font-weight: 900;
}

.attr-v {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  text-align: right;
}

@media (max-width: 980px) {
  .grid-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product {
    grid-template-columns: 1fr;
  }
  .gallery-hero {
    height: 360px;
  }
}

@media (max-width: 640px) {
  .topbar {
    /* Keep title visually centered regardless of left/right widths */
    grid-template-columns: 1fr auto 1fr;
  }
  .brand-text {
    display: none;
  }
  .topbar-title {
    font-size: 16px;
  }
  .menu-btn span:last-child {
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .grid-inner {
    grid-template-columns: 1fr;
  }
  .thumb-btn {
    height: 56px;
    width: 56px;
    flex-basis: 56px;
  }
  .price-big {
    font-size: 32px;
  }
}
