/* ============================================================
   ELECTRICIDAD ANGELONI — Design System
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Colors */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-soft: #dbeafe;
  --accent: #10b981;
  --accent-dark: #059669;
  --accent-light: #ecfdf5;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;

  /* Neutrals */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-subtle: #fafbfc;
  --border: #e5e7eb;
  --border-light: #f1f5f9;

  /* Shadows - refined for crispness */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.03);
  --shadow-md: 0 4px 12px -2px rgba(15,23,42,0.08), 0 2px 4px -2px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 24px -6px rgba(15,23,42,0.1), 0 4px 8px -4px rgba(15,23,42,0.05);
  --shadow-xl: 0 24px 48px -12px rgba(15,23,42,0.18), 0 8px 16px -8px rgba(15,23,42,0.08);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,0.12);

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Base Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  background-image:
    radial-gradient(at 20% 0%, rgba(37,99,235,0.04) 0px, transparent 50%),
    radial-gradient(at 80% 100%, rgba(16,185,129,0.03) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---------- Navbar ---------- */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(229,231,235,0.7);
  padding: 0.65rem 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
}
.main-nav.scrolled {
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.nav-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 1280px;
  margin: 0 auto;
  gap: 0.55rem;
}

/* Logo centrado, botón de menú a la derecha */
.nav-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-logo img {
  height: 64px;
  width: auto;
  display: block;
  transition: opacity var(--transition);
}
.nav-logo img:hover { opacity: 0.8; }

/* Botón ☰ (visible solo en móvil) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.05rem;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.nav-toggle.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Fila 2: opciones individuales en fila */
.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  border-top: 1px solid var(--border-light);
  padding-top: 0.6rem;
}

.nav-welcome {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Buttons ---------- */
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-nav--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-nav--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn-nav--accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-nav--accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-nav--danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}
.btn-nav--danger:hover {
  background: var(--danger-light);
  color: var(--danger-dark);
}

.btn-nav--ghost {
  border-color: transparent;
  background: transparent;
}
.btn-nav--ghost:hover {
  background: var(--bg-surface);
  border-color: var(--border);
}

/* Large action buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.btn-action:hover { transform: translateY(-1px); }
.btn-action:active { transform: translateY(0); }

.btn-action--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-action--primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  color: #fff;
}

.btn-action--accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.btn-action--accent:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
  color: #fff;
}

.btn-action--danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn-action--danger:hover {
  background: var(--danger-light);
  color: var(--danger-dark);
}

.btn-action--outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-action--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-action--wa {
  background: #25d366;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,211,102,0.3);
}
.btn-action--wa:hover {
  background: #1ebe57;
  box-shadow: 0 4px 12px rgba(37,211,102,0.4);
  color: #fff;
}

.btn-action--full { width: 100%; }

.btn-action:disabled,
.btn-action[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Small icon-only button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}
.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-icon--danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

/* ---------- Cards ---------- */
.card-modern {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
}
.card-modern:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-modern--no-hover:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

/* ---------- Product Cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 0 1rem;
}

.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(37,99,235,0.18);
}

.product-card__image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg-subtle) 100%);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: zoom-in;
}
.product-card__image::before {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 50%, transparent);
}
.product-card__image img {
  max-width: 85%;
  max-height: 85%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform var(--transition-slow);
  filter: drop-shadow(0 4px 8px rgba(15,23,42,0.05));
}
.product-card:hover .product-card__image img { transform: scale(1.06); }

.product-card__body {
  padding: 0.95rem 1.1rem 0.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.45em;
  text-transform: none;
  word-break: break-word;
}

.product-card__price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.15rem 0 0.35rem;
  letter-spacing: -0.01em;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.1rem 0.95rem;
  margin-top: auto;
  gap: 0.5rem;
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
}
.badge-stock--ok {
  background: rgba(16, 185, 129, 0.10);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}
.badge-stock--out {
  background: rgba(239, 68, 68, 0.10);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
}

/* ---------- Cart Button (circular) ---------- */
.btn-cart-add {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: white;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-bounce), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 2px 6px rgba(37,99,235,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  outline: none;
  flex-shrink: 0;
}
.btn-cart-add:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 8px 18px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
}
.btn-cart-add:active {
  transform: translateY(0) scale(1);
}
.btn-cart-add.added {
  animation: cartPulse 0.5s ease;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 3px 10px rgba(16,185,129,0.35);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(239,68,68,0.3);
  animation: badgePop 0.4s cubic-bezier(0.68,-0.55,0.265,1.55);
}

/* Nav cart badge (total items) */
.nav-cart-badge {
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

/* ---------- Badges / Pills ---------- */
.badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all var(--transition);
}
.badge-cat::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.product-card:hover .badge-cat {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary-soft);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-status--open {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.badge-status--closed {
  background: var(--bg-surface);
  color: var(--text-muted);
}
.badge-status--ready {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.badge-status--canceled {
  background: var(--danger-light);
  color: var(--danger-dark);
}
.badge-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.badge-status--open .badge-status__dot     { background: var(--accent); }
.badge-status--closed .badge-status__dot   { background: var(--text-muted); }
.badge-status--ready .badge-status__dot    { background: var(--primary); }
.badge-status--canceled .badge-status__dot { background: var(--danger); }

/* ---------- Search / Filter Bar ---------- */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0.85rem 1rem;
  margin: 1.25rem 1rem 1rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(180%);
}

.search-group {
  position: relative;
}
.search-group__icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
  pointer-events: none;
  transition: color var(--transition);
}
.search-group__input {
  width: 100%;
  padding: 0.7rem 0.95rem 0.7rem 2.55rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-subtle);
  transition: all var(--transition);
}
.search-group__input::placeholder { color: var(--text-muted); }
.search-group__input:hover { border-color: #cbd5e1; background: var(--bg-card); }
.search-group__input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-focus);
}
.search-group:focus-within .search-group__icon { color: var(--primary); }

.filter-select {
  padding: 0.7rem 2.25rem 0.7rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-subtle);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}
.filter-select:hover { border-color: #cbd5e1; background-color: var(--bg-card); }
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-focus);
}

/* ---------- Tables ---------- */
.table-modern {
  width: 100%;
  border-collapse: collapse;
}
.table-modern thead th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
}
.table-modern tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--text-primary);
  vertical-align: middle;
}
.table-modern tbody tr {
  transition: background var(--transition);
}
.table-modern tbody tr:hover {
  background: var(--primary-light);
}
.table-modern tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Pagination ---------- */
.pagination-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem;
  list-style: none;
  margin: 2rem auto 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}
.pagination-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.page-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.page-btn--active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.page-btn--active:hover {
  background: var(--primary-dark);
  color: #fff;
}
.page-btn--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Forms ---------- */
.form-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 480px;
  margin: 1rem auto;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}
.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.75rem;
  margin: 0 auto 1.25rem;
}
.empty-state__title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}
.empty-state__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* ---------- Image Modal ---------- */
.img-modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}
.img-modal--open { display: flex; }

.img-modal__content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-xl);
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUp 0.25s ease;
}
.img-modal__content img {
  max-width: 400px;
  max-height: 65vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  margin-bottom: 0.75rem;
}
.img-modal__title {
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  text-align: center;
}
.img-modal__close {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.45rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.img-modal__close:hover {
  background: var(--primary-dark);
}

/* ---------- Lead Modal (Solicitar lista de precios) ---------- */
.lead-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.lead-modal--open { display: flex; animation: fadeIn 0.2s ease; }

.lead-modal__card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: slideUp 0.25s ease;
}
.lead-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.lead-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.3;
}
.lead-modal__title i { color: var(--accent); }
.lead-modal__close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}
.lead-modal__close:hover { color: var(--text-primary); }
.lead-modal__intro {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 1.1rem;
}
.lead-field { margin-bottom: 0.85rem; }
.lead-field textarea.form-input { resize: vertical; min-height: 70px; }
.lead-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}
.lead-actions .btn-action { flex: 1 1 160px; }
.lead-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lead-feedback {
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
}
.lead-feedback--ok {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(16,185,129,0.3);
}
.lead-feedback--err {
  background: var(--danger-light);
  color: var(--danger-dark);
  border: 1px solid rgba(239,68,68,0.3);
}

/* ---------- Floating WhatsApp Button ---------- */
.wa-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(37,211,102,0.45);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: waPulse 2.6s ease-in-out infinite;
}
.wa-float:hover {
  transform: scale(1.08);
  color: #fff;
  box-shadow: 0 10px 26px rgba(37,211,102,0.55);
}
@keyframes waPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(37,211,102,0.45); }
  50%      { box-shadow: 0 6px 26px rgba(37,211,102,0.75); }
}

/* ---------- Detail Modal (Bootstrap override) ---------- */
.modal-content {
  border: none;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl);
}
.modal-header {
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-body {
  padding: 1.5rem;
}

/* ---------- Cart Items ---------- */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  animation: fadeIn 0.3s ease;
}
.cart-item:hover { background: var(--primary-light); }
.cart-item:last-child { border-bottom: none; }

.cart-item__img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: #f8f9fa;
}
.cart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cart-item__img:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.cart-item__name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}
.cart-item__price {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}
.cart-item__price strong { color: var(--primary); font-weight: 700; }

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}
.qty-control__btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.qty-control__btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.qty-control__value {
  width: 40px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  border: none;
  background: transparent;
  font-family: var(--font);
  -moz-appearance: textfield;
}
.qty-control__value::-webkit-outer-spin-button,
.qty-control__value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---------- Order Summary ---------- */
.order-summary {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}
.order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
}
.order-summary__label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.order-summary__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg-body);
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.login-brand__logo {
  height: 60px;
  width: auto;
  margin-bottom: 0.75rem;
}
.login-brand__name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  border: 1px solid var(--border-light);
}
.login-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-input-group {
  position: relative;
  margin-bottom: 1rem;
}
.login-input-group__icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.login-input-group__input {
  width: 100%;
  padding: 0.75rem 0.85rem 0.75rem 2.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text-primary);
  transition: all var(--transition);
}
.login-input-group__input::placeholder { color: var(--text-muted); }
.login-input-group__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.login-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--danger-light);
  color: var(--danger-dark);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Catalog Header ---------- */
.catalog-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem 0.5rem;
}
.catalog-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.catalog-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.catalog-header__subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: -0.005em;
}
.catalog-header__stats {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.stat-chip strong {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stat-chip i { color: var(--primary); font-size: 0.85rem; }
.stat-chip--clear {
  cursor: pointer;
  color: var(--danger);
  border-color: var(--danger-light);
  background: var(--danger-light);
}
.stat-chip--clear i { color: var(--danger); }
.stat-chip--clear:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.stat-chip--clear:hover i { color: #fff; }

.stat-tabs {
  display: inline-flex;
  gap: 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.stat-chip--tab {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.5rem 0.95rem;
}
.stat-chip--tab + .stat-chip--tab {
  border-left: 1px solid var(--border);
}
.stat-chip--tab:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}
.stat-chip--tab.is-active {
  background: var(--primary);
  color: #fff;
}
.stat-chip--tab.is-active i { color: #fff; }

/* ---------- Page Header ---------- */
.page-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-header__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.page-header__badge {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* ---------- Content wrapper ---------- */
.content-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- Card container (for cart, orders, etc.) ---------- */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin: 1rem;
  overflow: hidden;
}

/* ---------- Mobile order cards (< 640px) ---------- */
.order-card-mobile {
  display: none;
}

/* ---------- Tooltip via title (pure CSS) ---------- */
.text-truncate-custom {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cartPulse {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15); }
  50% { transform: scale(0.95); }
  75% { transform: scale(1.05); }
}
@keyframes badgePop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-logo img { height: 48px; }
  .nav-top { min-height: 48px; }
  .main-nav { padding: 0.5rem 0.75rem; }
  .wa-float { width: 52px; height: 52px; font-size: 1.65rem; right: 14px; bottom: 14px; }
  .lead-actions .btn-action { flex: 1 1 100%; }

  /* Menú desplegable con ☰ */
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding-top: 0.65rem;
  }
  .nav-menu.is-open { display: flex; animation: fadeIn 0.2s ease; }
  .nav-welcome { width: 100%; text-align: center; padding: 0.15rem 0 0.35rem; }
  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.4rem;
  }
  .btn-nav {
    width: 100%;
    justify-content: flex-start;
    padding: 0.65rem 0.9rem;
    font-size: 0.88rem;
  }

  .catalog-header {
    padding: 1.25rem 1rem 0;
  }
  .catalog-header__title { font-size: 1.4rem; }
  .catalog-header__subtitle { font-size: 0.82rem; }
  .catalog-header__inner { gap: 0.75rem; }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0 0.75rem;
  }
  .product-card__title { font-size: 0.82rem; }
  .product-card__body { padding: 0.75rem 0.85rem 0.5rem; }
  .product-card__footer { padding: 0.5rem 0.85rem 0.75rem; }
  .badge-cat { font-size: 0.65rem; padding: 0.15rem 0.5rem; }

  .filter-bar {
    margin: 0.75rem;
    padding: 0.85rem;
  }

  .page-header {
    padding: 1rem 0.75rem 0;
  }
  .page-header__title {
    font-size: 1.2rem;
  }

  .img-modal__content img {
    max-width: 95vw;
    max-height: 50vh;
  }

  /* Mobile order cards */
  .table-desktop { display: none !important; }
  .order-card-mobile { display: block; }

  .order-card-mobile__item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  .order-card-mobile__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }
  .order-card-mobile__id {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
  }
  .order-card-mobile__date {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
  }
  .order-card-mobile__obs {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    word-break: break-word;
  }
  .order-card-mobile__actions {
    display: flex;
    gap: 0.5rem;
  }

  .content-card {
    margin: 0.75rem;
    border-radius: var(--radius-md);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (min-width: 1025px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
