:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --dark: #101828;
  --muted: #667085;
  --primary: #ff6b00;
  --primary-dark: #e85f00;
  --yellow: #ffce31;
  --green: #12b76a;
  --red: #f04438;
  --border: #e4e7ec;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--dark);
}

button, input, a { font-family: inherit; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; }

.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111827;
  color: white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.top-bar {
  display: grid;
  grid-template-columns: 210px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 28px;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--yellow));
  color: #111827;
  font-weight: 900;
  font-size: 24px;
}
.logo strong { display: block; font-size: 22px; line-height: 18px; }
.logo small { color: #d0d5dd; }

.search-box {
  display: flex;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
}
.search-box:focus-within { border-color: var(--yellow); }
.search-box input {
  flex: 1;
  border: none;
  padding: 14px 16px;
  outline: none;
  font-size: 15px;
}
.search-box button {
  border: none;
  padding: 0 22px;
  background: var(--yellow);
  color: #111827;
  font-weight: 800;
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.admin-link {
  border: 1px solid rgba(255,255,255,0.18);
  padding: 11px 13px;
  border-radius: 14px;
  color: #e4e7ec;
  font-weight: 800;
}
.wallet-pill {
  border: none;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  border-radius: 18px;
  padding: 8px 16px;
  min-width: 150px;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.28);
}
.wallet-pill span { display: block; font-size: 12px; opacity: 0.9; }
.wallet-pill strong { display: block; font-size: 16px; }
.user-pill {
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 900;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-button {
  position: relative;
  border: none;
  background: #ffffff;
  color: #111827;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 21px;
}
.cart-button span {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--red);
  color: white;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}
.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 28px 14px;
}
.category-btn {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: 999px;
  padding: 9px 16px;
  white-space: nowrap;
}
.category-btn.active,
.category-btn:hover { background: var(--primary); border-color: var(--primary); }

main { max-width: 1280px; margin: 0 auto; padding: 26px; }
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  min-height: 360px;
  padding: 38px;
  border-radius: 32px;
  background: radial-gradient(circle at top right, rgba(255,206,49,0.4), transparent 35%), linear-gradient(135deg, #111827, #1f2937);
  color: white;
  overflow: hidden;
}
.hero-content { max-width: 700px; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--yellow);
  font-weight: 800;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.95;
  margin: 22px 0;
  letter-spacing: -2px;
}
.hero p { color: #d0d5dd; font-size: 18px; max-width: 590px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-btn, .secondary-btn { padding: 14px 20px; border-radius: 14px; font-weight: 900; }
.primary-btn { background: var(--primary); color: white; }
.secondary-btn { background: white; color: #111827; }
.hero-card {
  align-self: center;
  justify-self: end;
  max-width: 360px;
  width: 100%;
  border-radius: 28px;
  padding: 28px;
  background: linear-gradient(145deg, #fff, #f2f4f7);
  color: #111827;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}
.hero-card span {
  display: inline-block;
  background: #fee4e2;
  color: #b42318;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 900;
  font-size: 12px;
}
.hero-card h2 { font-size: 34px; margin: 20px 0 10px; }
.hero-card p { color: var(--muted); }

.quick-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.quick-info div, .panel-card, .redeem-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
}
.quick-info strong { display: block; margin-bottom: 6px; }
.quick-info span, .muted { color: var(--muted); }
.section { margin-top: 38px; }
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}
.section-header h2 { margin: 0; font-size: 32px; }
.section-header p { margin: 6px 0 0; color: var(--muted); }
.live-badge { background: #dcfae6; color: #067647; padding: 9px 14px; border-radius: 999px; font-weight: 900; }

.gift-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.gift-card {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 28px;
  padding: 22px;
  background: linear-gradient(135deg, #111827, #344054);
  color: white;
  min-height: 220px;
  box-shadow: var(--shadow);
}
.gift-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -60px;
  top: -60px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
.gift-card span { font-size: 12px; font-weight: 900; color: var(--yellow); }
.gift-card h3 { font-size: 58px; margin: 28px 0 0; }
.gift-card p { margin: 0 0 22px; font-weight: 900; }
.gift-card button {
  position: relative;
  z-index: 1;
  width: 100%;
  border: none;
  background: var(--yellow);
  color: #111827;
  padding: 12px;
  border-radius: 14px;
  font-weight: 900;
}
.gift-card.featured { background: linear-gradient(135deg, var(--primary), #fb923c); }
.gift-card.premium { background: linear-gradient(135deg, #7c3aed, #db2777); }

.redeem-box { margin-top: 18px; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06); }
.redeem-box h3 { margin: 0 0 6px; }
.redeem-box p { color: var(--muted); margin-top: 0; }
#redeemForm { display: flex; gap: 10px; margin-top: 14px; }
#redeemForm input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  outline: none;
  font-size: 15px;
}
#redeemForm button {
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  padding: 0 24px;
  font-weight: 900;
}
#redeemMessage { margin-bottom: 0; font-weight: 800; }

.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: 0.2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-image {
  height: 190px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f2f4f7, #e4e7ec);
  font-size: 54px;
}
.product-info { padding: 16px; }
.product-category { color: var(--primary); font-size: 12px; font-weight: 900; }
.product-info h3 { margin: 8px 0; font-size: 17px; }
.product-meta { color: var(--muted); font-size: 13px; }
.price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.price { font-size: 22px; font-weight: 900; }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.add-btn {
  width: 100%;
  margin-top: 14px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  padding: 13px;
  font-weight: 900;
}
.add-btn:disabled { background: #98a2b3; cursor: not-allowed; }

.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel-title { font-weight: 900; margin-bottom: 14px; }
.compact-list { display: grid; gap: 10px; color: var(--muted); }
.compact-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.compact-row strong { color: var(--dark); }
.positive { color: var(--green); font-weight: 900; }
.negative { color: var(--red); font-weight: 900; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  background: white;
  z-index: 300;
  transition: 0.25s;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px rgba(0,0,0,0.18);
}
.cart-drawer.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 22px; border-bottom: 1px solid var(--border); }
.cart-header button { border: none; background: #f2f4f7; width: 38px; height: 38px; border-radius: 12px; }
.cart-items { flex: 1; overflow-y: auto; padding: 18px; }
.cart-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); padding: 12px 0; }
.cart-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #f2f4f7; }
.cart-item h4 { margin: 0 0 4px; font-size: 14px; }
.cart-item small { color: var(--muted); }
.remove-btn { border: none; color: var(--red); background: transparent; font-weight: 900; }
.cart-footer { padding: 22px; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 18px; }
.checkout-btn { width: 100%; border: none; background: var(--green); color: white; border-radius: 16px; padding: 15px; font-weight: 900; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,24,40,0.45);
  z-index: 250;
  display: none;
}
.overlay.show { display: block; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: white;
  padding: 14px 18px;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 500;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(16,24,40,0.55);
  z-index: 600;
  padding: 20px;
}
.modal.show { display: grid; }
.modal-card {
  width: min(420px, 94vw);
  background: white;
  border-radius: 28px;
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: #f2f4f7;
}
#authForm { display: grid; gap: 10px; margin-top: 18px; }
#authForm input, #authForm select, #authForm textarea {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  outline: none;
}
#authForm button {
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  padding: 14px;
  font-weight: 900;
}
.switch-auth {
  width: 100%;
  margin-top: 10px;
  background: #f2f4f7;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-weight: 900;
}
.switch-auth.danger { color: var(--red); }
.hidden { display: none !important; }
.demo-login {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #fffaeb;
  color: #93370d;
  font-size: 13px;
}
.empty-state { grid-column: 1 / -1; background: white; padding: 24px; border-radius: 22px; border: 1px solid var(--border); }

@media (max-width: 1080px) {
  .top-bar { grid-template-columns: 1fr auto; }
  .search-box { grid-column: 1 / -1; }
  .hero { grid-template-columns: 1fr; }
  .hero-card { justify-self: start; transform: none; }
  .gift-grid, .products-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-info, .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .top-bar { padding: 12px; gap: 12px; }
  .logo strong { font-size: 18px; }
  .wallet-pill { min-width: 120px; padding: 7px 10px; }
  .user-pill { padding: 12px; max-width: 100px; }
  main { padding: 14px; }
  .hero { padding: 24px; border-radius: 24px; }
  .hero h1 { font-size: 38px; }
  .gift-grid, .products-grid { grid-template-columns: 1fr; }
  .section-header { align-items: start; flex-direction: column; }
  #redeemForm { flex-direction: column; }
  #redeemForm button { padding: 14px; }
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 10px 0 0;
  min-height: 36px;
}

.location-pill {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: 18px;
  padding: 8px 14px;
  min-width: 160px;
  display: grid;
  text-align: left;
  gap: 2px;
}

.location-pill strong {
  font-size: 14px;
  line-height: 16px;
}

.location-pill small {
  color: #d0d5dd;
  font-size: 11px;
  margin-left: 20px;
}

.show-all-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  color: var(--dark);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

.show-all-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.availability-note {
  margin-top: 10px;
  font-size: 12px;
  color: #067647;
  background: #dcfae6;
  border-radius: 12px;
  padding: 8px 10px;
  line-height: 1.35;
}

.availability-note.warning {
  color: #93370d;
  background: #fffaeb;
}

.product-img,
.cart-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-img {
  border-radius: 14px;
}

#authForm select {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  outline: none;
  background: white;
}

@media (max-width: 640px) {
  .location-pill {
    min-width: 120px;
    padding: 7px 10px;
  }

  .location-pill small {
    display: none;
  }

  .show-all-toggle {
    width: 100%;
    justify-content: center;
    border-radius: 16px;
  }
}

.location-pill {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: 18px;
  padding: 8px 12px;
  min-width: 150px;
  text-align: left;
}
.location-pill strong { display: block; font-size: 13px; }
.location-pill small { display: block; color: #d0d5dd; font-size: 11px; }
.notice-box {
  background: #fffaeb;
  color: #93370d;
  border: 1px solid #fedf89;
  border-radius: 14px;
  padding: 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.account-grid.wide { grid-template-columns: 1fr 1fr; }
.order-panel { grid-column: 1 / -1; }
.profile-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.profile-form input,
.profile-form select,
#authForm select {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  outline: none;
  background: white;
}
.profile-form button {
  grid-column: 1 / -1;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  padding: 14px;
  font-weight: 900;
}
.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-btn {
  width: 100%;
  margin-top: 14px;
  border: none;
  background: #f2f4f7;
  color: #111827;
  border-radius: 14px;
  padding: 13px;
  font-weight: 900;
}
.product-modal-card { width: min(840px, 96vw); }
.product-detail-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}
.product-detail-main-img {
  min-height: 320px;
  border-radius: 24px;
  background: #f2f4f7;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 78px;
}
.product-detail-main-img img,
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.gallery-row img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.delivery-chip, .status-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  background: #eef4ff;
  color: #3538cd;
  margin: 4px 4px 0 0;
}
.status-chip.pending_seller { background: #fffaeb; color: #93370d; }
.status-chip.awaiting_client_shipping { background: #fef3c7; color: #92400e; }
.status-chip.preparing { background: #dbeafe; color: #1d4ed8; }
.status-chip.seller_delivered { background: #ede9fe; color: #6d28d9; }
.status-chip.completed { background: #dcfae6; color: #067647; }
.status-chip.refunded, .status-chip.cancelled { background: #fee4e2; color: #b42318; }
.order-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #fcfcfd;
  display: grid;
  gap: 10px;
}
.order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.order-items { color: var(--muted); font-size: 13px; }
.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.order-actions input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.order-actions button {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  background: var(--primary);
  color: white;
}
.code-box {
  background: #111827;
  color: white;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 900;
  display: inline-block;
}
@media (max-width: 860px) {
  .product-detail-grid, .account-grid.wide, .profile-form { grid-template-columns: 1fr; }
}

.client-report-chat {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #fffaeb;
  display: grid;
  gap: 10px;
}
.chat-thread {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  background: rgba(255,255,255,0.75);
  border-radius: 14px;
  padding: 10px;
}
.chat-message {
  border-radius: 14px;
  padding: 9px 10px;
  background: white;
  border: 1px solid var(--border);
}
.chat-message.from-admin { background: #eef4ff; border-color: #c7d7fe; }
.chat-message p { margin: 4px 0; }
.chat-message small { color: var(--muted); }
.report-reply-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.report-reply-row input {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.report-reply-row button {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  background: var(--primary);
  color: white;
}
.status-chip.delivery_disputed { background: #fee4e2; color: #b42318; }

.promoted-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 280px);
  gap: 16px;
  overflow-x: auto;
  padding: 6px 2px 18px;
  scroll-snap-type: x mandatory;
}
.promoted-row .product-card {
  scroll-snap-align: start;
}
.promo-label {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fffaeb;
  color: #93370d;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}
.product-card.promoted-card {
  border-color: #fedf89;
  box-shadow: 0 14px 35px rgba(255, 107, 0, 0.12);
}

/* V5.4 mejoras: referidos, verificación, variantes y PWA móvil */
.seller-rating { color: #f59e0b; font-size: 12px; font-weight: 900; margin: 6px 0; }
.variant-picker-label { display: grid; gap: 8px; margin: 14px 0; font-weight: 900; }
.variant-picker-label select, .verify-row input { border: 1px solid var(--border); border-radius: 14px; padding: 13px; }
.verify-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.secondary-small { border: none; background: #f2f4f7; color: var(--dark); border-radius: 14px; padding: 12px; font-weight: 900; }
.status-ok, .status-warn { display: inline-flex; padding: 8px 12px; border-radius: 999px; font-weight: 900; margin-bottom: 10px; }
.status-ok { background: #dcfae6; color: #067647; }
.status-warn { background: #fffaeb; color: #93370d; }
.referral-box { display: grid; gap: 12px; }
.referral-box > div { border: 1px solid var(--border); background: #fcfcfd; border-radius: 16px; padding: 12px; }
.referral-box span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.referral-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.referral-actions button { border: none; background: var(--primary); color: white; border-radius: 14px; padding: 12px 14px; font-weight: 900; }
.referral-sticker { position: fixed; right: 18px; top: 45%; z-index: 220; width: 190px; border: none; text-align: left; border-radius: 22px; padding: 16px 38px 16px 16px; color: #111827; background: linear-gradient(135deg, #ffce31, #ff6b00); box-shadow: var(--shadow); }
.referral-sticker strong { display: block; font-size: 18px; }
.referral-sticker span { display: block; font-size: 13px; margin: 6px 0; }
.referral-sticker small { font-weight: 900; }
.referral-sticker button { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: none; border-radius: 999px; background: rgba(255,255,255,0.55); font-weight: 900; }
.mobile-bottom-nav { display: none; }
@media (max-width: 760px) {
  .referral-sticker { right: 10px; top: auto; bottom: 76px; width: 165px; }
  .verify-row { grid-template-columns: 1fr; }
  .mobile-bottom-nav { display: grid; grid-template-columns: repeat(4,1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 250; background: white; border-top: 1px solid var(--border); box-shadow: 0 -10px 25px rgba(16,24,40,0.08); }
  .mobile-bottom-nav a { text-align: center; padding: 12px 6px; font-size: 12px; font-weight: 900; color: var(--dark); }
  body { padding-bottom: 58px; }
}

.optional-profile-box,
.profile-preferences {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fcfcfd;
}
.optional-profile-box label,
.check-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--dark);
  font-weight: 800;
}
.variant-builder-client {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fcfcfd;
}
.variant-option-group {
  margin-top: 12px;
}
.variant-option-group span {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}
.variant-option-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.variant-option-group button {
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 800;
}
.variant-option-group button.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.variant-result {
  margin-top: 12px;
  padding: 11px;
  border-radius: 14px;
  background: #fffaeb;
  color: #93370d;
  font-weight: 800;
}
.product-detail-grid .add-btn:disabled {
  background: #98a2b3;
  cursor: not-allowed;
}


/* V5.6 - Ajustes fuertes para móvil */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.main-header,
.top-bar,
.category-nav,
main,
.products-grid,
.product-card {
  max-width: 100%;
}

@media (max-width: 760px) {
  .main-header {
    overflow: hidden;
  }

  .top-bar {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
    padding: 10px 12px 8px;
  }

  .logo {
    width: fit-content;
  }

  .logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 24px;
  }

  .logo strong {
    font-size: 19px;
    line-height: 18px;
  }

  .logo small {
    font-size: 15px;
  }

  .search-box {
    order: 2;
    grid-column: auto;
    width: 100%;
    min-width: 0;
    border-radius: 16px;
  }

  .search-box input {
    min-width: 0;
    width: 100%;
    padding: 13px 12px;
    font-size: 14px;
  }

  .search-box button {
    flex: 0 0 88px;
    padding: 0 10px;
    font-size: 14px;
  }

  .header-actions {
    order: 3;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) auto auto;
    gap: 8px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
  }

  .location-pill,
  .wallet-pill,
  .user-pill,
  .cart-button {
    height: 52px;
    min-width: 0;
  }

  .location-pill {
    width: 100%;
    padding: 7px 9px;
    border-radius: 16px;
    overflow: hidden;
  }

  .location-pill strong {
    max-width: 100%;
    font-size: 12px;
    line-height: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .location-pill small {
    display: block;
    margin-left: 0;
    font-size: 10px;
    line-height: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wallet-pill {
    width: 100%;
    padding: 7px 8px;
    border-radius: 16px;
  }

  .wallet-pill span {
    font-size: 11px;
  }

  .wallet-pill strong {
    font-size: 14px;
    line-height: 16px;
  }

  .user-pill {
    width: 72px;
    max-width: 72px;
    padding: 0 8px;
    border-radius: 16px;
    font-size: 13px;
  }

  .cart-button {
    width: 52px;
    border-radius: 16px;
    font-size: 20px;
  }

  .category-nav {
    width: 100%;
    gap: 8px;
    padding: 0 12px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-nav::-webkit-scrollbar {
    display: none;
  }

  .category-btn {
    flex: 0 0 auto;
    padding: 9px 14px;
    font-size: 14px;
    border-radius: 999px;
  }

  main {
    width: 100%;
    padding: 12px;
  }

  .hero {
    min-height: auto;
    padding: 22px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: 34px;
    letter-spacing: -1px;
  }

  .hero p {
    font-size: 15px;
  }

  .quick-info {
    gap: 10px;
  }

  .section {
    margin-top: 28px;
  }

  .section-header h2 {
    font-size: 30px;
    line-height: 1;
  }

  .section-header p {
    font-size: 15px;
  }

  .show-all-toggle {
    width: 100%;
    justify-content: flex-start;
    padding: 13px 16px;
    border-radius: 18px;
  }

  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
  }

  .product-card {
    min-width: 0;
    border-radius: 18px;
  }

  .product-card:hover {
    transform: none;
  }

  .product-image {
    height: 128px;
    font-size: 34px;
  }

  .product-info {
    padding: 10px;
  }

  .promo-label,
  .product-category,
  .seller-rating,
  .product-meta,
  .product-description,
  .availability-note {
    font-size: 10px;
  }

  .product-info h3 {
    font-size: 13px;
    line-height: 1.18;
    margin: 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 31px;
  }

  .product-meta {
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .price-row {
    margin-top: 8px;
  }

  .price {
    font-size: 17px;
    line-height: 1.05;
  }

  .old-price {
    font-size: 11px;
  }

  .delivery-chip,
  .status-chip {
    font-size: 10px;
    padding: 5px 8px;
  }

  .product-actions {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .detail-btn,
  .add-btn {
    margin-top: 8px;
    padding: 10px 8px;
    border-radius: 12px;
    font-size: 12px;
  }

  .promoted-row {
    grid-auto-columns: minmax(156px, 172px);
    gap: 12px;
    padding-bottom: 12px;
  }

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

  .gift-card {
    min-height: 170px;
    border-radius: 22px;
    padding: 16px;
  }

  .gift-card h3 {
    font-size: 42px;
    margin-top: 20px;
  }

  .gift-card button {
    font-size: 12px;
  }

  .modal {
    padding: 10px;
  }

  .modal-card,
  .product-modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 22px;
    padding: 18px;
  }

  .product-detail-main-img {
    min-height: 230px;
  }

  .cart-drawer {
    width: 100%;
    max-width: 100vw;
    right: -100%;
  }

  .referral-sticker {
    right: 10px;
    bottom: 72px;
    width: 156px;
    padding: 12px 34px 12px 12px;
    border-radius: 18px;
  }

  .referral-sticker strong {
    font-size: 15px;
  }

  .referral-sticker span {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .top-bar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .header-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) 62px 46px;
    gap: 6px;
  }

  .user-pill {
    width: 62px;
    max-width: 62px;
    font-size: 12px;
  }

  .cart-button {
    width: 46px;
  }

  .wallet-pill strong {
    font-size: 13px;
  }

  .location-pill strong {
    font-size: 11px;
  }

  .products-grid {
    gap: 10px;
  }

  .product-image {
    height: 116px;
  }

  .product-info {
    padding: 9px;
  }

  .price {
    font-size: 16px;
  }
}


/* V5.7 - Correcciones de cuenta separada, panel móvil y detalle de producto */
.account-page-main {
  max-width: 1180px;
}
.account-hero {
  min-height: 220px;
  border-radius: 32px;
  padding: 34px;
  background: radial-gradient(circle at top right, rgba(255,206,49,0.35), transparent 35%), linear-gradient(135deg, #111827, #1f2937);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: end;
}
.account-hero span {
  width: fit-content;
  color: var(--yellow);
  background: rgba(255,255,255,0.1);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
}
.account-hero h1 {
  margin: 18px 0 10px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 0.95;
  letter-spacing: -2px;
}
.account-hero p { margin: 0; color: #d0d5dd; }
.account-actions { justify-content: end; }
.user-pill.danger { color: #fecaca; }
.location-pill strong::before { content: none !important; }
.product-detail-grid .product-actions { margin-top: 14px; }
.product-detail-grid .add-btn { margin-top: 0; }
.variant-helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .main-header { overflow: visible; }
  .header-actions {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) auto auto;
  }
  .header-actions .admin-link:not(.hidden) {
    display: flex !important;
    grid-column: 1 / -1;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    color: white;
    font-weight: 900;
  }
  .account-top-bar {
    grid-template-columns: 1fr;
  }
  .account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .account-actions .wallet-pill,
  .account-actions .user-pill,
  .account-actions .admin-link {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .account-actions .wallet-pill {
    display: grid;
  }
  .account-hero {
    border-radius: 24px;
    min-height: 180px;
    padding: 24px;
  }
  .account-hero h1 { font-size: 42px; }
  .product-actions {
    grid-template-columns: 1fr 1fr;
  }
  .modal.show {
    display: grid !important;
  }
  .product-modal-card {
    width: min(100%, 96vw) !important;
    max-height: 90dvh;
    overflow-y: auto;
  }
  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .product-detail-main-img {
    min-height: 210px;
  }
}

/* Receipt page */
.receipt-body { background: #f5f6fa; }
.receipt-page { max-width: 900px; padding: 22px; margin: 0 auto; }
.receipt-card { background: #fff; border: 1px solid var(--border); border-radius: 28px; padding: 26px; box-shadow: var(--shadow); }
.receipt-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 18px; }
.receipt-brand { display: flex; gap: 12px; align-items: center; }
.receipt-brand strong { display: block; font-size: 22px; }
.receipt-brand small { color: var(--muted); }
.receipt-status { display: inline-flex; padding: 8px 12px; border-radius: 999px; background: #f2f4f7; font-weight: 900; color: var(--dark); }
.receipt-status.available { background: #dcfae6; color: #067647; }
.receipt-status.used { background: #dbeafe; color: #1d4ed8; }
.receipt-status.cancelled, .receipt-status.expired { background: #fee4e2; color: #b42318; }
.receipt-number { color: var(--muted); margin-bottom: 14px; }
.receipt-code-box { border-radius: 22px; background: linear-gradient(135deg, #111827, #344054); color: white; padding: 22px; text-align: center; margin-bottom: 18px; }
.receipt-code-box span { display: block; opacity: 0.82; font-size: 13px; font-weight: 800; }
.receipt-code-box strong { display: block; font-size: clamp(24px, 5vw, 40px); letter-spacing: 1px; margin-top: 8px; word-break: break-word; }
.receipt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.receipt-grid div { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: #fcfcfd; }
.receipt-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.receipt-grid strong { display: block; }
.receipt-note, .receipt-disclaimer { margin-top: 16px; border-radius: 16px; padding: 14px; }
.receipt-note { background: #fffaeb; color: #93370d; }
.receipt-disclaimer { background: #f2f4f7; color: var(--muted); font-size: 13px; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.receipt-actions .copy-btn { display: inline-flex; align-items: center; justify-content: center; }
.receipt-row { align-items: center; }
@media (max-width: 640px) {
  .receipt-card { padding: 16px; border-radius: 22px; }
  .receipt-head { align-items: start; flex-direction: column; }
  .receipt-grid { grid-template-columns: 1fr; }
  .receipt-actions { display: grid; }
}
@media print {
  .no-print, .mobile-bottom-nav, .main-header { display: none !important; }
  body { background: white !important; }
  .receipt-page { padding: 0; }
  .receipt-card { box-shadow: none; border: none; }
}

.form-error { background: #fee4e2; color: #b42318; border: 1px solid #fda29b; border-radius: 12px; padding: 10px 12px; font-weight: 800; }
.field-error { color: #b42318; font-weight: 800; margin-top: -4px; display: block; }
.input-error { border-color: #f04438 !important; box-shadow: 0 0 0 3px rgba(240,68,56,.10); }
.seller-register-fields { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: #fff7ed; }
.seller-register-fields textarea { border: 1px solid var(--border); border-radius: 14px; padding: 14px; outline: none; resize: vertical; }
.seller-responsibility { display: flex; gap: 10px; align-items: start; font-size: 13px; font-weight: 800; color: #7c2d12; }
.simple-header .top-bar { grid-template-columns: 1fr auto; }
.recharge-top-bar .header-actions { justify-content: end; }
.light-title { min-height: 220px; margin-top: 20px; }
.standalone-redeem { max-width: 760px; margin-inline: auto; }
.compact-section { margin-top: 24px; }
@media (max-width: 720px) {
  .simple-header .top-bar { grid-template-columns: 1fr; }
  .recharge-top-bar .header-actions { justify-content: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .recharge-top-bar .wallet-pill { width: 100%; }
}

/* V5.10: productos nuevos y filtro */
.product-card { position: relative; }
.new-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 4px;
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
  margin-right: 6px;
  margin-bottom: 6px;
}
.products-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 640px) {
  .products-filter-actions { justify-content: flex-start; width: 100%; }
}

/* === CUBAX V5.11: barra promocional principal y variantes individuales === */
.main-ad-banner {
  max-width: 1280px;
  margin: 14px auto 0;
  padding: 0 26px;
}
.main-ad-banner a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  align-items: center;
  padding: 13px 18px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #0b67ff, #10a7ff);
  box-shadow: 0 14px 28px rgba(11, 103, 255, 0.18);
}
.main-ad-banner strong { font-size: 18px; font-weight: 950; }
.main-ad-banner span { color: rgba(255,255,255,.88); }
.main-ad-banner em {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-style: normal;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  white-space: nowrap;
}
.variant-option-group button:disabled,
.variant-option-group button.unavailable {
  opacity: .38;
  cursor: not-allowed;
  text-decoration: line-through;
}
.ad-plans-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.ad-plan-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.06);
}
.ad-plan-card strong {
  display: inline-block;
  color: white;
  background: linear-gradient(135deg, #0b67ff, #10a7ff);
  padding: 8px 12px;
  border-radius: 999px;
}
.ad-plan-card h3 { margin: 14px 0 8px; }
.ad-plan-card p { color: var(--muted); min-height: 54px; }
.ad-plan-card span { font-weight: 900; color: var(--primary); }
.ad-request-form,
.ad-banner-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ad-request-form label,
.ad-banner-form label { display: grid; gap: 6px; font-weight: 900; }
.ad-request-form input,
.ad-request-form select,
.ad-banner-form input,
.ad-banner-form select {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  background: white;
}
.ad-request-form .full-field,
.ad-banner-form .full-field,
.ad-request-form button,
.ad-banner-form button { grid-column: 1 / -1; }
.form-message { margin-top: 12px; font-weight: 900; }
.form-message.success { color: var(--green); }
.form-message.error { color: var(--red); }
@media (max-width: 820px) {
  .main-ad-banner { padding: 0 14px; }
  .main-ad-banner a { grid-template-columns: 1fr; }
  .main-ad-banner em { grid-column: auto; grid-row: auto; width: fit-content; }
  .ad-plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-request-form,
  .ad-banner-form { grid-template-columns: 1fr; }
}
.receipt-body{background:#f5f6fa}.receipt-page{max-width:900px;margin:0 auto;padding:28px}.receipt-card{background:#fff;border:1px solid var(--border);border-radius:28px;padding:26px;box-shadow:var(--shadow)}.receipt-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;border-bottom:1px solid var(--border);padding-bottom:18px;margin-bottom:18px}.receipt-head span{color:var(--primary);font-weight:900}.receipt-head h1{margin:6px 0}.receipt-head strong{font-size:28px}.receipt-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:18px 0}.receipt-grid div{border:1px solid var(--border);border-radius:16px;padding:14px;background:#fcfcfd}.receipt-grid span{display:block;color:var(--muted);font-size:12px;font-weight:900}.receipt-grid strong{display:block;margin-top:4px}.receipt-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.receipt-actions button,.receipt-actions a{border:0;border-radius:14px;padding:12px 14px;background:var(--primary);color:white;font-weight:900}.file-label{display:grid;gap:8px;border:1px solid var(--border);border-radius:14px;padding:12px;background:#fff}@media(max-width:640px){.receipt-grid{grid-template-columns:1fr}.receipt-head{flex-direction:column}.receipt-page{padding:14px}}

/* V5.14 multi-currency and digital products */
.free-shipping-badge,
.digital-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.free-shipping-badge { background: #dcfae6; color: #067647; }
.digital-badge { background: #e0f2fe; color: #075985; }
.cart-payment-select {
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
  font-weight: 900;
}
.cart-payment-select select {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: white;
}
.cup-equivalent {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 10px;
  color: rgba(255,255,255,0.9);
  font-weight: 800;
}
.cup-private-box {
  border: 1px solid #d0d5dd;
  background: #f9fafb;
  border-radius: 18px;
  padding: 14px;
}


/* =========================================================
   CUBAX V5.15 - Galería de producto, imágenes más grandes
   y formularios de cuenta más limpios para PC y móvil
   ========================================================= */

/* Más espacio visual para imágenes en la página principal */
.product-image {
  height: 238px;
}
.promoted-row .product-image,
.promoted-card .product-image {
  height: 210px;
}

/* Mantener texto legible sin tapar la imagen completa */
.product-info h3,
.product-name {
  display: block;
  width: 100%;
  margin: 8px 0 8px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(255,255,255,0.96);
  color: #101828;
  font-weight: 900;
  line-height: 1.25;
  box-shadow: 0 6px 16px rgba(16,24,40,.12);
}
.price,
.product-price {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 7px 10px;
  border-radius: 13px;
  background: rgba(255,247,237,.98);
  color: #c2410c;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(16,24,40,.10);
}

/* Galería del detalle de producto */
.product-gallery {
  display: grid;
  gap: 10px;
}
.gallery-main {
  position: relative;
  min-height: 380px;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2f4f7;
  display: block;
}
.product-detail-empty-img span {
  font-size: 78px;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(17,24,39,.82);
  color: white;
  font-size: 30px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(16,24,40,.22);
  z-index: 3;
}
.gallery-arrow-left { left: 12px; }
.gallery-arrow-right { right: 12px; }
.gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(17,24,39,.82);
  color: white;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}
.gallery-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.gallery-thumb {
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 0;
  background: #fff;
  overflow: hidden;
}
.gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,0,.14);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Registro/login profesional: más ancho en PC, scroll interno y botón accesible */
@media (min-width: 761px) {
  #authModal .modal-card {
    width: min(940px, calc(100vw - 56px));
    max-height: calc(100dvh - 56px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #authForm {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  #authForm .seller-register-fields,
  #authForm .optional-profile-box,
  #authForm .form-error,
  #authForm > small,
  #authSubmit {
    grid-column: 1 / -1;
  }
  #authSubmit {
    position: sticky;
    bottom: 0;
    z-index: 4;
    box-shadow: 0 -10px 24px rgba(255,255,255,.96);
  }
  .seller-register-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .seller-register-fields > strong,
  .seller-register-fields > small,
  .seller-register-fields textarea,
  .seller-responsibility,
  .driver-form-note,
  .driver-license-help {
    grid-column: 1 / -1;
  }
}
.driver-form-note {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .product-image {
    height: 168px;
  }
  .promoted-row .product-image,
  .promoted-card .product-image {
    height: 156px;
  }
  .gallery-main {
    min-height: 300px;
  }
  .gallery-arrow {
    width: 38px;
    height: 38px;
    font-size: 27px;
  }
  .gallery-thumb {
    width: 62px;
    height: 62px;
    border-radius: 14px;
  }
  #authModal .modal-card {
    width: min(96vw, 460px);
    max-height: 92dvh;
    overflow-y: auto;
  }
  #authForm {
    grid-template-columns: 1fr;
  }
  .seller-register-fields {
    gap: 9px;
  }
}

@media (max-width: 380px) {
  .product-image {
    height: 152px;
  }
  .gallery-main {
    min-height: 260px;
  }
}


/* CUBAX V5.16 - entrega múltiple + ofertas dinámicas */
.dynamic-deals-section .section-header h2 { color: #b42318; }
.dynamic-deals-row, .promoted-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 240px); gap: 14px; overflow-x: auto; padding: 6px 2px 14px; scroll-snap-type: x proximity; }
.dynamic-deal-card { border-color: rgba(244, 63, 94, .28); box-shadow: 0 14px 32px rgba(180, 35, 24, .12); }
.discount-badge, .dynamic-label { display: inline-flex; width: fit-content; align-items: center; margin: 4px 5px 4px 0; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.discount-badge { background: #fee4e2; color: #b42318; }
.dynamic-label { background: #fffaeb; color: #93370d; }
.dynamic-detail-note { margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: #fff4e5; border: 1px solid #fedf89; color: #93370d; font-size: 13px; line-height: 1.35; }
.delivery-choice-box { display: grid; gap: 8px; margin: 14px 0; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: #f9fafb; }
.delivery-choice-box label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1px solid #edf0f3; font-weight: 800; }
.delivery-options-panel, .dynamic-pricing-panel { border: 1px solid var(--border); border-radius: 18px; padding: 14px; background: #fcfcfd; display: grid; gap: 10px; }
.delivery-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.delivery-option-grid label { display: flex; gap: 8px; align-items: center; padding: 10px; border: 1px solid #edf0f3; border-radius: 12px; background: #fff; font-weight: 800; }
.dynamic-pricing-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.muted-disabled { opacity: .55; }
@media (max-width: 640px) { .dynamic-deals-row, .promoted-row { grid-auto-columns: minmax(165px, 180px); gap: 10px; } .delivery-option-grid, .dynamic-pricing-fields { grid-template-columns: 1fr; } }

/* =========================================================
   CUBAX Market V5.17 - Reviews reales y carrito siempre visible
   ========================================================= */
.floating-cart-button {
  position: fixed;
  right: 18px;
  top: 92px;
  z-index: 240;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 18px;
  background: #111827;
  color: #ffffff;
  font-size: 24px;
  box-shadow: 0 16px 34px rgba(16, 24, 40, 0.28);
  display: grid;
  place-items: center;
}
.floating-cart-button span {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 23px;
  height: 23px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 12px;
  font-weight: 900;
}
.review-box {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #fffbeb;
  border: 1px solid #fedf89;
}
.review-box strong { color: #92400e; }
.review-line {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
}
.review-line select,
.review-box textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: white;
  outline: none;
}
.review-box button {
  width: fit-content;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  font-weight: 900;
}
.review-summary-ok {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #dcfae6;
  color: #067647;
  font-weight: 800;
  font-size: 13px;
}
.seller-rating {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
}
@media (max-width: 640px) {
  .floating-cart-button {
    top: auto;
    right: 14px;
    bottom: 18px;
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }
  .review-box { padding: 10px; }
  .review-box button { width: 100%; }
  .seller-rating { font-size: 10px; padding: 4px 7px; }
}


/* =========================================================
   CUBAX Market V5.18 - Inicio móvil compacto + carrito visible
   ========================================================= */
.hero-compact {
  min-height: 220px;
  padding: 24px 26px;
  grid-template-columns: 1.2fr .72fr;
  gap: 18px;
  border-radius: 26px;
}
.hero-compact .hero-badge {
  padding: 6px 11px;
  font-size: 12px;
}
.hero-compact h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.02;
  margin: 14px 0 10px;
  letter-spacing: -1.2px;
}
.hero-compact p {
  font-size: 15px;
  line-height: 1.35;
  max-width: 520px;
}
.hero-compact .hero-actions {
  margin-top: 16px;
  gap: 10px;
}
.hero-compact .primary-btn,
.hero-compact .secondary-btn {
  padding: 11px 16px;
  border-radius: 13px;
  font-size: 14px;
}
.hero-card-mini {
  max-width: 260px;
  padding: 18px;
  border-radius: 22px;
  transform: rotate(1deg);
}
.hero-card-mini h2 {
  font-size: 24px;
  line-height: 1.05;
  margin: 12px 0 8px;
}
.hero-card-mini p { font-size: 13px; line-height: 1.3; }
.quick-info-compact {
  gap: 12px;
  margin: 14px 0 12px;
}
.quick-info-compact div {
  padding: 12px 14px;
  border-radius: 17px;
}
.quick-info-compact strong {
  margin-bottom: 3px;
  font-size: 14px;
}
.quick-info-compact span {
  font-size: 13px;
  line-height: 1.25;
}

@media (max-width: 640px) {
  main { padding-top: 12px; }
  .main-ad-banner { margin-bottom: 10px; }
  .hero-compact {
    display: block;
    min-height: 0;
    padding: 16px 18px;
    border-radius: 22px;
  }
  .hero-compact .hero-badge {
    font-size: 11px;
    padding: 5px 9px;
  }
  .hero-compact h1 {
    font-size: 28px;
    line-height: 1.02;
    margin: 10px 0 7px;
    letter-spacing: -0.8px;
  }
  .hero-compact p {
    font-size: 13px;
    line-height: 1.3;
    margin: 0;
  }
  .hero-compact .hero-actions {
    margin-top: 12px;
  }
  .hero-compact .primary-btn,
  .hero-compact .secondary-btn {
    padding: 10px 13px;
    font-size: 13px;
    border-radius: 12px;
  }
  .hero-card-mini {
    display: none;
  }
  .quick-info-compact {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 7px;
    margin: 10px 0 12px;
  }
  .quick-info-compact div {
    padding: 8px 7px;
    border-radius: 13px;
  }
  .quick-info-compact strong {
    font-size: 11px;
    line-height: 1.1;
    margin-bottom: 2px;
  }
  .quick-info-compact span {
    display: none;
  }
  .floating-cart-button {
    right: 14px;
    bottom: 86px;
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }
}

/* =========================================================
   CUBAX Market V5.19 - carrito con bajada de precio y favoritos
   ========================================================= */
.price-drop-notice {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #dcfae6;
  color: #067647;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.seller-favorite-label {
  display: inline-flex;
  width: fit-content;
  margin: 4px 4px 4px 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #3538cd;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.favorite-seller-btn {
  margin: 8px 0 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: #eef4ff;
  color: #3538cd;
  font-weight: 900;
  cursor: pointer;
}
.favorite-seller-btn:hover {
  filter: brightness(0.97);
}
.notification-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e4e7ec;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}
.notification-row.unread {
  border-color: #ffce31;
  background: #fffbeb;
}
.notification-row p {
  margin: 4px 0;
  color: #475467;
}
.notification-row button {
  align-self: center;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  background: #111827;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}
@media (max-width: 640px) {
  .price-drop-notice { font-size: 10px; padding: 5px 7px; }
  .favorite-seller-btn { width: 100%; }
  .notification-row { flex-direction: column; padding: 10px; }
  .notification-row button { width: 100%; }
}
