/* ============================================================
   ShopZap – Estilos principales v1.1
   ============================================================ */

:root {
  --sz-primary:    #25D366;
  --sz-secondary:  #833AB4;
  --sz-accent:     #FF6B35;
  --sz-dark:       #1a1a2e;
  --sz-sidebar-w:  260px;
  --sz-topbar-h:   60px;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; margin: 0; }

/* ─── Brand ──────────────────────────────────────────────── */
.brand-logo    { font-size: 1.8rem; }
.brand-name    { font-size: 1.5rem; font-weight: 800; background: linear-gradient(135deg, var(--sz-primary), var(--sz-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand-logo-sm { font-size: 1.4rem; }
.brand-name-sm { font-size: 1.2rem; font-weight: 700; background: linear-gradient(135deg, var(--sz-primary), var(--sz-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ─── Botones ────────────────────────────────────────────── */
.btn-zap {
  background: linear-gradient(135deg, var(--sz-primary), #1db954) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  transition: all .2s;
}
.btn-zap:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(37,211,102,.4); }

.btn-whatsapp {
  background-color: #25D366 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  transition: all .2s;
}
.btn-whatsapp:hover { background-color: #1ebe5d !important; transform: translateY(-1px); }

.btn-instagram {
  background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  transition: all .2s;
}
.btn-instagram:hover { transform: translateY(-1px); filter: brightness(1.1); }

.text-zap { color: var(--sz-primary) !important; }
.text-gradient { background: linear-gradient(135deg, var(--sz-primary), var(--sz-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ─── AUTH ───────────────────────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, #f0fdf4 0%, #faf5ff 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-wrapper { width: 100%; max-width: 440px; }
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.1);
}

/* ─── PANEL SIDEBAR ──────────────────────────────────────── */
.panel-body {
  background: #f8f9fa;
  min-height: 100vh;
}

.sz-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sz-sidebar-w);
  height: 100vh;
  background: var(--sz-dark);
  overflow-y: auto;
  z-index: 1040;
  transition: transform .3s;
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
}

@media (max-width: 991px) {
  .sz-sidebar { transform: translateX(-100%); }
  .sz-sidebar.open { transform: translateX(0); }
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-close { color: rgba(255,255,255,.6); background: none; border: none; cursor: pointer; }

.sidebar-user {
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: .5rem;
  flex-shrink: 0;
}
.user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--sz-primary), var(--sz-secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.user-name  { color: #fff; font-size: .85rem; font-weight: 600; line-height: 1.2; }
.user-plan  { color: rgba(255,255,255,.5); font-size: .72rem; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; flex: 1; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1.5rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .875rem;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: #fff;
  background: rgba(255,255,255,.06);
  border-left-color: var(--sz-primary);
}
.nav-label {
  padding: .4rem 1.5rem .2rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
  font-weight: 600;
}

.sidebar-footer { padding: .75rem 1.5rem; flex-shrink: 0; }
.sidebar-logout { color: rgba(255,255,255,.5); text-decoration: none; font-size: .85rem; display: flex; align-items: center; gap: .5rem; }
.sidebar-logout:hover { color: #ff6b6b; }

.sz-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--sz-topbar-h);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center;
  padding: 0 1.25rem;
  z-index: 1030;
  gap: 1rem;
}
@media (min-width: 992px) { .sz-topbar { left: var(--sz-sidebar-w); } }

.sz-main {
  padding-top: calc(var(--sz-topbar-h) + 1.5rem);
  padding-bottom: 2rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  min-height: 100vh;
}
@media (min-width: 992px) { .sz-main { margin-left: var(--sz-sidebar-w); } }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* ─── Cards ──────────────────────────────────────────────── */
.sz-card { border: 1px solid #e9ecef !important; border-radius: 12px !important; box-shadow: 0 2px 8px rgba(0,0,0,.04) !important; }
.sz-card .card-header { background: #fff !important; border-bottom: 1px solid #f1f3f4 !important; padding: .875rem 1.25rem; border-radius: 12px 12px 0 0 !important; }

/* ─── Stats ──────────────────────────────────────────────── */
.stat-card {
  padding: 1.25rem;
  border-radius: 12px;
  text-align: center;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: .78rem; opacity: .75; font-weight: 500; margin-top: .2rem; }
.stat-sub   { font-size: .72rem; opacity: .6; }

/* ─── Page header ────────────────────────────────────────── */
.page-header { border-bottom: 1px solid #e9ecef; padding-bottom: 1rem; margin-bottom: 1.5rem; }

/* ─── Store avatar ───────────────────────────────────────── */
.store-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--sz-primary), var(--sz-secondary));
  border-radius: 8px;
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ─── Empty state ────────────────────────────────────────── */
.empty-state .empty-icon { font-size: 4rem; }

/* ─── Upload zone ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
  position: relative;
}
.upload-zone:hover { border-color: var(--sz-primary); }
.upload-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.img-preview-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.img-preview-row img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }

/* ─── No image thumb ─────────────────────────────────────── */
.no-img-thumb {
  width: 48px; height: 48px;
  background: #f8f9fa;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Qty control ────────────────────────────────────────── */
.qty-control button { background: none; border: none; line-height: 1; font-size: 1.1rem; cursor: pointer; }

/* ─── LANDING ────────────────────────────────────────────── */
.landing-body { overflow-x: hidden; }

.hero-section {
  background: linear-gradient(135deg, #f0fdf4 0%, #faf5ff 50%, #fff7ed 100%);
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(37,211,102,.15), rgba(131,58,180,.15));
  border: 1px solid rgba(37,211,102,.3);
  color: #16a34a;
  font-size: .875rem;
  font-weight: 600;
  padding: .4rem 1rem;
  border-radius: 100px;
}

.integration-logo {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  font-size: .75rem; font-weight: 600; color: #6b7280;
}

.feature-card { border-radius: 16px !important; transition: transform .2s; }
.feature-card:hover { transform: translateY(-4px); }
.feature-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

.pricing-card { border-radius: 20px !important; transition: transform .2s; }
.pricing-card:hover { transform: translateY(-4px); }

.cta-section {
  background: linear-gradient(135deg, var(--sz-primary), var(--sz-secondary));
}

/* ─── TIENDA PÚBLICA ─────────────────────────────────────── */
.store-body { background: #f8f9fa; }

.store-navbar {
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.06) !important;
  border-bottom: 3px solid var(--sz-primary) !important;
  padding: .5rem 0;
}

.store-name-nav { font-weight: 700; font-size: 1.1rem; color: #1a1a2e; }

.btn-store-primary {
  background: var(--sz-primary) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  transition: all .2s;
  border-radius: 8px;
}
.btn-store-primary:hover { filter: brightness(1.1); color: #fff !important; transform: translateY(-1px); }

/* Store header banner */
.store-banner {
  height: 280px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.store-banner-overlay {
  background: rgba(0,0,0,.5);
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 1rem;
}
.store-header-simple {
  padding: 2.5rem 1rem;
  text-align: center;
}

/* Cart badge */
.cart-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: .65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
  transition: transform .2s;
}
.btn-cart { position: relative; }

/* ─── PRODUCT CARD ─────────────────────────────────────────── */
.product-card {
  border-radius: 14px !important;
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
  border: 1px solid #eee !important;
  background: #fff;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12) !important;
}

/* Imagen del producto: cuadrada y fija */
.product-img-wrapper {
  position: relative;
  overflow: hidden;
  background: #f1f3f4;
  width: 100%;
  padding-top: 100%; /* aspect-ratio 1:1 compatible con todos los browsers */
}
.product-img-wrapper > img,
.product-img-wrapper > .product-img,
.product-img-wrapper > .product-img-placeholder,
.product-img-wrapper > .product-out-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.product-img {
  object-fit: cover;
  transition: transform .3s;
  display: block;
}
.product-card:hover .product-img { transform: scale(1.06); }

.product-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: #f1f3f4;
  color: #adb5bd;
}

.product-badge-discount {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: #ef4444; color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: 6px;
  box-shadow: 0 2px 6px rgba(239,68,68,.3);
}

.product-out-overlay {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(0,0,0,.5);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  letter-spacing: .03em;
}

.product-name {
  font-size: .875rem;
  line-height: 1.35;
  font-weight: 600;
  color: #1a1a2e;
}

/* Card body */
.product-card .card-body {
  padding: .75rem !important;
}

/* ─── PRODUCT DETAIL ─────────────────────────────────────── */
.product-gallery-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  background: #f8f9fa;
  border-radius: 12px;
}
.product-img-placeholder-lg {
  width: 100%;
  aspect-ratio: 1;
  background: #f1f3f4;
  display: flex; align-items: center; justify-content: center;
  max-height: 400px;
  border-radius: 12px;
  color: #adb5bd;
}
.product-thumb {
  width: 64px; height: 64px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  flex-shrink: 0;
  transition: border-color .15s;
}
.product-thumb.active,
.product-thumb:hover { border-color: var(--sz-primary); }

.variant-btn {
  min-width: 48px;
  border-radius: 8px !important;
  font-weight: 500;
  transition: all .15s;
}
.variant-btn.active {
  background: var(--sz-primary) !important;
  color: #fff !important;
  border-color: var(--sz-primary) !important;
}

/* ─── CART & CHECKOUT ────────────────────────────────────── */
.cart-item { transition: background .15s; }
.cart-item:hover { background: #f8f9fa; }

/* Store categories sidebar */
.store-categories .list-group-item { border: none; border-radius: 0; font-size: .9rem; }
.store-categories .list-group-item.active {
  background: var(--sz-primary) !important;
  border-color: var(--sz-primary) !important;
  color: #fff !important;
  font-weight: 600;
}
.store-categories .list-group-item:hover:not(.active) { background: #f0fdf4; color: #1a1a2e; }

/* ─── STORE FOOTER ───────────────────────────────────────── */
.store-footer {
  background: var(--sz-dark);
  color: rgba(255,255,255,.7);
  border-top: 3px solid var(--sz-primary);
}
.store-footer a { color: rgba(255,255,255,.6); transition: color .15s; }
.store-footer a:hover { color: #fff; }

/* ─── WhatsApp float ─────────────────────────────────────── */
.wa-float {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 58px; height: 58px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(37,211,102,.6);
  z-index: 999;
  animation: wa-pulse 2.5s infinite;
  transition: transform .2s;
}
.wa-float:hover { color: #fff; transform: scale(1.1); }

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,.5); }
  50%       { box-shadow: 0 4px 30px rgba(37,211,102,.85), 0 0 0 8px rgba(37,211,102,.1); }
}

/* ─── Order success ──────────────────────────────────────── */
.success-checkmark { font-size: 5rem; animation: bounce .6s; }
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* ─── Payment options ────────────────────────────────────── */
.payment-option { cursor: pointer; transition: border-color .15s, background .15s; border-radius: 10px; }
.payment-option:has(input:checked) {
  border-color: var(--sz-primary) !important;
  background: rgba(37,211,102,.05);
}

/* ─── Dark mode ──────────────────────────────────────────── */
.dark-mode { background: #0f172a; color: #e2e8f0; }
.dark-mode .store-navbar { background: #1e293b !important; border-bottom-color: var(--sz-primary) !important; }
.dark-mode .store-name-nav { color: #e2e8f0; }
.dark-mode .product-card { background: #1e293b !important; border-color: #334155 !important; }
.dark-mode .product-name { color: #e2e8f0; }
.dark-mode .product-img-wrapper { background: #334155; }
.dark-mode .product-img-placeholder { background: #334155; }
.dark-mode .sz-card { background: #1e293b; border-color: #334155; }
.dark-mode .card-header { background: #1e293b; border-color: #334155; }
.dark-mode .store-categories .list-group-item { background: #1e293b; color: rgba(255,255,255,.7); }
.dark-mode .store-categories .list-group-item:hover:not(.active) { background: #334155; color: #fff; }
.dark-mode .form-control, .dark-mode .form-select { background: #1e293b; color: #e2e8f0; border-color: #334155; }

/* ─── Admin mode ─────────────────────────────────────────── */
.admin-mode .sz-sidebar { background: #1a0a2e; }
.admin-mode .sidebar-nav li a.active { border-left-color: #ef4444; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 767px) {
  .store-banner { height: 200px; }
  .store-header-simple { padding: 1.5rem 1rem; }
  .store-header-simple h1 { font-size: 1.5rem; }
}

@media (max-width: 576px) {
  .stat-value { font-size: 1.3rem; }
  .auth-card  { padding: 1.5rem; }
  .product-gallery-img { max-height: 280px; }
  .wa-float { width: 50px; height: 50px; font-size: 1.4rem; bottom: 16px; right: 16px; }
}

/* ─── Utility ────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }
