/* Viva storefront — Arabic-first herbal & grocery mall (Fyfaa-inspired UX, original design) */

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

body:has(.storefront-viva) {
  background: #f5f2ec;
  font-family: "Cairo", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
}

body:has(.storefront-viva) .store-header,
body:has(.storefront-viva) .store-footer {
  display: none !important;
}

body:has(.storefront-viva) .store-main {
  padding: 0;
  max-width: none;
}

body.vv-drawer-open { overflow: hidden; }

.storefront-viva {
  --vv-bg: #f5f2ec;
  --vv-surface: #ffffff;
  --vv-ink: #1f2a22;
  --vv-muted: #6b756c;
  --vv-accent: #1b6b45;
  --vv-accent-dark: #145236;
  --vv-gold: #c9a227;
  --vv-cream: #faf7f0;
  --vv-border: #e4ddd0;
  --vv-radius: 14px;
  --vv-shadow: 0 10px 30px rgba(27, 42, 34, 0.08);
  background: var(--vv-bg);
  color: var(--vv-ink);
  font-family: "Cairo", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  padding-bottom: 5.5rem;
}

.storefront-viva * { box-sizing: border-box; }

.vv-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.vv-topstrip {
  background: linear-gradient(90deg, #145236, #1b6b45 50%, #145236);
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

/* Header */
.vv-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.vv-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--vv-accent-dark);
  text-decoration: none;
  white-space: nowrap;
}

.vv-search {
  flex: 1;
  min-width: 180px;
  display: flex;
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--vv-shadow);
}

.vv-search input {
  flex: 1;
  border: none;
  padding: 0.65rem 1rem;
  font: inherit;
  background: transparent;
  min-width: 0;
}

.vv-search button {
  border: none;
  background: var(--vv-accent);
  color: #fff;
  padding: 0 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.vv-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vv-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
}

.vv-cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--vv-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.vv-cart-count {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--vv-gold);
  color: #1f2a22;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vv-cart-count.is-empty { display: none; }

.vv-nav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vv-nav::-webkit-scrollbar { display: none; }

.vv-nav a {
  white-space: nowrap;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  color: var(--vv-ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.vv-nav a:hover { border-color: var(--vv-accent); color: var(--vv-accent); }

/* Hero */
.vv-hero {
  position: relative;
  border-radius: calc(var(--vv-radius) + 4px);
  overflow: hidden;
  margin-bottom: 1.25rem;
  min-height: 220px;
  background: linear-gradient(135deg, #1b6b45, #2d8a5c);
  color: #fff;
}

.vv-hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.vv-hero-body {
  position: relative;
  padding: 2rem 1.5rem;
  max-width: 520px;
}

.vv-hero-body h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
}

.vv-hero-body p {
  margin: 0 0 1rem;
  opacity: 0.92;
  line-height: 1.55;
}

.vv-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  background: #fff;
  color: var(--vv-accent-dark);
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.vv-cta-sm { padding: 0.5rem 1rem; font-size: 0.88rem; width: 100%; }
.vv-cta-block { width: 100%; }
.vv-cta:disabled { opacity: 0.5; cursor: not-allowed; }

/* Trust strip */
.vv-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 700px) {
  .vv-trust { grid-template-columns: repeat(2, 1fr); }
}

.vv-trust-item {
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  padding: 0.85rem;
  text-align: center;
}

.vv-trust-item strong {
  display: block;
  font-size: 0.88rem;
  color: var(--vv-accent-dark);
}

.vv-trust-item span {
  font-size: 0.78rem;
  color: var(--vv-muted);
}

/* Category circles */
.vv-section { margin-bottom: 2rem; }

.vv-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.vv-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.vv-link-more {
  color: var(--vv-accent);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}

.vv-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.85rem;
}

.vv-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--vv-ink);
  gap: 0.45rem;
}

.vv-cat-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--vv-surface);
  border: 2px solid var(--vv-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  transition: border-color 0.15s, transform 0.15s;
}

.vv-cat:hover .vv-cat-ring,
.vv-cat.is-active .vv-cat-ring {
  border-color: var(--vv-accent);
  transform: scale(1.04);
}

.vv-cat strong {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Product grid */
.vv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .vv-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
}

.vv-card {
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--vv-shadow);
}

.vv-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--vv-cream);
}

.vv-card-media .product-card-media,
.vv-card-media .product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vv-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: var(--vv-gold);
  color: #1f2a22;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.vv-card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.vv-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--vv-ink);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vv-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.vv-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--vv-accent-dark);
}

.vv-compare {
  font-size: 0.78rem;
  color: var(--vv-muted);
  text-decoration: line-through;
}

.vv-rail {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.vv-rail .vv-card {
  min-width: 180px;
  max-width: 200px;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.vv-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--vv-muted);
}

.vv-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.vv-pager a {
  color: var(--vv-accent);
  font-weight: 700;
  text-decoration: none;
}

/* Reviews */
.vv-reviews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.vv-review {
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  padding: 1rem;
}

.vv-review p { margin: 0.35rem 0; font-size: 0.9rem; line-height: 1.5; }
.vv-review small { color: var(--vv-muted); }
.vv-stars { color: var(--vv-gold); letter-spacing: 1px; }

/* Footer */
.vv-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 1rem;
  border-top: 1px solid var(--vv-border);
  text-align: center;
}

.vv-footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.vv-footer-grid a {
  color: var(--vv-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.vv-footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--vv-muted);
}

/* Bottom nav */
.vv-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  background: var(--vv-surface);
  border-top: 1px solid var(--vv-border);
  box-shadow: 0 -4px 20px rgba(27, 42, 34, 0.08);
  padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
}

.vv-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem;
  text-decoration: none;
  color: var(--vv-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.vv-bottom-nav a.is-active { color: var(--vv-accent); }

.vv-bn-ico { font-size: 1.15rem; }

/* Sticky cart bar */
.vv-sticky-cart {
  position: fixed;
  bottom: 4.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.vv-sticky-cart.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.vv-sticky-cart a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--vv-accent);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(27, 107, 69, 0.35);
  white-space: nowrap;
}

/* Cart drawer */
.vv-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.vv-drawer.is-open { pointer-events: auto; }

.vv-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 25, 20, 0.45);
  opacity: 0;
  transition: opacity 0.25s;
}

.vv-drawer.is-open .vv-drawer-backdrop { opacity: 1; }

.vv-drawer-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--vv-surface);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -12px 40px rgba(27, 42, 34, 0.15);
}

.vv-drawer.is-open .vv-drawer-panel { transform: translateY(0); }

.vv-drawer-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--vv-cream);
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--vv-muted);
}

.vv-drawer-success {
  text-align: center;
  margin-bottom: 0.5rem;
}

.vv-drawer-check {
  display: inline-flex;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8f5ee;
  color: var(--vv-accent);
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.vv-drawer-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--vv-accent-dark);
}

.vv-drawer-product {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  background: var(--vv-cream);
  border-radius: var(--vv-radius);
  margin-bottom: 1rem;
}

.vv-drawer-img-wrap {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}

.vv-drawer-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vv-drawer-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
}

.vv-drawer-meta {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--vv-muted);
}

.vv-drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.vv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: none;
  text-align: center;
}

.vv-btn-primary {
  background: var(--vv-accent);
  color: #fff;
}

.vv-btn-ghost {
  background: var(--vv-cream);
  color: var(--vv-ink);
  border: 1px solid var(--vv-border);
}

/* WhatsApp float */
.vv-whatsapp {
  position: fixed;
  bottom: 5.5rem;
  left: 1rem;
  z-index: 95;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: transform 0.15s;
}

.vv-whatsapp:hover { transform: scale(1.06); }

/* Product card media (shared partial) */
.storefront-viva .product-card-media { position: relative; width: 100%; height: 100%; }
.storefront-viva .product-card-img-main { width: 100%; height: 100%; object-fit: cover; display: block; }
.storefront-viva .product-card-img-alt {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.25s;
}
.storefront-viva .has-alt:hover .product-card-img-alt { opacity: 1; }
.storefront-viva .product-card-img-count {
  position: absolute; bottom: 6px; left: 6px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.68rem; padding: 0.15rem 0.4rem; border-radius: 6px;
}

/* PDP */
body.vv-pdp { background: var(--vv-bg, #f5f2ec); }
.nr-pdp-wrap, .vv-pdp-wrap { padding-top: 0.5rem; }

.vv-pdp-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .vv-pdp-layout { grid-template-columns: 1fr; }
}

.vv-pdp-main-img {
  aspect-ratio: 1;
  border-radius: var(--vv-radius);
  overflow: hidden;
  background: var(--vv-cream);
  border: 1px solid var(--vv-border);
}

.vv-pdp-main-img img { width: 100%; height: 100%; object-fit: cover; }

.vv-pdp-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  overflow-x: auto;
}

.vv-pdp-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #fff;
  flex-shrink: 0;
}

.vv-pdp-thumb.is-active { border-color: var(--vv-accent); }
.vv-pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }

.vv-pdp-title { margin: 0 0 0.65rem; font-size: 1.45rem; font-weight: 800; }

.vv-pdp-price-block {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.vv-pdp-price { font-size: 1.5rem; font-weight: 800; color: var(--vv-accent-dark); }
.vv-pdp-compare { text-decoration: line-through; color: var(--vv-muted); }
.vv-pdp-sale { background: var(--vv-gold); padding: 0.15rem 0.45rem; border-radius: 6px; font-size: 0.78rem; font-weight: 800; }

.vv-pdp-trust {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vv-pdp-trust li {
  background: #e8f5ee;
  color: var(--vv-accent-dark);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.vv-breadcrumb {
  font-size: 0.82rem;
  color: var(--vv-muted);
  margin-bottom: 1rem;
}

.vv-breadcrumb a { color: var(--vv-accent); text-decoration: none; font-weight: 600; }

/* Cart page skin */
.vv-cart-shell .cart-page {
  font-family: inherit;
  max-width: 1100px;
}

.vv-cart .cart-main,
.vv-cart .cart-sidebar,
.vv-cart .empty-cart {
  background: var(--vv-surface);
  border-color: var(--vv-border);
}

.vv-cart .checkout-btn,
.vv-cart .btn-primary { background: var(--vv-accent); border-radius: 999px; }
.vv-cart .summary-row.total { color: var(--vv-accent-dark); }

.vv-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.vv-alert--success { background: #e8f5ee; color: #145236; border: 1px solid #b8e0c8; }
.vv-alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.vv-alert--info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
