@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300..900&display=swap');

:root {
  --toffe: #D4A574;
  --terracota: #B8756C;
  --terracota-dark: #9e5f57;
  --crema: #F5EDE3;
  --crema-dark: #e8ddd0;
  --grafito: #4A4A4A;
  --grafito-light: #777;
  --purple: #764ba2;
  --purple-dark: #5a3d7a;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #e74c3c;
  --white: #FFFFFF;
  --bg: #FDFAF5;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--grafito);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Header */
.store-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--crema-dark);
  padding: 0 24px;
}
.store-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.store-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--terracota);
  letter-spacing: -0.5px;
}
.store-logo span { color: var(--grafito); }
.store-nav { display: flex; align-items: center; gap: 24px; }
.store-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grafito);
  transition: color 0.2s;
}
.store-nav a:hover { color: var(--terracota); }
.admin-link {
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--grafito);
  color: white !important;
  padding: 6px 14px;
  border-radius: 30px;
  transition: background 0.2s;
}
.admin-link:hover { background: #333; }

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--crema);
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 600;
  transition: background 0.2s;
}
.cart-link:hover { background: var(--crema-dark); }
.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--terracota);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Hero */
.hero {
  background: var(--crema);
  padding: 60px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(212, 165, 116, 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}
.hero-tag {
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--terracota);
  font-weight: 600;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--grafito);
  line-height: 1.15;
  margin-bottom: 12px;
}
.hero p {
  font-size: 1.1rem;
  color: var(--grafito-light);
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.hero-cta {
  display: inline-block;
  background: var(--terracota);
  color: white;
  padding: 14px 40px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.15s;
}
.hero-cta:hover {
  background: var(--terracota-dark);
  transform: translateY(-1px);
}

/* Section */
.section { padding: 48px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--grafito);
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--white);
  border: 1px solid var(--crema-dark);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.category-card:hover {
  border-color: var(--terracota);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.category-card .icon {
  width: 48px;
  height: 48px;
  background: var(--crema);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.3rem;
}
.category-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
}
.category-card .count {
  font-size: 0.8rem;
  color: var(--grafito-light);
  margin-top: 4px;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--crema-dark);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s;
}
.product-card:hover {
  border-color: var(--terracota);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.product-card-image {
  display: block;
  width: 100%;
  height: 200px;
  background: var(--crema);
  overflow: hidden;
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-card:hover .product-card-image img {
  transform: scale(1.05);
}
.product-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crema-dark);
  font-size: 2.5rem;
}
.product-card-body { padding: 16px; }
.product-card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--terracota);
  font-weight: 600;
  margin-bottom: 4px;
}
.product-card-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--grafito);
  line-height: 1.3;
}
.product-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--grafito);
  margin-bottom: 8px;
}
.stock-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.stock-badge.in-stock { background: #e8f5e9; color: #2e7d32; }
.stock-badge.low-stock { background: #fff3e0; color: #e65100; }
.stock-badge.out-of-stock { background: #fce4ec; color: #c62828; }
.btn-add-cart {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--terracota);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-add-cart:hover { background: var(--terracota-dark); }
.btn-add-cart:disabled {
  background: #ddd;
  color: #999;
  cursor: not-allowed;
}

/* Product detail */
.product-detail {
  max-width: 1000px;
  margin: 48px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.product-detail-image {
  width: 100%;
  min-height: 300px;
  background: var(--crema);
  border-radius: var(--radius);
  overflow: hidden;
}
.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-detail-info h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.product-detail-info .category-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--terracota);
  font-weight: 600;
  margin-bottom: 12px;
}
.product-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--grafito);
  margin-bottom: 16px;
}
.product-detail-desc {
  color: var(--grafito-light);
  line-height: 1.7;
  margin-bottom: 20px;
}
.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.qty-selector button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--crema-dark);
  background: var(--white);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-selector button:hover { background: var(--crema); }
.qty-selector span {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}
.btn-add-cart-lg {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--terracota);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-add-cart-lg:hover { background: var(--terracota-dark); }
.btn-add-cart-lg:disabled {
  background: #ddd;
  color: #999;
  cursor: not-allowed;
}

/* Cart page */
.cart-page { max-width: 800px; margin: 0 auto; padding: 48px 24px; }
.cart-items { margin-bottom: 24px; }
.cart-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--crema-dark);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.cart-item-image {
  width: 80px;
  height: 80px;
  background: var(--crema);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; margin-bottom: 4px; }
.cart-item-price { color: var(--grafito-light); font-size: 0.9rem; }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-item-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--crema-dark);
  background: var(--white);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-qty span { font-weight: 600; min-width: 20px; text-align: center; }
.cart-item-remove {
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  background: none;
  border: none;
  padding: 4px 8px;
}
.cart-summary {
  background: var(--white);
  border: 1px solid var(--crema-dark);
  border-radius: var(--radius);
  padding: 24px;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  border-top: 2px solid var(--crema);
  padding-top: 12px;
  margin-top: 12px;
}
.btn-checkout {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--terracota);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-checkout:hover { background: var(--terracota-dark); }

/* Checkout */
.checkout-page { max-width: 700px; margin: 0 auto; padding: 48px 24px; }
.checkout-page h1 { margin-bottom: 24px; }
.checkout-form { background: var(--white); border: 1px solid var(--crema-dark); border-radius: var(--radius); padding: 32px; }
.checkout-form .field { margin-bottom: 20px; }
.checkout-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--grafito);
}
.checkout-form input, .checkout-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--crema-dark);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.checkout-form input:focus, .checkout-form textarea:focus {
  outline: none;
  border-color: var(--terracota);
  box-shadow: 0 0 0 3px rgba(184, 117, 108, 0.1);
}
.checkout-form textarea { resize: vertical; min-height: 80px; }
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.payment-option {
  padding: 16px;
  border: 2px solid var(--crema-dark);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 0.9rem;
}
.payment-option:hover { border-color: var(--terracota); }
.payment-option.selected { border-color: var(--terracota); background: var(--crema); }

/* Order confirmation */
.order-confirm { max-width: 600px; margin: 0 auto; padding: 80px 24px; text-align: center; }
.order-confirm .check-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
  color: white;
}
.order-confirm h1 { font-size: 1.8rem; margin-bottom: 8px; }
.order-confirm p { color: var(--grafito-light); margin-bottom: 24px; }

/* Breadcrumb */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 0.8rem;
  color: var(--grafito-light);
}
.breadcrumb a { color: var(--terracota); }
.breadcrumb a:hover { text-decoration: underline; }

/* Footer */
.store-footer {
  background: var(--grafito);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px;
  margin-top: 48px;
}
.store-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.store-footer h3 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.store-footer p, .store-footer a { font-size: 0.85rem; line-height: 1.8; color: rgba(255,255,255,0.6); }
.store-footer a:hover { color: white; }
.store-footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* Loading skeleton */
.skeleton-card {
  background: var(--white);
  border: 1px solid var(--crema-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.skeleton-img {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, #f0ebe4 25%, #e8ddd0 50%, #f0ebe4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-body { padding: 16px; }
.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f0ebe4 25%, #e8ddd0 50%, #f0ebe4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 8px;
}
.skeleton-line:last-child { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast */
#toastContainer {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--purple); }
.toast-fade { animation: fadeOut 0.3s ease forwards; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--grafito-light);
}
.empty-state h3 { font-size: 1.2rem; color: var(--grafito); margin-bottom: 8px; }
.empty-state p { margin-bottom: 16px; }
.empty-state .btn-primary {
  display: inline-block;
  background: var(--terracota);
  color: white;
  padding: 10px 28px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 40px 20px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .product-card-image { height: 140px; }
  .product-detail { grid-template-columns: 1fr; gap: 24px; margin: 24px auto; }
  .store-footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .payment-options { grid-template-columns: 1fr; }
  .store-nav a:not(.cart-link) { display: none; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-card-image { height: 120px; }
  .product-card-body { padding: 10px; }
  .product-card-name { font-size: 0.85rem; }
  .product-card-price { font-size: 1rem; }
}

/* WhatsApp floating button */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  color: white;
  font-size: 1.6rem;
}
.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}
@media (max-width: 480px) {
  .whatsapp-float { width: 48px; height: 48px; font-size: 1.3rem; bottom: 16px; right: 16px; }
}
