/* Stocky Commerce v2 — premium marketplace design system */
:root {
  --cv2-radius: 14px;
  --cv2-radius-lg: 20px;
  --cv2-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --cv2-shadow-hover: 0 16px 40px rgba(15, 23, 42, 0.14);
  --cv2-gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --cv2-surface: #ffffff;
  --cv2-muted: #f4f6fb;
  --cv2-text: #0f172a;
  --cv2-text-muted: #64748b;
  --cv2-sale: #ef4444;
  --cv2-success: #10b981;
}

[data-theme="dark"] {
  --cv2-surface: #1e293b;
  --cv2-muted: #0f172a;
  --cv2-text: #f1f5f9;
  --cv2-text-muted: #94a3b8;
  color-scheme: dark;
}
[data-theme="dark"] body { background: #0b1220 !important; }
[data-theme="dark"] .card,
[data-theme="dark"] .navbar,
[data-theme="dark"] .store-subnav { background: var(--cv2-surface) !important; color: var(--cv2-text); }

/* Skeleton loading */
.cv2-skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: cv2-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--cv2-radius);
}
@keyframes cv2-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Product card — compact marketplace size */
.cv2-product-card {
  background: var(--cv2-surface);
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.cv2-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}
.cv2-product-card__img-wrap {
  position: relative;
  /* Square tile + contain: see storefront-premium.css (.pcard-img-wrap shared rules) */
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.cv2-product-card__img {
  transition: transform 0.3s ease;
}
.cv2-product-card:hover .cv2-product-card__img { transform: scale(1.03); }
.cv2-product-card__actions {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.2s, transform 0.2s;
}
.cv2-product-card:hover .cv2-product-card__actions {
  opacity: 1;
  transform: translateX(0);
}
.cv2-icon-btn {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cv2-icon-btn:hover { background: var(--brand); color: #fff; }
.cv2-icon-btn.is-active { background: var(--brand); color: #fff; }

.cv2-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  color: #fff;
}
.cv2-badge--sale { background: var(--cv2-sale); }
.cv2-badge--new { background: var(--cv2-success); }
.cv2-badge--low_stock { background: #f59e0b; }
.cv2-badge--trending { background: var(--brand); }

.cv2-product-card__body { padding: 0.5rem 0.6rem 0.65rem; flex: 1; display: flex; flex-direction: column; }
.cv2-product-card__title {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--cv2-text);
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}
.cv2-product-card__price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--brand);
  margin-top: auto;
}
.cv2-product-card__price-old {
  font-size: 0.8rem;
  color: var(--cv2-text-muted);
  text-decoration: line-through;
  margin-left: 0.35rem;
  font-weight: 500;
}

/* Section headers */
.cv2-section {
  margin: 2.5rem 0;
}
.cv2-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.cv2-section__title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.cv2-section__link {
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

/* Flash sale countdown */
.cv2-flash-bar {
  background: var(--cv2-gradient);
  color: #fff;
  border-radius: var(--cv2-radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cv2-countdown { display: flex; gap: 0.5rem; }
.cv2-countdown__unit {
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.cv2-countdown__unit small { display: block; font-size: 0.55rem; opacity: 0.85; font-weight: 500; }

/* Horizontal product slider */
.cv2-slider {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.cv2-slider::-webkit-scrollbar { height: 6px; }
.cv2-slider::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.cv2-slider > * { flex: 0 0 148px; scroll-snap-align: start; max-width: 148px; }
@media (min-width: 768px) { .cv2-slider > * { flex: 0 0 168px; max-width: 168px; } }

/* Sticky mobile bottom nav */
.cv2-mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: var(--cv2-surface);
  border-top: 1px solid rgba(15,23,42,0.08);
  display: flex;
  justify-content: space-around;
  padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
@media (min-width: 992px) { .cv2-mobile-nav { display: none; } }
.cv2-mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  color: var(--cv2-text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}
.cv2-mobile-nav a.active, .cv2-mobile-nav a:hover { color: var(--brand); }
.cv2-mobile-nav i { font-size: 1.25rem; margin-bottom: 0.15rem; }
body.has-cv2-mobile-nav { padding-bottom: 72px; }

/* WhatsApp float */
.cv2-whatsapp {
  position: fixed;
  bottom: 5.5rem;
  right: 1rem;
  z-index: 1035;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s;
}
.cv2-whatsapp:hover { transform: scale(1.08); color: #fff; }
@media (min-width: 992px) { .cv2-whatsapp { bottom: 1.5rem; } }

/* Cart drawer enhancement */
#miniCart.offcanvas { max-width: 420px; }
.cv2-cart-pulse { animation: cv2-pulse 0.4s ease; }
@keyframes cv2-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* One-page checkout */
.cv2-checkout-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 992px) {
  .cv2-checkout-grid { grid-template-columns: 1fr 380px; }
}
.cv2-pay-option {
  border: 2px solid #e2e8f0;
  border-radius: var(--cv2-radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cv2-pay-option:has(input:checked) {
  border-color: var(--brand);
  background: rgba(108, 92, 231, 0.06);
}
.cv2-pay-option input { margin-right: 0.5rem; }

/* Dark mode toggle */
.cv2-theme-toggle {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

/* Quick view modal */
.cv2-quickview .modal-dialog { max-width: 900px; }
.cv2-quickview img { max-height: 360px; object-fit: contain; width: 100%; }

/* Shop horizontal scroll + legacy product-card slabs */
.shop-product-slab {
  width: 168px;
  max-width: 168px;
}
.store-compact-media,
.shop-product-slab .product-media.store-product-thumb {
  aspect-ratio: 1;
  height: auto;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-product-slab .product-media .store-product-thumb__img,
.store-compact-media .store-product-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.5rem;
}
.shop-product-slab .card-body {
  padding: 0.4rem 0.5rem !important;
}
.shop-product-slab .product-title {
  font-size: 0.72rem !important;
}

/* Shop infinite scroll sentinel */
#shop-infinite-sentinel { height: 1px; }

/* PWA install hint */
.cv2-pwa-banner {
  background: var(--cv2-gradient);
  color: #fff;
  border-radius: var(--cv2-radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: none;
}
.cv2-pwa-banner.is-visible { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
