/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --secondary: #F97316;
  --secondary-dark: #EA580C;
  --secondary-light: #FFEDD5;
  --accent: #FB923C;
  --text: #111827;
  --text-muted: #6B7280;
  --bg: #ffffff;
  --bg-soft: #F8FAFC;
  --border: #E2E8F0;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(17 24 39 / 0.05);
  --shadow: 0 10px 15px -3px rgb(37 99 235 / 0.1), 0 4px 6px -4px rgb(37 99 235 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(37 99 235 / 0.15), 0 8px 10px -6px rgb(37 99 235 / 0.1);
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  display: block;
  width: auto;
  height: 44px;
  max-width: 160px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--primary);
}

.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -14px;
  background: var(--secondary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  border-color: var(--secondary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-ghost:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  background: var(--primary-light);
  padding: 4rem 0 4.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero h1 .text-primary {
  color: var(--primary);
}

.hero-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: rgba(59, 130, 246, 0.12);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Sections */
.page-section {
  padding: 3rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 1.875rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  margin: 0;
}

.products-section {
  padding: 4rem 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.product-grid.small {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .product-grid.small {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-image img[src*="product-placeholder.png"] {
  object-fit: contain;
  padding: 1rem;
}

.product-card:hover .product-image img {
  transform: scale(1.03);
}

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.product-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.product-body h3 a:hover {
  color: var(--primary);
}

.product-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

.product-price {
  font-weight: 800;
  font-size: 1.1rem;
}

/* How it works */
.how-it-works {
  background: var(--bg);
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.875rem;
  font-weight: 800;
  margin: 0 0 2.5rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.step {
  text-align: center;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.step p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Product detail */
.product-detail {
  padding: 3rem 0;
  background: var(--bg);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.product-media {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.product-info h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.5rem 0 1rem;
}

.product-price-large {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 1rem;
}

.product-info .product-description {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.feature-list li {
  padding-left: 1.75rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.feature-list li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  color: var(--primary);
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.related-products {
  padding: 3rem 0;
}

.related-products h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Cart */
.cart-section h1 {
  font-size: 1.875rem;
  margin-bottom: 1.5rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.cart-empty p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.cart-content {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.cart-items {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 56px;
  background: var(--bg-soft);
  border-radius: 8px;
  overflow: hidden;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.cart-item-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 700;
  cursor: pointer;
}

.qty-btn:hover {
  background: var(--bg-soft);
}

.remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.cart-summary {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  position: sticky;
  top: 96px;
}

.cart-summary h2 {
  font-size: 1.25rem;
  margin: 0 0 1.25rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.summary-row.total {
  border-bottom: none;
  font-size: 1.15rem;
  font-weight: 800;
  padding-top: 1rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Checkout */
.checkout-section h1 {
  font-size: 1.875rem;
  margin-bottom: 1.5rem;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

.checkout-form-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.checkout-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.checkout-form legend {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.payment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.payment-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.payment-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.payment-option.active,
.payment-option:hover {
  border-color: var(--primary);
  background: #f0fdfa;
}

.payment-icon {
  font-size: 1.75rem;
}

.payment-label {
  font-weight: 700;
}

.payment-option small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.checkout-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 96px;
}

.checkout-summary h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.checkout-processing {
  text-align: center;
  padding: 3rem 1rem;
}

.checkout-processing h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.checkout-processing p {
  color: var(--text-muted);
}

/* Order page */
.order-section {
  padding: 2.5rem 0;
}

.order-status-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.order-status-card h1 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

.status-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-paid,
.status-delivered {
  background: #d1fae5;
  color: #065f46;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.order-meta {
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.order-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}

.order-details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.order-details h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.order-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.order-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.order-items li small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding: 1.25rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.receipt-box {
  margin-top: 1.25rem;
  padding: 1rem;
  background: #EFF6FF;
  border-radius: 8px;
  font-size: 0.95rem;
}

.order-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.delivery-box,
.contact-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.delivery-box h2,
.contact-box h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.delivery-box p,
.contact-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.delivery-box.pending {
  text-align: center;
}

.delivery-box.failed {
  border-color: #fecaca;
  background: #fef2f2;
}

.download-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  background: var(--text);
  color: #fff;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  transition: transform 0.3s ease;
  z-index: 200;
  font-weight: 500;
}

.toast.show {
  transform: translateY(0);
}

.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Category links */
.category-links {
  margin-top: 3rem;
  text-align: center;
}

.category-links h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.category-pill {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.category-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.category-pill-all {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.category-pill-all:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Products page */
.products-page .section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.category-section {
  margin-bottom: 3rem;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

/* Footer */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.footer-grid p,
.footer-grid a {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
}

.footer-grid a:hover {
  color: var(--primary);
}

.copyright {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Mobile responsiveness */
@media (max-width: 900px) {
  .product-detail-grid,
  .cart-content,
  .checkout-grid,
  .order-grid {
    grid-template-columns: 1fr;
  }

  .cart-summary,
  .checkout-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .main-nav.open {
    display: flex;
  }

  .hero {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .product-actions,
  .hero-actions {
    flex-direction: column;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-item-image {
    width: 100%;
    height: 140px;
  }

  .cart-item-actions {
    justify-content: space-between;
  }
}
