/* =========================================
   PIWA STORE — Stylesheet v3
   Apple-style light theme (white)
   ========================================= */

/* ── 1. DESIGN TOKENS ──────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:            #ffffff;
  --bg-2:          #f5f5f7;
  --bg-card:       #f5f5f7;
  --bg-card-hi:    #ffffff;
  --border:        #d2d2d7;
  --border-strong: #b8b8bf;

  /* Text */
  --text:          #1d1d1f;
  --text-muted:    #6e6e73;

  /* Brand */
  --accent:        #0071e3;
  --accent-h:      #0077ed;
  --accent-2:      #0891b2;
  --accent-3:      #d946ef;
  --accent-soft:   rgba(0, 113, 227, 0.10);

  --gradient:      linear-gradient(120deg, #0071e3 0%, #6d5efc 55%, #a855f7 100%);
  --gradient-warm: linear-gradient(120deg, #f59e0b 0%, #ec4899 100%);

  --green:         #25d366;
  --green-dark:    #1ebe5a;
  --urgent-color:  #e11d48;

  --glow:          0 6px 22px rgba(0, 113, 227, 0.25);
  --glow-soft:     0 18px 44px rgba(0, 0, 0, 0.10);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  /* aliases kept for cart-page compatibility */
  --text-main:    #1d1d1f;
  --card-bg:      #f5f5f7;
  --border-light: #e5e5ea;
}

/* ── 2. RESET & BASE ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  /* Very faint Apple-style colour tint at the top */
  background-image:
    radial-gradient(900px 600px at 12% -10%, rgba(0, 113, 227, 0.06), transparent 60%),
    radial-gradient(800px 520px at 90% -8%,  rgba(168, 85, 247, 0.05), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

[hidden] { display: none !important; }

::selection {
  background: rgba(0, 113, 227, 0.22);
  color: #1d1d1f;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f5f5f7; }
::-webkit-scrollbar-thumb {
  background: #c7c7cc;
  border-radius: 10px;
  border: 2px solid #f5f5f7;
}
::-webkit-scrollbar-thumb:hover { background: #a1a1a6; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── 3. NAVIGATION ──────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
}

.nav::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 113, 227, 0.35), rgba(168, 85, 247, 0.25), transparent);
}

.nav-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--gradient);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: filter 0.2s;
}

.logo:hover { filter: brightness(0.85); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
}

.nav-links a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.25);
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s;
}

.cart-btn:hover {
  transform: translateY(-2px);
  background-color: var(--accent-h);
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.38);
}

/* ── 4. HERO ────────────────────────────────────────────── */
.hero {
  min-height: 580px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 40px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.hero-text h1 {
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  background: linear-gradient(100deg, #0071e3 0%, #6d5efc 40%, #a855f7 70%, #0071e3 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 9s ease-in-out infinite;
}

.hero-text h1 span { display: inline; }

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-text p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
}

/* Soft gradient frame around the hero image */
.hero > div:last-child {
  position: relative;
  padding: 2px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: linear-gradient(140deg,
    rgba(0, 113, 227, 0.55),
    rgba(168, 85, 247, 0.35),
    rgba(8, 145, 178, 0.35));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.10);
}

.hero-image {
  width: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  aspect-ratio: 4 / 3;
  filter: contrast(1.03) saturate(1.05);
}

/* ── 5. PRIMARY BUTTON ──────────────────────────────────── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 15px 34px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.28);
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s;
}

.primary-btn:hover {
  background-color: var(--accent-h);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 113, 227, 0.38);
}

.primary-btn:active { transform: translateY(0); }

/* ── 6. WHATSAPP CTA SECTION ────────────────────────────── */
.whatsapp-section {
  display: flex;
  justify-content: center;
  padding: 40px 40px 0;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, #25d366 0%, #12b981 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 15px 34px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.30);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.whatsapp-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.42);
}

.whatsapp-btn svg { flex-shrink: 0; }

/* ── 7. PRODUCTS SECTION ────────────────────────────────── */
.products-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 40px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 14px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 68px;
  height: 4px;
  border-radius: 4px;
  background: var(--gradient);
}

#product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── 8. PRODUCT CARD ────────────────────────────────────── */
.product-card {
  position: relative;
  background: var(--bg-card-hi);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: var(--glow-soft);
}

.product-card:hover::before { transform: scaleX(1); }

.product-image-wrapper {
  position: relative;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 15%, #ffffff 0%, #f0f0f3 75%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.05) contrast(1.02);
  transition: transform 0.4s ease, filter 0.4s ease;
}

.product-card:hover .product-image-wrapper img {
  transform: scale(1.05);
  filter: saturate(1.15) contrast(1.04);
}

.product-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  background: var(--gradient-warm);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.30);
}

.product-card h3 {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
  line-height: 1.3;
  transition: color 0.2s;
}

.product-card:hover h3 { color: var(--accent); }

.product-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
  flex-grow: 1;
  line-height: 1.5;
}

.price-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.current-price {
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.3px;
}

.old-price {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 0.9rem;
}

.discount-label {
  color: #1a7f37;
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.32);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.add-to-cart {
  width: 100%;
  height: 44px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.3px;
  margin-top: auto;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.20);
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s, opacity 0.15s;
}

.add-to-cart:hover:not(:disabled) {
  background-color: var(--accent-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.32);
}

.add-to-cart:active:not(:disabled) { transform: translateY(0); }

.add-to-cart:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

/* ── 9. FOOTER ──────────────────────────────────────────── */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border-light);
  padding: 60px 40px 40px;
  margin-top: 40px;
  position: relative;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 240px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.15s, transform 0.15s;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding-top: 28px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── 10. CART PAGE ──────────────────────────────────────── */
.cart-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px 80px;
}

.cart-page .section-title { margin-bottom: 40px; }

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: start;
}

.cart-lines { min-width: 0; }

.cart-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card-hi);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cart-line:hover {
  border-color: rgba(0, 113, 227, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.cart-line-img {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  object-fit: contain;
  background: radial-gradient(circle at 50% 20%, #ffffff, #f0f0f3);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.cart-line-info { flex: 1 1 200px; min-width: 0; }

.cart-line-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text);
}

.cart-line-price {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card-hi);
}

.qty-control button {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-2);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.12s, color 0.12s;
}

.qty-control button:hover {
  background: var(--accent);
  color: #fff;
}

.qty-control input {
  width: 48px;
  height: 36px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font: inherit;
  font-size: 0.95rem;
  background: var(--bg-card-hi);
  color: var(--text);
  -moz-appearance: textfield;
}

.qty-control input:focus {
  outline: none;
  background: rgba(0, 113, 227, 0.06);
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-line-total {
  font-weight: 800;
  font-size: 1.05rem;
  min-width: 90px;
  text-align: right;
  color: var(--accent);
}

.remove-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.remove-btn:hover { color: var(--urgent-color); }

.cart-summary {
  position: sticky;
  top: 84px;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card-hi);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.07);
}

.cart-summary h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: var(--text);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.summary-row.total {
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  margin-top: 16px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

#cart-total {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.cart-summary .add-to-cart { margin-top: 20px; }

.link-btn {
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s;
}

.link-btn:hover { color: var(--urgent-color); }

.cart-empty {
  text-align: center;
  padding: 80px 20px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--bg-2);
}

.cart-empty p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

/* ── 11. RESPONSIVE — Mobile ────────────────────────────── */
@media (max-width: 768px) {
  .nav-content {
    padding: 0 20px;
    gap: 16px;
  }

  .nav-links { display: none; }

  .hero {
    grid-template-columns: 1fr;
    padding: 48px 20px 60px;
    min-height: auto;
    text-align: center;
  }

  .hero-text { align-items: center; }
  .hero-text p { max-width: 100%; }

  .hero-image {
    max-height: 280px;
    object-position: center top;
  }

  .section-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .whatsapp-section { padding: 28px 20px 0; }

  .products-section { padding: 48px 20px; }

  #product-grid { grid-template-columns: 1fr; }

  .footer { padding: 48px 20px 32px; }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
  }

  .footer-brand p { max-width: 100%; }

  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-page { padding: 40px 20px 60px; }
  .cart-line-total { text-align: left; }
}

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-page { padding: 40px 20px 60px; }
  .cart-line-total { text-align: left; }
}

/* ── 12. MOTION PREFERENCES ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}