:root {
  --primary: #0b3d63;
  --primary-light: #12588f;
  --primary-hover: #082d4a;
  --accent-green: #1e8a5f;
  --accent-green-hover: #166948;
  --accent-red: #d32f2f;
  --accent-orange: #e65100;
  --bg-page: #f4f7fa;
  --bg-card: #ffffff;
  --bg-surface: #eef3f8;
  --border-color: #dbe3eb;
  --border-focus: #12588f;
  --text-main: #1a2734;
  --text-muted: #5e7184;
  --text-light: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px;
}

/* Header */
.top-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

header {
  background: linear-gradient(135deg, var(--primary) 0%, #0d4b7a 100%);
  color: var(--text-light);
  padding: 6px 14px;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-box {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.logo-box img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.header-titles h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin: 0;
  line-height: 1.15;
}

.header-titles p {
  font-size: 0.72rem;
  opacity: 0.9;
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-wa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 18px;
  transition: transform 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn-header-wa:hover {
  background: #20ba5a;
  transform: translateY(-1px);
}

.btn-bancos-header {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 5px 10px;
  border-radius: 18px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-bancos-header:hover {
  background: rgba(255,255,255,0.25);
}

/* Announcement Bar */
.announcement-bar {
  background: #fff8e1;
  color: #8d6e00;
  text-align: center;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 1px solid #ffe082;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Search and Filters */
.search-filter-panel {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 6px 14px;
}

.search-container {
  max-width: 1300px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 6px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

#searchInput {
  width: 100%;
  padding: 7px 34px 7px 36px;
  font-size: 0.88rem;
  border: 1.5px solid #b8d2eb;
  background-color: #f6faff;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#searchInput:focus {
  border-color: var(--primary-light);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(18, 88, 143, 0.15);
}

#clearSearchBtn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  border: none;
  color: #475569;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Chips / Categories */
.filter-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.filter-chip {
  padding: 4px 11px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: #e2ecf7;
  color: var(--primary-light);
  border-color: #b8d2eb;
}

.filter-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.filter-chip.chip-oferta {
  color: var(--accent-red);
  background: #ffebee;
  border-color: #ffcdd2;
}

.filter-chip.chip-oferta.active {
  background: var(--accent-red);
  color: #ffffff;
  border-color: var(--accent-red);
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Product Grid */
.main-wrapper {
  max-width: 1300px;
  margin: 10px auto;
  padding: 0 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #b0c6dc;
}

.product-card.in-cart {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(30, 138, 95, 0.25);
}

.product-badge-container {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.badge-oferta {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: #ffffff;
}

.badge-nuevo {
  background: linear-gradient(135deg, #1e8a5f, #0f5c3c);
  color: #ffffff;
}

.badge-iva {
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(211, 47, 47, 0.35);
}

.zoom-iva-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.cart-iva-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0 4px;
  border-radius: 4px;
  margin-left: 4px;
}

.card-img-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  border-bottom: 1px solid #edf2f7;
}

.card-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  transition: transform 0.25s ease;
}

.card-img-box:hover img {
  transform: scale(1.05);
}

.zoom-hint {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card-img-box:hover .zoom-hint {
  opacity: 1;
}

/* Card Body */
.card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-brand {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-code {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  min-height: 38px;
}

.card-presentation {
  font-size: 0.76rem;
  color: #4a5d6e;
  background: #f1f5f9;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Price Box - PRECIO POR UNIDAD RESALTADO */
.card-price-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.price-unit-highlight-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.price-unit-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #065f46;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.price-unit-badge::before {
  content: "🏷️";
  font-size: 0.72rem;
}

.price-unit-units-tag {
  font-size: 0.67rem;
  font-weight: 700;
  color: #047857;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #a7f3d0;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.price-unit-val-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-unit-amount {
  font-size: 1.35rem;
  font-weight: 900;
  color: #065f46;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.price-unit-unit-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #047857;
}

.price-bulto-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #475569;
  padding: 2px 2px 0 2px;
  border-top: 1px dashed #e2e8f0;
}

.price-bulto-sublabel {
  font-weight: 600;
  color: #64748b;
}

.price-bulto-subval {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--primary);
}

/* Bultos Order Stepper */
.bulto-control-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  padding: 4px 0;
}

.bulto-control-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.bulto-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bulto-stepper:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(18, 88, 143, 0.15);
}

.bulto-stepper .qty-btn {
  background: #f1f5f9;
  border: none;
  color: var(--text-main);
  width: 28px;
  height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.15s ease;
}

.bulto-stepper .qty-btn:hover {
  background: #e2e8f0;
}

.bulto-stepper .qty-btn:active {
  background: #cbd5e1;
}

.bulto-stepper .qty-input {
  width: 44px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  outline: none;
  background: transparent;
  -moz-appearance: textfield;
}

.bulto-stepper .qty-input::-webkit-outer-spin-button,
.bulto-stepper .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Fractions Section */
.fractions-section {
  margin-top: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fractions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.fractions-title {
  font-weight: 700;
  color: #334155;
}

.fractions-limit-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 1px 6px;
  border-radius: 10px;
}

.fractions-chips-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fraction-pill {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
  text-align: left;
}

.fraction-pill:hover {
  border-color: var(--primary-light);
  background: #f0f7ff;
  color: var(--primary);
}

.fraction-pill.active {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #1b5e20;
  box-shadow: 0 1px 3px rgba(46, 125, 50, 0.2);
}

.fraction-pill-info {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.2;
}

.fraction-pill-name {
  font-weight: 800;
  color: inherit;
}

.frac-code-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(11, 61, 99, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 3px;
  vertical-align: middle;
  letter-spacing: 0.2px;
}

.fraction-pill.active .frac-code-badge {
  background: rgba(27, 94, 32, 0.15);
  color: #1b5e20;
}

.fraction-pill-meta {
  font-size: 0.68rem;
  opacity: 0.85;
}

.fraction-pill-price-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fraction-pill-price {
  font-weight: 800;
  font-size: 0.75rem;
}

.fraction-pill-status {
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 6px;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}

.fraction-pill.active .fraction-pill-status {
  background: #2e7d32;
  color: #ffffff;
}

.fraction-pill-stepper {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 3px;
  border: 1px solid #cbd5e1;
}

.fraction-pill.active .fraction-pill-stepper {
  background: #dcfce7;
  border-color: #86efac;
}

.frac-mini-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.frac-mini-btn:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.frac-mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.frac-stepper-val {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
  min-width: 26px;
  text-align: center;
}

.no-fractions-msg {
  font-size: 0.72rem;
  color: #64748b;
  font-style: italic;
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Add to Order Controls */
.card-action-row {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  width: 90px;
}

.qty-btn {
  background: #f1f5f9;
  border: none;
  color: var(--text-main);
  width: 26px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: #e2e8f0;
}

.qty-input {
  width: 38px;
  height: 34px;
  border: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  outline: none;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-add-cart {
  flex: 1;
  min-height: 36px;
  background: var(--primary-light);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-add-cart:hover {
  background: var(--primary);
}

.btn-add-cart:active {
  transform: scale(0.98);
}

.btn-add-cart.added {
  background: var(--accent-green);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: #94a3b8;
}

/* Bottom Floating Order Bar */
.floating-order-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: #ffffff;
  padding: 12px 20px;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: space-between;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.floating-summary {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.floating-units {
  font-size: 0.9rem;
  opacity: 0.9;
}

.floating-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: #69f0ae;
}

.floating-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-view-order {
  background: var(--accent-green);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.15s ease;
}

.btn-view-order:hover {
  background: var(--accent-green-hover);
}

.btn-clear-cart {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-cart:hover {
  background: rgba(255,255,255,0.15);
  border-color: #ffffff;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 41, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background: var(--primary);
  color: #ffffff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  padding: 4px;
}

.btn-close-modal:hover {
  opacity: 1;
}

.modal-body {
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cart items list */
.cart-items-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-item-row {
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.cart-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  object-fit: contain;
  background: #f8fafc;
  flex-shrink: 0;
}

.cart-item-text {
  min-width: 0;
}

.cart-item-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cart-item-subtotal {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 65px;
  text-align: right;
}

.cart-item-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.cart-tag-bultos {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 7px;
  border-radius: 4px;
}

.cart-tag-fraction {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cart-tag-fraction:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.cart-tag-fraction-remove {
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}

.cart-tag-fraction-add {
  font-size: 0.7rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px dashed #cbd5e1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cart-tag-fraction-add:hover {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #38bdf8;
}

.cart-tag-fraction.multi-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}

.cart-tag-fraction.multi-step:hover {
  background: #e8f5e9;
  border-color: #c8e6c9;
  color: #1b5e20;
}

.modal-frac-btns {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}

.modal-frac-btn {
  background: #ffffff;
  border: 1px solid #86efac;
  color: #14532d;
  width: 19px;
  height: 19px;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.15s ease;
}

.modal-frac-btn:hover:not(:disabled) {
  background: #bbf7d0;
}

.modal-frac-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.modal-frac-btn.remove {
  color: #dc2626;
  border-color: #fca5a5;
  margin-left: 2px;
}

.modal-frac-btn.remove:hover {
  background: #fee2e2;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  border-radius: 4px;
}

.btn-remove-item:hover {
  background: #fee2e2;
}

/* Customer Inputs */
.customer-fields-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.customer-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-fields-box h3 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.customer-branch-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.2px;
}

/* Branch & Code Row */
.client-id-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

@media (max-width: 520px) {
  .client-id-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.branch-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.branch-toggle-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: all 0.15s ease;
}

.branch-toggle-btn:hover {
  border-color: var(--primary-light);
  background: #f1f5f9;
}

.branch-toggle-btn.active {
  background: #0b3d63;
  border-color: #0b3d63;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(11, 61, 99, 0.25);
}

.branch-tag-code {
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.branch-tag-city {
  font-size: 0.68rem;
  opacity: 0.85;
}

.branch-toggle-btn.active .branch-tag-city {
  color: #93c5fd;
}

/* Code Input Wrapper with Prefix */
.code-input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.code-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(11, 61, 99, 0.15);
}

.code-prefix-badge {
  background: #f1f5f9;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 9px 10px;
  border-right: 1.5px solid #cbd5e1;
  user-select: none;
}

#clientCodeInput {
  border: none;
  border-radius: 0;
  padding: 9px 10px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #1e293b;
  flex: 1;
  min-width: 0;
}

#clientCodeInput::placeholder {
  color: #94a3b8;
  letter-spacing: 2px;
  font-weight: 500;
}

.btn-clear-code {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.btn-clear-code:hover {
  color: #ef4444;
}

/* Lookup Feedback Banner */
.client-lookup-feedback {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.15s ease;
}

.client-lookup-feedback.success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
}

.client-lookup-feedback.not-found {
  background: #fef3c7;
  border: 1px solid #fde047;
  color: #b45309;
}

.client-lookup-feedback.invalid {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

/* Auto fill tag in label */
.auto-fill-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #16a34a;
  background: #dcfce7;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

.input-group {
  margin-bottom: 10px;
}

.input-group label {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(18, 88, 143, 0.15);
}

/* Order Totals Box */
.order-totals-box {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-totals-box .label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.order-totals-box .amount {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-green);
}

.order-notes-disclaimer {
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
  font-style: italic;
}

/* Modal Footer */
.modal-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  padding: 14px 20px;
  display: flex;
  justify-content: center;
}

.modal-footer.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-action {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  transition: all 0.15s ease;
}

.btn-download-txt {
  background: #ffffff;
  color: #0b3d63;
  border: 1.5px solid #0b3d63;
  box-shadow: 0 2px 6px rgba(11, 61, 99, 0.1);
  white-space: nowrap;
  flex: 0 0 auto;
}

.btn-download-txt:hover {
  background: #f0f7ff;
  border-color: #082942;
  color: #082942;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(11, 61, 99, 0.18);
}

.btn-download-txt:active {
  transform: translateY(0);
}

.btn-send-whatsapp {
  background: #25d366;
  color: #ffffff;
  flex: 1;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
}

.btn-send-whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}

.btn-send-whatsapp:active {
  transform: translateY(0);
}

@media (max-width: 560px) {
  .modal-footer.modal-footer-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .btn-download-txt, .btn-send-whatsapp {
    width: 100%;
  }
}

.cart-tag-total-units {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  margin-left: 2px;
}

/* Bank Accounts Modal */
.bank-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bank-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bank-card-header {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bank-acc-num {
  font-family: monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.5px;
  background: #ffffff;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-copy {
  background: transparent;
  border: none;
  color: var(--primary-light);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-copy:hover {
  text-decoration: underline;
}

/* Zoom Lightbox */
.zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(5px);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.zoom-content-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 16px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  text-align: center;
}

.zoom-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.zoom-content-box img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.zoom-product-info {
  margin-top: 12px;
  text-align: left;
}

.zoom-product-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.zoom-product-price {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary);
  margin-top: 4px;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .card-body {
    padding: 8px 10px;
  }
  .card-title {
    font-size: 0.8rem;
    min-height: 34px;
  }
  .price-value-unit {
    font-size: 1rem;
  }
  .qty-control {
    width: 75px;
  }
  .qty-btn {
    width: 22px;
    height: 30px;
  }
  .qty-input {
    width: 31px;
    height: 30px;
    font-size: 0.85rem;
  }
  .btn-add-cart {
    font-size: 0.75rem;
  }
  .bank-cards-grid {
    grid-template-columns: 1fr;
  }
  .header-actions .btn-header-wa span {
    display: none;
  }
  .header-actions .btn-header-wa {
    padding: 8px;
    border-radius: 50%;
  }
  .floating-order-bar {
    padding: 10px 14px;
  }
  .floating-total {
    font-size: 1.1rem;
  }
  .btn-view-order {
    padding: 9px 14px;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .logo-box img {
    height: 36px;
  }
  .header-titles h1 {
    font-size: 1.05rem;
  }
  .header-titles p {
    font-size: 0.72rem;
  }
}
