/* ================================================================
   Amoblarthe — App Design System
   Compartido por: panel admin (back-office) y storefront público.
   Coherente con auth.css (login).
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand — rojo Amoblarthe (sillón) + negro (tipografía BLARTHE) */
  --brand: #DC2626;            /* rojo Amoblarthe */
  --brand-light: #EF4444;
  --brand-dark: #991B1B;
  --accent: #171717;           /* negro corporativo */
  --accent-light: #404040;

  /* Backgrounds — limpios, white-first */
  --bg-cream: #FAFAFA;
  --bg-cream-2: #FFFFFF;
  --bg-paper: #FFFFFF;
  --bg-soft: #F5F5F5;

  /* Text */
  --text: #171717;
  --text-soft: rgba(23, 23, 23, 0.7);
  --text-muted: rgba(23, 23, 23, 0.55);

  /* Lines */
  --line: rgba(0, 0, 0, 0.10);
  --line-soft: rgba(0, 0, 0, 0.06);

  /* States */
  --ok: #16A34A;
  --ok-bg: rgba(22, 163, 74, 0.10);
  --warn: #D97706;
  --warn-bg: rgba(217, 119, 6, 0.12);
  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.10);
  --info: #0EA5E9;
  --info-bg: rgba(14, 165, 233, 0.10);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.10),
               0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, 0.18),
               0 4px 12px -4px rgba(0, 0, 0, 0.10);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Spacing scale */
  --gap-xs: 6px;
  --gap-sm: 10px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 36px;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.7);
}

/* ================================================================
   RESET / BASE
   ================================================================ */
.app-body { background: var(--bg-cream); margin: 0; }
.app-body main { max-width: none; padding: 0; margin: 0; }

/* Hide global topbar/footer when using admin shell */
.app-body .topbar,
.app-body .site-topbar,
.app-body .foot,
.app-body .site-foot { display: none !important; }

.app-page {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  position: relative;
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, color-mix(in srgb, var(--brand-primary) 10%, white) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 100%, color-mix(in srgb, var(--brand-primary) 15%, white) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-cream-2) 0%, var(--bg-cream) 100%);
}

/* Subtle grid pattern in the background */
.app-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--brand-primary) 3%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--brand-primary) 3%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}

* { box-sizing: border-box; }
.app-page * { font-family: inherit; }
a { color: var(--brand); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-dark); }

/* ================================================================
   TOPBAR (admin nav)
   ================================================================ */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  color: var(--text);
  flex-shrink: 0;
}
.app-brand-mark {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.app-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.app-brand:hover .app-brand-mark { transform: rotate(-3deg) scale(1.05); }
.app-brand-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-flex;
}
.app-brand-text .brand-amo     { color: var(--brand); }
.app-brand-text .brand-blarthe { color: var(--accent); }

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  /* Fade hint en el borde derecho cuando hay overflow — indica que se puede scrollear */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}
.app-nav::-webkit-scrollbar { height: 4px; }
.app-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 4px; }
.app-nav a { white-space: nowrap; flex-shrink: 0; }
.app-nav a {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.app-nav a:hover {
  background: rgba(220, 38, 38, 0.08);
  color: var(--brand-dark);
}
.app-nav a.is-active {
  background: rgba(220, 38, 38, 0.12);
  color: var(--brand-dark);
  font-weight: 600;
}
.app-nav a svg { width: 16px; height: 16px; opacity: 0.85; }

.app-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.app-user-name {
  font-size: 0.88rem;
  color: var(--text-soft);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.app-user-name strong { color: var(--text); font-weight: 600; font-size: 0.88rem; }
.app-user-role {
  display: inline-block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--brand);
  margin-top: 1px;
}
.app-user-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}

/* Volver al catálogo - destacado en la barra superior */
.app-back-catalog {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none !important;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.app-back-catalog:hover {
  background: rgba(220, 38, 38, 0.08);
  color: var(--brand-dark);
  transform: translateX(-2px);
}
.app-back-catalog svg { width: 15px; height: 15px; flex-shrink: 0; transition: transform 0.15s; }
.app-back-catalog:hover svg { transform: translateX(-2px); }
.app-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.app-logout {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.85rem;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-logout:hover { background: rgba(220, 38, 38, 0.08); color: var(--danger); border-color: rgba(220, 38, 38, 0.3); }
.app-logout svg { width: 14px; height: 14px; }

/* ================================================================
   CONTENT WRAPPER
   ================================================================ */
.app-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 80px;
  animation: page-in 0.35s ease-out;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   PAGE HEADER (title + actions + breadcrumb)
   ================================================================ */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--text-soft);
  font-weight: 500;
  transition: all 0.15s;
}
.page-back:hover { color: var(--brand-dark); transform: translateX(-2px); }
.page-back svg { width: 16px; height: 16px; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  flex-wrap: wrap;
}
.page-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.page-count {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}
.page-subtitle {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

/* ================================================================
   CARD
   ================================================================ */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: var(--gap-lg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow-md);
  position: relative;
}
.card-solid {
  background: var(--bg-paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card-pad-lg { padding: var(--gap-xl); }
.card-pad-sm { padding: var(--gap-md); }
.card-section + .card-section { margin-top: var(--gap-lg); }
.card h3, .card-title {
  margin: 0 0 var(--gap-md);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-paper);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px -3px rgba(220, 38, 38, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 16px -3px rgba(220, 38, 38, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover { background: rgba(220, 38, 38, 0.08); color: var(--brand-dark); border-color: transparent; }

.btn-danger { color: var(--danger); border-color: rgba(220, 38, 38, 0.25); }
.btn-danger:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.4);
  color: var(--danger);
}

.btn-sm { padding: 6px 11px; font-size: 0.82rem; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 0.95rem; border-radius: 12px; }
.btn-icon { padding: 9px; }
.btn-icon svg { width: 16px; height: 16px; }

/* ================================================================
   FORM (inputs, selects, textareas, labels)
   ================================================================ */
.form { display: flex; flex-direction: column; gap: var(--gap-md); }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap-md);
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}
.form-field > label,
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.form-field small,
.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: rgba(23, 23, 23, 0.4); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(220, 38, 38, 0.3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(220, 38, 38, 0.7);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.input-sm { padding: 7px 10px; font-size: 0.85rem; border-radius: 8px; }

/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}
.checkbox input { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }

/* Form actions */
.form-actions {
  display: flex;
  gap: var(--gap-sm);
  margin-top: var(--gap-md);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

/* ================================================================
   TABLE
   ================================================================ */
.table-wrap {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table thead th {
  background: rgba(220, 38, 38, 0.04);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgba(220, 38, 38, 0.03); }
.table .row-thumb {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.table .row-thumb-empty {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--line-soft);
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}
.table-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
}
.row-warn { background: rgba(217, 119, 6, 0.06) !important; }
.row-danger { background: rgba(220, 38, 38, 0.06) !important; }

/* Inline form within a table cell (e.g. "Adjust min stock") */
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ================================================================
   BADGE
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--line-soft);
  color: var(--text-soft);
  white-space: nowrap;
}
.badge-ok      { background: var(--ok-bg);     color: var(--ok); }
.badge-warn    { background: var(--warn-bg);   color: var(--warn); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-info    { background: var(--info-bg);   color: var(--info); }
.badge-neutral { background: var(--line-soft); color: var(--text-soft); }
.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ================================================================
   KPI CARDS
   ================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}
.kpi {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi-label {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.kpi-sub {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 4px;
}
.kpi.kpi-warn .kpi-value   { color: var(--warn); }
.kpi.kpi-danger .kpi-value { color: var(--danger); }
.kpi.kpi-ok .kpi-value     { color: var(--ok); }
.kpi-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px; height: 28px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ================================================================
   TABS / FILTER PILLS
   ================================================================ */
.tabs {
  display: inline-flex;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin-bottom: var(--gap-md);
}
.tabs a, .tabs button {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.tabs a:hover, .tabs button:hover { background: rgba(220, 38, 38, 0.08); color: var(--text); }
.tabs a.is-active, .tabs button.is-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ================================================================
   FLASH (notifications)
   ================================================================ */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: var(--gap-md);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(14, 165, 233, 0.2);
  animation: rise-in 0.3s ease-out;
}
.flash svg { width: 18px; height: 18px; flex-shrink: 0; }
.flash-ok     { background: var(--ok-bg);     color: var(--ok);     border-color: rgba(22, 163, 74, 0.2); }
.flash-warn   { background: var(--warn-bg);   color: var(--warn);   border-color: rgba(217, 119, 6, 0.2); }
.flash-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(220, 38, 38, 0.2); }
.flash.hide   { animation: rise-out 0.4s forwards; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rise-out {
  to { opacity: 0; transform: translateY(-6px); height: 0; padding: 0; margin: 0; }
}

/* ================================================================
   STOCK BAR (inventory)
   ================================================================ */
.stock-bar-wrap {
  width: 100%;
  max-width: 110px;
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.stock-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
}

/* Low stock alert widget (used in products list) */
.alert-widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(220, 38, 38, 0.06));
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: var(--r-md);
  margin-bottom: var(--gap-lg);
}
.alert-widget-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.alert-widget-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.alert-widget-icon svg { width: 16px; height: 16px; }
.alert-widget-title {
  font-weight: 600;
  color: var(--warn);
  font-size: 0.95rem;
  flex: 1;
}
.alert-widget-link {
  font-size: 0.85rem;
  color: var(--warn);
  font-weight: 600;
}
.alert-widget-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(255,255,255,0.65);
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid rgba(217, 119, 6, 0.18);
}
.alert-pill.is-critico { border-color: rgba(220, 38, 38, 0.3); color: var(--danger); }
.alert-pill b { font-weight: 700; }

/* ================================================================
   IMAGE GRID (admin existing images, e.g. product form)
   ================================================================ */
.img-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.img-tile {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.img-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.img-tile.is-primary { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2); }
.img-tile img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--line-soft); }
.img-tile-actions {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.img-tile-actions form { display: flex; }
.img-tile-actions .btn { width: 100%; font-size: 0.78rem; padding: 6px 10px; }
.img-tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 8px;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 6px;
}

/* ================================================================
   PUBLIC STOREFRONT (catalog + product detail)
   ================================================================ */
.store-hero {
  text-align: left;
  padding: 28px 0 16px;
}
.store-hero h1 {
  margin: 0 0 6px;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--accent);
}
.store-hero h1 em {
  font-style: normal;
  color: var(--brand);
}
.store-hero p { margin: 0; color: var(--text-soft); font-size: 1.05rem; }

.store-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 10px;
  margin: 18px 0 24px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  /* Sticky bajo el topbar (~76px de alto) — se mantiene visible al scrollear */
  position: sticky;
  top: 76px;
  z-index: 40;
  box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.18);
  transition: padding 0.18s ease, box-shadow 0.18s ease;
}
/* Pequeña sombra extra cuando deja de estar pegado al borde superior natural */
.store-filters.is-pinned {
  padding: 10px 12px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.28);
}
.store-filters input,
.store-filters select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
  display: block;
  color: inherit;
  text-decoration: none !important;
  position: relative;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(220, 38, 38, 0.25);
}
.product-card-img {
  width: 100%;
  aspect-ratio: 1080 / 1440;   /* proporción 3:4 estilo Instagram (vertical) */
  object-fit: cover;            /* las fotos 1080×1440 llenan perfecto sin recorte */
  object-position: center;
  display: block;
  background: #FAFAFA;
}
.product-card-noimg {
  width: 100%;
  aspect-ratio: 1080 / 1440;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--line-soft);
  font-size: 0.85rem;
}
.product-card-body { padding: 14px 16px; }
.product-card-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  font-weight: 500;
}
.product-card-name { margin: 4px 0 8px; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.product-card-price { font-size: 1.05rem; font-weight: 700; color: var(--brand-dark); }

.color-dots { display: flex; gap: 5px; margin-top: 10px; }
.color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  display: inline-block;
  background: #ddd;
}
.color-dot.lg { width: 26px; height: 26px; border-width: 2px; cursor: pointer; transition: transform 0.15s; }
.color-dot.lg:hover { transform: scale(1.1); }

/* ---------- Product detail (the page with the buggy thumbnails) ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 880px) {
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
}

.detail-gallery { display: flex; flex-direction: column; gap: 12px; }
.detail-main-img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--line-soft);
  box-shadow: var(--shadow-md);
  display: block;
}
.detail-noimg-big {
  width: 100%; height: 460px;
  border-radius: var(--r-md);
  background: var(--line-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}

/* THUMBS — fix del bug: grid de cuadritos, NO flex con stretch */
.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 80px));
  gap: 10px;
}
/* High specificity to override `.detail-gallery img { width: 100% }` */
.detail-thumbs .detail-thumb {
  width: 80px;
  height: 80px;
  max-width: 80px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.75;
  transition: all 0.15s;
  border: 2px solid transparent;
  box-sizing: border-box;
  background: var(--line-soft);
  display: block;
}
.detail-thumbs .detail-thumb:hover { opacity: 1; transform: translateY(-1px); }
.detail-thumbs .detail-thumb.is-active { opacity: 1; border-color: var(--brand); }

.detail-info-cat {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.detail-info h1 {
  margin: 0 0 12px;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.detail-price {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 18px;
}
.detail-desc { color: var(--text); white-space: pre-wrap; line-height: 1.65; }

.detail-block { margin-top: 22px; }
.detail-block h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
  font-weight: 700;
}
.detail-kv { padding: 0; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.detail-kv li { font-size: 0.92rem; color: var(--text); }
.detail-kv b { color: var(--text); font-weight: 600; }
.detail-kv em { color: var(--text-muted); font-style: normal; font-size: 0.85rem; }

.complement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.complement-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-align: center;
  text-decoration: none !important;
  color: inherit;
  transition: all 0.15s;
}
.complement-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(220, 38, 38, 0.25); }
.complement-card img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--line-soft); }
.complement-card-body { padding: 10px; font-size: 0.85rem; }
.complement-card-body strong { display: block; margin-bottom: 2px; }
.complement-card-body div { color: var(--text-muted); font-size: 0.8rem; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--line-soft);
  color: var(--text-muted);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state h3 { margin: 0 0 6px; color: var(--text); font-size: 1.05rem; font-weight: 600; }
.empty-state p { margin: 0 0 16px; font-size: 0.9rem; }

/* ================================================================
   PAGINATION
   ================================================================ */
.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: var(--gap-lg);
}
.pager .btn { min-width: 38px; padding: 7px 11px; font-size: 0.85rem; }

/* ================================================================
   UTILS
   ================================================================ */
.row { display: flex; gap: var(--gap-md); align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: var(--gap-md); align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.mb-0 { margin-bottom: 0; }
.mb-md { margin-bottom: var(--gap-md); }
.mb-lg { margin-bottom: var(--gap-lg); }
.mt-md { margin-top: var(--gap-md); }
.mt-lg { margin-top: var(--gap-lg); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .app-back-catalog span { display: none; }
  .app-back-catalog { padding: 7px 9px; }
  .app-user-name { display: none; }
}
@media (max-width: 920px) {
  .app-topbar { flex-wrap: wrap; padding: 10px 16px; }
  .app-nav { width: 100%; order: 3; overflow-x: auto; }
  .app-content { padding: 18px 16px 60px; }
  .app-brand-text { font-size: 1.15rem; }
  .app-brand-mark { width: 36px; height: 36px; }
  .page-title { font-size: 1.45rem; }
  .store-filters { grid-template-columns: 1fr 1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
}
@media (max-width: 480px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .table tbody td { padding: 6px 16px; border-bottom: 0; }
  .table tbody td::before { content: attr(data-label) ': '; font-weight: 600; color: var(--text-muted); }
}

@media (prefers-reduced-motion: reduce) {
  .app-content { animation: none; }
  .product-card, .img-tile, .complement-card { transition: none; }
  .product-card:hover, .img-tile:hover, .complement-card:hover { transform: none; }
}

/* ================================================================
   CATALOG v2  (pill filtering, hero, responsive grid)
   ================================================================ */

/* ---- CSS vars ---- */
:root {
  --catalog-hero-bg: #fff5f5;
}

/* ---- Hero ---- */
.cat-hero {
  background: var(--catalog-hero-bg);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 32px;
}
.cat-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.cat-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px;
  line-height: 1.15;
}
.cat-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 20px;
}
.cat-search-wrap {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
}
.cat-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.cat-search-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1px solid var(--line);
  border-radius: 30px;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
}
.cat-search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

/* ---- Wrap ---- */
.cat-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ---- Sticky bar ---- */
.cat-filter-sentinel { height: 1px; }
.cat-sticky-bar {
  position: sticky;
  top: 76px;
  z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  padding: 12px 0 4px;
  margin-bottom: 4px;
  transition: box-shadow .18s, border-color .18s;
}
.cat-sticky-bar.is-pinned {
  box-shadow: 0 4px 18px -6px rgba(0,0,0,.14);
  border-bottom-color: var(--line);
}

/* ---- Category pills ---- */
.cat-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 8px;
  scrollbar-width: none;
}
.cat-filter-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: 30px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1;
}
.cat-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.cat-pill[data-active] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,.28);
}

/* ---- Filter row 2 ---- */
.cat-filter-row2 {
  display: flex;
  gap: 10px;
  padding-bottom: 6px;
  flex-wrap: wrap;
}
.cat-filter-select,
.cat-filter-input {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  background: #fff;
  color: inherit;
  transition: border-color .15s;
}
.cat-filter-select:focus,
.cat-filter-input:focus {
  outline: none;
  border-color: var(--brand);
}
.cat-filter-input { width: 160px; }

/* ---- Product grid ---- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 20px;
}
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
@media (min-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

/* ---- Product card ---- */
.cat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px -6px rgba(0,0,0,.15);
  border-color: rgba(220,38,38,.2);
}
.cat-card-img-wrap {
  position: relative;
  overflow: hidden;
}
.cat-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #fafafa;
  transition: transform .4s;
}
.cat-card:hover .cat-card-img { transform: scale(1.04); }
.cat-card-noimg {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line-soft, #f3f4f6);
  color: var(--text-muted);
}
.cat-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 30px;
  border: 1px solid rgba(0,0,0,.06);
  line-height: 1.4;
  white-space: nowrap;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-card-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cat-card-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #1a1a1a;
}
.cat-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-dark, #b91c1c);
  margin-top: 2px;
}
.cat-card-body .color-dots { margin-top: 8px; }

/* ---- Empty / no-results state ---- */
.cat-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}
.cat-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: block;
  opacity: .45;
}
.cat-empty h3 { margin: 0 0 6px; font-size: 1.1rem; color: #333; }
.cat-empty p  { margin: 0; font-size: 0.9rem; }

/* ---- Banner hero styles ---- */
.cat-hero--banner {
  position: relative;
  min-height: 160px;
}
.cat-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,.26) 100%);
  pointer-events: none;
}
.cat-hero-inner--over-banner {
  position: relative;
  z-index: 1;
}
.cat-hero--banner h1 { color: #fff !important; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.cat-hero--banner p  { color: rgba(255,255,255,.88) !important; }
.cat-hero--banner .cat-search-input { box-shadow: 0 2px 10px rgba(0,0,0,.18); }

/* ---- Sticky bar: no admin nav on public pages → smaller top ---- */
.site-body .cat-sticky-bar { top: 64px; }
body:not(.app-body) .cat-sticky-bar { top: 0; }

/* ---- Responsive tweaks ---- */
@media (max-width: 600px) {
  .cat-hero { padding: 28px 0 22px; }
  .cat-wrap { padding: 0 12px 48px; }
  
  /* Sticky bar sits right at top on mobile (no nav height) */
  .cat-sticky-bar { top: 0 !important; }
  
  /* Filter bar pills: smaller touch target but scrollable */
  .cat-filter-bar { gap: 6px; padding-bottom: 6px; }
  .cat-pill { padding: 6px 14px; font-size: 0.8rem; }
  
  /* Filter row 2: stack vertically, full width */
  .cat-filter-row2 {
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
  }
  .cat-filter-select,
  .cat-filter-input {
    width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Slightly tighter grid on very small screens */
  .cat-grid { gap: 10px; }
  .cat-card-body { padding: 10px 10px 12px; }
  .cat-card-name { font-size: 0.85rem; }
  .cat-card-price { font-size: 0.92rem; }
}
@media (max-width: 360px) {
  .cat-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .cat-card { transition: none; }
  .cat-card:hover { transform: none; }
  .cat-card-img { transition: none; }
}

/* ===== CATALOG CART ===== */

/* Card wrap — grid cell container */
.cat-card-wrap {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cat-card-wrap:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px -6px rgba(0,0,0,.14);
  border-color: rgba(220,38,38,.18);
}
/* Inner <a> loses its own border/radius — card-wrap owns those */
.cat-card-wrap .cat-card {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  transition: none !important;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.cat-card-wrap .cat-card:hover {
  transform: none !important;
  box-shadow: none !important;
}
.cat-card-wrap .cat-card-img { transition: transform .35s; }
.cat-card-wrap:hover .cat-card-img { transform: scale(1.04); }

/* Agregar button */
.cat-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 0;
  border: none;
  border-top: 1px solid rgba(0,0,0,.06);
  border-radius: 0;
  background: var(--brand, #dc2626);
  color: #fff;
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .12s;
  width: 100%;
  flex-shrink: 0;
  letter-spacing: .01em;
}
.cat-add-btn:hover { background: var(--brand-dark, #b91c1c); opacity: 1; }
.cat-add-btn:active { opacity: .82; }
.cat-add-btn.added {
  background: #16a34a;
}
.cat-add-icon { flex-shrink: 0; opacity: .9; }

/* Cart bubble */
.cart-bubble {
  position: fixed;
  bottom: 88px;
  right: 20px;
  z-index: 200;
  background: #16a34a;
  color: #fff;
  border-radius: 30px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(22,163,74,.35);
  transition: transform .18s, box-shadow .18s;
  font-weight: 600;
  font-size: .9rem;
  user-select: none;
}
.cart-bubble:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(22,163,74,.45); }
.cart-bubble-badge {
  background: #fff;
  color: var(--brand);
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}

/* Cart overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
body.cart-open .cart-overlay {
  opacity: 1;
  pointer-events: all;
}

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 310;
  width: 360px;
  max-width: 100vw;
  background: #fff;
  box-shadow: -4px 0 28px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.cart-drawer.open { transform: none; }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.cart-drawer-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 4px;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
}
.cart-drawer-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

/* Cart items */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft, #f3f4f6);
  position: relative;
}
.cart-item-img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-noimg {
  width: 56px; height: 56px; border-radius: 8px;
  background: var(--line-soft, #f3f4f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.cart-item-qty {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
}
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: #f9fafb;
  font-size: 1.1rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.qty-btn:hover { background: var(--line); }
.cart-item-qty span { font-size: .88rem; font-weight: 600; min-width: 16px; text-align: center; }
.cart-item-remove {
  position: absolute;
  top: 8px; right: 0;
  background: none; border: none;
  font-size: 1.2rem; cursor: pointer; color: #d1d5db;
  line-height: 1; padding: 0;
}
.cart-item-remove:hover { color: #ef4444; }

/* Drawer footer */
.cart-drawer-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-drawer-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.cart-btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 10px; border: none;
  background: #25D366; color: #fff;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.cart-btn-wa:hover { opacity: .9; }
.cart-btn-checkout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 10px; border: 1.5px solid var(--brand);
  background: transparent; color: var(--brand);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.cart-btn-checkout:hover { background: var(--brand); color: #fff; }

@media (max-width: 480px) {
  .cart-bubble { bottom: 76px; right: 14px; padding: 9px 14px; }
  .cart-drawer { width: 100vw; }
}

.cart-keep-shopping {
  display: inline-block;
  margin-top: 10px;
  font-size: .82rem;
  color: var(--brand);
  text-decoration: none;
}
.cart-keep-shopping:hover { text-decoration: underline; }

/* ===== END CATALOG CART ===== */
