/* ─────────────────────────────────────────────────────────────────────
   CISISA Shop · Sistema de diseño alineado con interna_v2 (app.css)
   Marca: Magenta (#C41589) / Morado (#4B0D5E) / Dark (#150320)
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* Marca CISISA (idénticos a interna_v2/public/assets/css/app.css) */
  --cisisa-magenta:  #C41589;
  --cisisa-purple:   #4B0D5E;
  --cisisa-dark:     #150320;
  --cisisa-blush:    #F7E8F5;
  --cisisa-lavender: #F3EEF7;

  --primary:         var(--cisisa-magenta);
  --primary-hover:   var(--cisisa-purple);
  --primary-h:       var(--cisisa-purple);
  --primary-light:   var(--cisisa-blush);
  --primary-soft:    var(--cisisa-blush);

  --success:         #16a34a;
  --success-soft:    #dcfce7;
  --warning:         #d97706;
  --warning-soft:    #fef3c7;
  --danger:          #dc2626;
  --danger-soft:     #fee2e2;

  --gray-50:         #f8fafc;
  --gray-100:        #f1f5f9;
  --gray-200:        #e2e8f0;
  --gray-400:        #94a3b8;
  --gray-600:        #475569;
  --gray-800:        #1e293b;
  --gray-900:        #0f172a;
  --white:           #ffffff;

  --bg:              var(--cisisa-lavender);
  --surface:         var(--white);
  --surface-alt:     var(--gray-50);
  --border:          var(--gray-200);
  --text:            var(--gray-800);
  --text-strong:     var(--gray-900);
  --text-muted:      var(--gray-600);

  --radius:          8px;
  --radius-lg:       12px;
  --shadow:          0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md:       0 4px 6px rgba(0, 0, 0, .07), 0 2px 4px rgba(0, 0, 0, .06);
  --shadow-lg:       0 10px 15px rgba(0, 0, 0, .1), 0 4px 6px rgba(0, 0, 0, .05);
  --transition:      .18s ease;
}

/* Dark mode overrides (idénticos a interna_v2) */
[data-theme="dark"] {
  color-scheme: dark;
  --gray-50:         #0f172a;
  --gray-100:        #1e293b;
  --gray-200:        #334155;
  --gray-400:        #64748b;
  --gray-600:        #94a3b8;
  --gray-800:        #e2e8f0;
  --gray-900:        #f1f5f9;
  --white:           #1e293b;

  --primary-light:   rgba(196, 21, 137, .18);
  --primary-soft:    rgba(196, 21, 137, .18);
  --success-soft:    rgba(22, 163, 74, .18);
  --warning-soft:    rgba(217, 119, 6, .18);
  --danger-soft:     rgba(220, 38, 38, .2);

  --bg:              #0f172a;
  --surface:         #1e293b;
  --surface-alt:     #0f172a;
  --border:          #334155;
  --text:            #e2e8f0;
  --text-strong:     #f1f5f9;
  --text-muted:      #94a3b8;

  --shadow:          0 1px 3px rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-md:       0 4px 6px rgba(0, 0, 0, .25), 0 2px 4px rgba(0, 0, 0, .2);
  --shadow-lg:       0 10px 15px rgba(0, 0, 0, .35), 0 4px 6px rgba(0, 0, 0, .2);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-hover); }

/* Scrollbars estilo interna_v2 */
* { scrollbar-width: thin; scrollbar-color: var(--gray-400) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--gray-400); border-radius: 4px; }

/* Header / Topbar (Amazon + Mercado Libre inspired) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
[data-theme="dark"] .topbar {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.32);
}
.topbar-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 2.8vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-strong);
  text-decoration: none !important;
  flex-shrink: 0;
}
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
}
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
.brand-sep {
  width: 1px;
  height: 26px;
  background: var(--border);
  flex-shrink: 0;
}
.brand-id {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-id-main {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--cisisa-magenta), var(--cisisa-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .brand-id-main {
  background: linear-gradient(135deg, #f472b6, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-id-sub {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}
.brand-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
}

/* Reusable Ghost Utility Tiles (Amazon 2-line + ML hover) */
.nav-tile {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.36rem 0.62rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none !important;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}
.nav-tile:hover {
  background: var(--surface-alt);
  border-color: var(--border);
  text-decoration: none !important;
}
[data-theme="dark"] .nav-tile:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}
.nav-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
  min-width: 0;
}
.nav-kicker {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.nav-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}
.nav-label-accent { color: var(--primary); }
.nav-icon-muted { color: var(--text-muted); flex-shrink: 0; }

.nav-location {
  max-width: 175px;
}
.nav-location .nav-icon-pin {
  color: var(--primary);
  flex-shrink: 0;
}
.nav-location .nav-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 128px;
}

/* Full-width Composite Search Bar */
.search-bar {
  flex: 1 1 auto;
  min-width: 220px;
  max-width: none;
  margin: 0 0.25rem;
}
.search-composite {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 42px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-composite:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 21, 137, 0.16);
}
.search-cat-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.search-cat-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-strong);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 1.7rem 0 0.75rem;
  height: 100%;
  max-width: 155px;
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
}
[data-theme="dark"] .search-cat-wrap select option {
  background: #1e293b;
  color: #f1f5f9;
}
.search-cat-chevron {
  pointer-events: none;
  position: absolute;
  right: 0.5rem;
  color: var(--text-muted);
}
.search-composite input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0 0.9rem;
  outline: none;
}
.search-composite input[type="search"]::placeholder {
  color: var(--text-muted);
}
.search-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.search-submit-btn:hover {
  background: var(--primary-hover);
}

/* Legacy fallback if used elsewhere */
.search-wrap {
  flex: 1;
  min-width: 210px;
  max-width: 620px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Account Popover */
.nav-account-wrap {
  position: relative;
}
.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.nav-avatar.logged-in {
  background: linear-gradient(135deg, var(--cisisa-magenta), var(--cisisa-purple));
  color: #fff;
}
.account-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 268px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  padding: 0.5rem;
  z-index: 50;
}
.account-dropdown.open { display: block; }
[data-theme="dark"] .account-dropdown {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.account-dd-head {
  padding: 0.55rem 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}
.account-dd-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-dd-email {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}
.account-dd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.52rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  text-decoration: none !important;
  transition: background var(--transition), color var(--transition);
}
.account-dd-item-left {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.account-dd-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none !important;
}
.account-dd-item.danger { color: var(--danger); }
.account-dd-item.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.account-dd-sep {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

/* Cart Tile */
.cart-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  color: var(--text-strong);
}
.cart-count-pill {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  line-height: 1;
}

/* Theme toggle button */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

.icon-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.icon-refresh-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.icon-refresh-btn.spinning svg {
  animation: cisisaSpin .7s linear infinite;
}
@keyframes cisisaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.54rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none !important;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: 0.36rem 0.72rem; font-size: 0.82rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.cart-btn { position: relative; }
.cart-badge {
  background: var(--cisisa-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}

/* Hero con gradiente oficial CISISA */
.hero {
  background: linear-gradient(135deg, var(--cisisa-dark) 0%, var(--cisisa-purple) 55%, var(--cisisa-magenta) 100%);
  color: #fff;
  padding: 2.3rem clamp(1.25rem, 3vw, 2.75rem);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(247, 232, 245, 0.16), transparent 52%);
  pointer-events: none;
}
.hero-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.hero h1 { margin: 0 0 0.5rem; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.18; font-weight: 700; }
.hero p { margin: 0; color: #f3e8f6; max-width: 720px; font-size: 0.96rem; }
.hero-pill {
  display: inline-block;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  padding: 0.24rem 0.78rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Main container */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.65rem clamp(1.25rem, 3vw, 2.75rem) 3rem;
}

/* Categories */
.categories-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.cat-pill {
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Products grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(196, 21, 137, 0.35);
}
.product-img-wrap {
  position: relative;
  height: 195px;
  background: var(--surface-alt);
  overflow: hidden;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--cisisa-magenta);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.product-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-cat {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.product-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
}
.product-desc {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.product-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.price { font-size: 1.22rem; font-weight: 800; color: var(--text-strong); }
.compare-price { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }

/* Drawer & Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 3, 32, 0.58);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.overlay.open { display: flex; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--surface);
  z-index: 70;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-header, .modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-strong);
}
.drawer-header h3, .modal-header h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-body { padding: 1.25rem; }

.close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.close-btn:hover { color: var(--primary); }

/* Cart items */
.cart-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-alt);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-strong); }
.qty-ctrl { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.3rem; }
.qty-ctrl button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.qty-ctrl button:hover { border-color: var(--primary); color: var(--primary); }

.summary-row { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 0.35rem; }
.summary-total { font-size: 1.08rem; font-weight: 800; color: var(--text-strong); padding-top: 0.45rem; border-top: 1px solid var(--border); margin-top: 0.45rem; }

/* Forms */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.85rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.56rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 21, 137, 0.14);
}
.cp-status {
  font-size: 0.78rem;
  margin-top: 0.15rem;
  min-height: 1.1em;
  color: var(--text-muted);
}
.cp-status.ok { color: var(--success); font-weight: 600; }
.cp-status.err { color: var(--danger); font-weight: 600; }
.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14) !important;
}
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  width: 100%;
  padding-right: 2.6rem;
}
.password-toggle {
  position: absolute;
  right: 0.45rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.password-toggle:hover {
  color: var(--primary);
  background: var(--primary-light);
}

/* Badges & Alerts */
.badge {
  display: inline-block;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-info    { background: var(--primary-soft); color: var(--primary); }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-error   { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, .25); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(22, 163, 74, .25); }
.alert-info    { background: var(--primary-soft); color: var(--primary); border-color: rgba(196, 21, 137, .25); }

/* Orders list */
.order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
}
.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Admin Layout */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.admin-tab {
  padding: 0.65rem 1rem;
  border: none;
  background: none;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  transition: color var(--transition), border-color var(--transition);
}
.admin-tab:hover { color: var(--primary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.2rem;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--text-strong); margin-top: 0.2rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th, td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--surface-alt); }
tbody tr:hover { background: var(--primary-light); }

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--cisisa-dark);
  border: 1px solid var(--cisisa-purple);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  font-size: 0.88rem;
}
.toast.show { display: block; }

code {
  background: var(--primary-light);
  color: var(--cisisa-purple);
  padding: 0.12rem 0.38rem;
  border-radius: 5px;
  font-size: 0.85em;
}
[data-theme="dark"] code {
  color: #f9a8d4;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Subnav estilo Amazon / Mercado Libre ──────────────────────────── */
.subnav {
  background: linear-gradient(90deg, #150320 0%, #2a073c 55%, #150320 100%);
  color: #f3e8f6;
  border-bottom: 1px solid rgba(196, 21, 137, 0.38);
  position: relative;
  z-index: 35;
}
.subnav-inner {
  width: 100%;
  padding: 0.36rem clamp(1rem, 2.8vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.subnav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.subnav-link {
  background: none;
  border: 1px solid transparent;
  color: #f3e8f6;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.subnav-link:hover, .subnav-link.active {
  background: rgba(196, 21, 137, .26);
  border-color: rgba(196, 21, 137, .45);
  color: #fff;
  text-decoration: none !important;
}
.subnav-cat-wrap { position: relative; }
.subnav-cat-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  font-weight: 700;
}
.subnav-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 0.2rem;
}
.subnav-deal-pill {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--cisisa-magenta);
  color: #fff;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.subnav-cat-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 260px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
  padding: 0.4rem;
  z-index: 40;
}
.subnav-cat-menu.open { display: block; }
[data-theme="dark"] .subnav-cat-menu {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.subnav-cat-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.subnav-cat-item:hover, .subnav-cat-item.active {
  background: var(--primary-light);
  color: var(--primary);
}
.subnav-cat-count {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}
.subnav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.subnav-trust-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(196, 21, 137, 0.18);
  border: 1px solid rgba(196, 21, 137, 0.42);
  color: #fce7f3;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.subnav-trust-btn:hover {
  background: rgba(196, 21, 137, 0.34);
  color: #fff;
}

@media (max-width: 1180px) {
  .subnav-right { display: none; }
  .topbar-inner { gap: 0.55rem; }
}
@media (max-width: 960px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 0.55rem; }
  .search-bar { order: 3; flex: 1 0 100%; margin: 0; }
  .nav-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .nav-location { padding: 0.3rem 0.45rem; max-width: 120px; }
  .nav-location .nav-kicker { display: none; }
  .nav-orders-tile { display: none !important; }
  .nav-cart-tile .nav-stack { display: none; }
  .nav-account-trigger .nav-kicker { display: none; }
  .search-cat-wrap select { max-width: 100px; font-size: 0.76rem; padding-left: 0.5rem; }
}

/* ── Franja de confianza ───────────────────────────────────────────── */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}
.trust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.05rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: var(--shadow);
}
.trust-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1.05rem;
}
.trust-card strong { display: block; font-size: 0.88rem; color: var(--text-strong); }
.trust-card span { font-size: 0.8rem; color: var(--text-muted); }

/* ── Secciones de Home, Tiendas y Ofertas ──────────────────────────── */
.section-block { margin-bottom: 2rem; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--text-strong); }

.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}
.store-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.store-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(196, 21, 137, .4);
}
.store-card-head { display: flex; align-items: center; gap: 0.75rem; }
.store-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cisisa-purple), var(--cisisa-magenta));
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.store-avatar img { width: 100%; height: 100%; object-fit: cover; }

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}
[data-theme="dark"] .verified-badge {
  background: rgba(59, 130, 246, .2);
  color: #93c5fd;
}

.store-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Toolbar de catálogo y calificaciones ──────────────────────────── */
.catalog-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.toolbar-controls input[type="number"],
.toolbar-controls select {
  padding: 0.36rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.84rem;
}

.product-img-wrap, .product-title { cursor: pointer; }
.product-title:hover { color: var(--primary); }
.product-rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.stars { color: #f59e0b; letter-spacing: 1px; font-weight: 700; }

/* ── Detalle de producto, Preguntas y Reseñas ──────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.vendor-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0.85rem 0;
}
.qa-item, .review-item {
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
}
.qa-item:last-child, .review-item:last-child { border-bottom: none; }
.qa-answer {
  margin-top: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 8px 8px 0;
  font-size: 0.87rem;
}
.legal-pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.89rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

/* ── Acordeón FAQ (Centro de Ayuda) ────────────────────────────────── */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.9rem 1.1rem;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.faq-q:hover { background: var(--primary-light); }
.faq-a {
  display: none;
  padding: 0 1.1rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.faq-item.open .faq-a { display: block; }

/* ── Footer Multi-columna ──────────────────────────────────────────── */
.site-footer {
  background: var(--cisisa-dark);
  color: #e9d5ec;
  margin-top: 2rem;
  padding: 2.5rem clamp(1.25rem, 3vw, 2.75rem) 1.5rem;
  border-top: 3px solid var(--cisisa-magenta);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.site-footer h4 { margin: 0 0 0.75rem; color: #fff; font-size: 0.94rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.42rem; font-size: 0.85rem; }
.site-footer a, .footer-link-btn {
  color: #d8b4de;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.site-footer a:hover, .footer-link-btn:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #b794be;
}
