*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg-page: #f3f4f6;
  --bg-card: #ffffff;
  --dark-nav: #0f172a;
  --dark-sub: #1e293b;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --green-wsp: #16a34a;
  --green-wsp-hover: #15803d;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
}
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg-page); color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--dark-nav); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 18px; flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.brand { font-size: 1.28rem; font-weight: 900; letter-spacing: 0.5px; white-space: nowrap; color: #fff; }
.brand span { color: var(--accent); }
.search-bar {
  flex: 1 1 380px; max-width: 680px;
  display: flex; background: #fff; border-radius: 8px; overflow: hidden; border: 2px solid transparent;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar select {
  border: none; background: #f3f4f6; color: #111827; padding: 0 10px;
  font-size: 0.82rem; font-weight: 600; border-right: 1px solid #d1d5db; max-width: 155px; cursor: pointer;
}
.search-bar input { flex: 1; border: none; padding: 10px 12px; font-size: 0.92rem; outline: none; min-width: 120px; }
.search-bar button {
  border: none; background: var(--accent); color: #111827; font-weight: 800;
  padding: 0 16px; cursor: pointer; font-size: 0.9rem; white-space: nowrap;
}
.search-bar button:hover { background: var(--accent-hover); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-top {
  background: var(--dark-sub); color: #fff; border: 1px solid #334155;
  padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: 0.84rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-top:hover { border-color: var(--accent); }
#btnInstalarPwa { display: none; }
.cart-badge { background: var(--accent); color: #111827; border-radius: 999px; padding: 1px 7px; font-size: 0.76rem; font-weight: 900; }

.promo-banner-hoy {
  background: linear-gradient(90deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
  color: #f8fafc; padding: 8px 18px; font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-bottom: 2px solid var(--accent);
}
.promo-pill-pulpo { background: var(--accent); color: #0f172a; font-weight: 900; font-size: 0.75rem; padding: 2px 9px; border-radius: 999px; margin-right: 6px; }
.quick-sort-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-sort {
  background: rgba(255,255,255,0.08); color: #e2e8f0; border: 1px solid #475569;
  border-radius: 999px; padding: 4px 11px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.pill-sort:hover { border-color: var(--accent); color: #fff; }
.pill-sort.active { background: var(--accent); color: #0f172a; border-color: var(--accent); font-weight: 900; }

.tags-bar { background: var(--dark-sub); padding: 8px 16px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.tag-chip {
  background: rgba(255,255,255,0.09); color: #f1f5f9; border: 1px solid transparent;
  padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tag-chip:hover, .tag-chip.active { background: var(--accent); color: #0f172a; font-weight: 800; }

.main-wrap { max-width: 1480px; margin: 0 auto; padding: 16px; display: flex; gap: 18px; align-items: flex-start; }
.sidebar-filters {
  width: 250px; flex-shrink: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; display: none; flex-direction: column; gap: 14px;
}
.sidebar-filters.open { display: flex; }
.filter-group-title { font-size: 0.84rem; font-weight: 800; margin-bottom: 8px; color: #1f2937; }
.price-inputs { display: flex; align-items: center; gap: 6px; }
.price-inputs input { width: 100%; padding: 7px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.85rem; }
.checklist { max-height: 310px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.checklist label { font-size: 0.83rem; display: flex; align-items: center; gap: 7px; cursor: pointer; color: #374151; }

.content-area { flex: 1; min-width: 0; }
.toolbar {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-filter-toggle { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 7px; padding: 6px 11px; font-weight: 700; font-size: 0.83rem; cursor: pointer; }
.sort-select { padding: 7px 11px; border-radius: 7px; border: 1px solid #d1d5db; font-weight: 700; font-size: 0.84rem; background: #fff; cursor: pointer; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.product-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,0.09); border-color: #cbd5e1; }
.product-card.card-sin-stock { opacity: 0.62; filter: grayscale(40%); }

.card-img-wrap {
  width: 100%; aspect-ratio: 1 / 1; background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer; border-bottom: 1px solid #f1f5f9; position: relative;
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s; }
.product-card:hover .card-img-wrap img { transform: scale(1.03); }

.badge-oferta-card {
  position: absolute; top: 8px; left: 8px; z-index: 4;
  background: linear-gradient(135deg, #ef4444, #d97706); color: #fff;
  font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}
.badge-agotado {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  background: var(--danger); color: #fff; font-size: 0.69rem; font-weight: 800; padding: 3px 8px; border-radius: 6px;
}

.card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-store { font-size: 0.71rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.card-title {
  font-size: 0.9rem; font-weight: 700; line-height: 1.32; color: var(--text-main);
  cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.38em;
}
.card-title:hover { color: #b45309; }
.card-price-row { margin-top: auto; padding-top: 4px; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.price-old { text-decoration: line-through; color: #9ca3af; font-size: 0.82rem; font-weight: 600; }
.price-now { font-size: 1.22rem; font-weight: 900; color: #b91c1c; }
.card-tax-note { font-size: 0.72rem; color: #059669; font-weight: 700; }
.card-actions { display: flex; gap: 6px; margin-top: 6px; }
.btn-card-cart { flex: 1; background: var(--accent); color: #111827; border: none; border-radius: 8px; padding: 8px; font-weight: 800; font-size: 0.8rem; cursor: pointer; }
.btn-card-cart:hover { background: var(--accent-hover); color: #fff; }
.btn-card-wsp { background: var(--green-wsp); color: #fff; border: none; border-radius: 8px; padding: 8px 10px; font-weight: 800; font-size: 0.8rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.btn-card-wsp:hover { background: var(--green-wsp-hover); }

.reco-section { margin-top: 28px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 14px; padding: 16px; }
.reco-header { font-size: 1.05rem; font-weight: 900; color: #1e3a8a; }
.reco-sub { font-size: 0.83rem; color: #3b82f6; margin: 3px 0 14px; }

.product-view { display: none; }
.product-view.active { display: block; }
.back-bar { margin-bottom: 12px; }
.hero-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.hero-gallery { display: flex; flex-direction: column; gap: 10px; }
.hero-main-img-box {
  position: relative; width: 100%; aspect-ratio: 1 / 1; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
#imgPrincipalDetalle { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(15,23,42,0.72); color: #fff; border: none; width: 36px; height: 36px;
  border-radius: 50%; font-size: 1.05rem; font-weight: 900; cursor: pointer; z-index: 5;
}
.carousel-arrow.prev { left: 8px; }
.carousel-arrow.next { right: 8px; }
.hero-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.hero-thumb { width: 62px; height: 62px; border: 2px solid #e5e7eb; border-radius: 8px; object-fit: contain; cursor: pointer; background: #fff; flex-shrink: 0; }
.hero-thumb.active { border-color: var(--accent); }

.hero-info { display: flex; flex-direction: column; gap: 11px; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-marca { background: #f3f4f6; color: #1f2937; font-size: 0.76rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.chip-cond { background: #dbeafe; color: #1e40af; font-size: 0.76rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.hero-title { font-size: 1.38rem; font-weight: 900; line-height: 1.28; margin: 0; color: #0f172a; }
.hero-sku { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }
.hero-price-box { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.hero-price-big { font-size: 1.75rem; font-weight: 900; color: #b91c1c; }
.pepe-seal-box { background: #f0fdf4; border: 1px solid #86efac; border-radius: 10px; padding: 10px 13px; font-size: 0.84rem; color: #14532d; line-height: 1.4; }
.hero-cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn-buy-now { background: var(--green-wsp); color: #fff; border: none; border-radius: 10px; padding: 12px 18px; font-weight: 900; font-size: 0.94rem; cursor: pointer; flex: 1 1 220px; text-align: center; }
.btn-buy-now:hover { background: var(--green-wsp-hover); }
.btn-add-hero { background: var(--accent); color: #111827; border: none; border-radius: 10px; padding: 12px 18px; font-weight: 900; font-size: 0.94rem; cursor: pointer; flex: 1 1 170px; }
.hero-specs { margin: 4px 0 0; padding-left: 18px; font-size: 0.88rem; color: #374151; line-height: 1.55; }
.faq-pills { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.faq-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 11px; font-size: 0.83rem; }

#lightboxLeviatan { position: fixed; inset: 0; background: rgba(0,0,0,0.93); z-index: 9999; display: none; align-items: center; justify-content: center; cursor: zoom-out; padding: 12px; }
#lightboxLeviatan.open { display: flex; }
#lightboxLeviatan img { max-width: 96vw; max-height: 95vh; object-fit: contain; border-radius: 6px; }

.btn-dark { background: var(--dark-nav); color: #fff; border: none; border-radius: 8px; padding: 9px 12px; font-weight: 800; cursor: pointer; }
.btn-outline { background: #fff; color: #1f2937; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 12px; font-weight: 700; cursor: pointer; }
.btn-outline:hover { background: #f3f4f6; }

.drawer {
  position: fixed; top: 0; right: -420px; width: 100%; max-width: 390px; height: 100vh;
  background: #fff; z-index: 1000; box-shadow: -8px 0 28px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; transition: right 0.24s ease;
}
.drawer.open { right: 0; }
.drawer-header { background: var(--dark-nav); color: #fff; padding: 14px 16px; font-weight: 900; display: flex; justify-content: space-between; align-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cart-item { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #f9fafb; }
.cart-item img { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid #e5e7eb; }
.cart-item-info { flex: 1; min-width: 0; font-size: 0.82rem; }
.cart-qty-btns { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.cart-qty-btns button { width: 24px; height: 24px; border: 1px solid #cbd5e1; background: #fff; border-radius: 5px; font-weight: 800; cursor: pointer; }
.drawer-footer { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; }
.form-input { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 0.86rem; }

@media (max-width: 860px) {
  .main-wrap { flex-direction: column; padding: 10px; }
  .sidebar-filters { width: 100%; }
  .hero-card { grid-template-columns: 1fr; padding: 14px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
}

/* MARCADOR: CARD_SPECS_DISTRITO_V1 */
.select-distrito-top {
  background: #0f172a; color: #fbbf24; border: 1.5px solid #f59e0b;
  border-radius: 999px; padding: 5px 12px; font-size: 0.8rem; font-weight: 800;
  cursor: pointer; outline: none; max-width: 270px;
}
.select-distrito-top option { background: #0f172a; color: #f8fafc; }

.card-specs-list {
  list-style: none; margin: 2px 0 6px; padding: 0;
  font-size: 0.77rem; color: #4b5563; line-height: 1.38;
}
.card-specs-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-specs-list li::before { content: "• "; color: #9ca3af; font-weight: 900; }

.card-price-row {
  margin-top: auto; padding-top: 6px; border-top: 1px solid #f3f4f6;
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap;
}
.card-cond-stock {
  font-size: 0.73rem; font-weight: 800; color: #b91c1c;
  background: #fef2f2; padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}

.card-distrito-total {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a;
  border-radius: 7px; padding: 5px 8px; font-size: 0.74rem; line-height: 1.3; margin-top: 3px;
}
.card-distrito-total span { color: #3b82f6; font-size: 0.7rem; }
.card-distrito-hint {
  background: #fffbeb; border: 1px dashed #fcd34d; color: #92400e;
  border-radius: 7px; padding: 4px 8px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; margin-top: 3px;
}
.card-distrito-hint:hover { background: #fef3c7; }

.btn-card-doc {
  background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 7px 9px; font-size: 0.82rem; cursor: pointer; font-weight: 800;
}
.btn-card-doc:hover { background: #e2e8f0; border-color: #94a3b8; }

.hero-distrito-resumen {
  margin-top: 6px; background: #fff; border: 1px solid #fca5a5;
  border-radius: 8px; padding: 8px 11px; font-size: 0.84rem; color: #1e293b;
}
.hero-total-mano { font-size: 1.08rem; font-weight: 900; color: #15803d; margin-top: 3px; }

.manuales-box-hero {
  background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px;
  padding: 12px 14px; margin-top: 6px;
}
.btn-doc-link {
  display: block; text-decoration: none; background: #fff; color: #0f172a;
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 11px;
  font-size: 0.82rem; transition: 0.15s;
}
.btn-doc-link:hover { border-color: #f59e0b; background: #fffbeb; }
.btn-doc-link.primario { background: #0f172a; color: #fbbf24; border-color: #0f172a; font-weight: 800; }
.btn-doc-link.primario:hover { background: #1e293b; color: #fff; }
.btn-doc-link span { color: #64748b; font-size: 0.75rem; }

.cart-desglose-box {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 8px 10px; font-size: 0.8rem; color: #1e3a8a; display: flex; flex-direction: column; gap: 3px;
}
.cart-desglose-box > div { display: flex; justify-content: space-between; }
.cart-desglose-box.aviso { background: #fffbeb; border-color: #fde68a; color: #92400e; font-weight: 600; }
/* FIN_CARD_SPECS_DISTRITO_V1 */

.badge-multifoto-lev { position:absolute; bottom:8px; right:8px; z-index:4; background:rgba(15,23,42,0.78); color:#f8fafc; font-size:0.69rem; font-weight:800; padding:2px 7px; border-radius:999px; pointer-events:none; }

/* MARCADOR_MOVIL_1COL */
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .product-card { border-radius: 14px; }
  .card-title { font-size: 1.02rem; }
  .card-specs-list { font-size: 0.83rem; }
  .price-now { font-size: 1.35rem; }
  .btn-card-cart, .btn-card-wsp { padding: 11px 12px; font-size: 0.9rem; }
}
/* FIN_MOVIL_1COL */

/* MARCADOR: CART_DRAWER_UX_V2 */
.drawer-header { padding: 11px 15px; font-size: 0.96rem; flex-shrink: 0; }
.drawer-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 10px 12px !important;
  gap: 8px !important;
}
.cart-item { padding: 7px 9px !important; gap: 9px !important; position: relative; }
.cart-item img { width: 50px !important; height: 50px !important; flex-shrink: 0; }
.btn-del-item {
  background: none; border: none; color: #9ca3af; font-size: 0.95rem;
  font-weight: 800; cursor: pointer; padding: 2px 5px; line-height: 1;
}
.btn-del-item:hover { color: #dc2626; }

.drawer-footer {
  flex: 0 0 auto !important;
  padding: 10px 12px 12px !important;
  gap: 7px !important;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.form-compact { padding: 7px 10px !important; font-size: 0.82rem !important; border-radius: 7px !important; }
.comp-selector-wrap { display: flex; flex-direction: column; gap: 6px; }
.comp-pills-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.comp-pill {
  background: #fff; color: #334155; border: 1px solid #cbd5e1;
  border-radius: 7px; padding: 6px 4px; font-size: 0.73rem; font-weight: 700;
  cursor: pointer; text-align: center; white-space: nowrap; transition: 0.15s;
}
.comp-pill:hover { border-color: #94a3b8; }
.comp-pill.active { background: #0f172a; color: #fbbf24; border-color: #0f172a; font-weight: 800; }
.comp-extra-fields { display: flex; flex-direction: column; gap: 5px; }

.cart-total-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 900; font-size: 1.08rem; padding-top: 2px; color: #0f172a;
}
.drawer-footer .btn-buy-now,
.btn-drawer-wsp {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  width: 100%;
  padding: 11px 14px !important;
  font-size: 0.91rem !important;
  border-radius: 9px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.25);
}
/* FIN_CART_DRAWER_UX_V2 */

/* MARCADOR: PRECIO_DORADO_Y_PDF_V1 */
.gold-qty-unlocked {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #92400e !important;
  border: 1.5px solid #f59e0b !important;
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 900 !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.38);
}
.gold-price-unlocked {
  color: #b45309 !important;
  background: linear-gradient(90deg, #fffbeb, #fef3c7);
  border: 1px solid #fcd34d;
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 900 !important;
  display: inline-block;
}
.gold-old-sub {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 5px;
}
.gold-badge-mini {
  display: inline-block;
  font-size: 0.69rem;
  font-weight: 800;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 1px 7px;
  margin-top: 2px;
}
.gold-teaser-mini { font-size: 0.69rem; font-weight: 700; color: #b45309; margin-top: 2px; }
.hero-gold-hint {
  margin-top: 5px;
  background: linear-gradient(90deg, #fffbeb, #fef3c7);
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.79rem;
  font-weight: 700;
}
.cart-gold-saving-row { color: #b45309; font-weight: 800; background: #fffbeb; border-radius: 5px; padding: 2px 5px; }
/* FIN_PRECIO_DORADO_Y_PDF_V1 */
