/* Deipo Groceries - Shared Styles (Dark Mode) */
:root {
  --ti-bg: #0f0f14;
  --ti-bg-alt: #1a1a24;
  --ti-bg-inv: #1a1a2e;
  --ti-fg: #f0f0f5;
  --ti-fg-alt: #9ca3af;
  --ti-accent: #388a77;
  --ti-accent-hover: #4a9d8a;
  --amber: #f59e0b;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --max-width: 1200px;
  --border: #2d2d3a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; color: var(--ti-fg); background: var(--ti-bg); line-height: 1.6; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ti-bg-alt); border-bottom: 1px solid var(--border);
  padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 40px; width: auto; display: block; }
.logo:hover img { opacity: 0.9; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { color: var(--ti-fg); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--ti-accent); }
.cart-btn {
  position: relative; background: var(--ti-accent); color: white; border: none;
  padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
}
.cart-btn:hover { background: var(--ti-accent-hover); color: white; }
.cart-badge {
  position: absolute; top: -6px; right: -6px; background: var(--amber); color: #000;
  font-size: 0.7rem; min-width: 1.2rem; height: 1.2rem; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.cart-badge.hidden { display: none; }

/* Main content */
main { max-width: var(--max-width); margin: 0 auto; padding: 2rem; min-height: 60vh; }

/* Buttons */
.btn { background: var(--ti-accent); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: 1rem; text-decoration: none; display: inline-block; text-align: center; }
.btn:hover { background: var(--ti-accent-hover); color: white; }
.btn-outline { background: transparent; color: var(--ti-accent); border: 2px solid var(--ti-accent); }
.btn-outline:hover { background: rgba(56, 138, 119, 0.1); color: var(--ti-accent); }

/* Hero */
.hero {
  background: var(--ti-bg-inv); color: white; padding: 4rem 2rem; text-align: center;
  border-radius: var(--radius-lg); margin-bottom: 3rem;
}
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { opacity: 0.9; margin-bottom: 1rem; }
.hero .stars { color: var(--amber); margin-bottom: 0.5rem; }

/* Hero with image */
.hero-product {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center;
  background: var(--ti-bg-inv); color: white; padding: 3rem 2rem;
  border-radius: var(--radius-lg); margin-bottom: 3rem; text-align: left;
}
@media (max-width: 768px) { .hero-product { grid-template-columns: 1fr; text-align: center; } }
.hero-product img { width: 100%; border-radius: var(--radius); }
.hero-product h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.hero-product .stars { color: var(--amber); margin-bottom: 0.5rem; }
.hero-product p { opacity: 0.9; margin-bottom: 1rem; }

/* Sections */
.section { padding: 3rem 0; }
.section-alt { background: var(--ti-bg-alt); padding: 3rem 2rem; border-radius: var(--radius-lg); margin: 2rem 0; }
.section-title { font-size: 1.5rem; margin-bottom: 1.5rem; border-left: 4px solid var(--ti-accent); padding-left: 1rem; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.product-card {
  background: var(--ti-bg-alt); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit; display: block;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-card-body { padding: 1.25rem; }
.product-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.product-card .price { font-size: 1.25rem; font-weight: 700; color: var(--ti-accent); }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 768px) { .product-detail { grid-template-columns: 1fr; } }
.product-gallery img { border-radius: var(--radius); width: 100%; }
.product-gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 1rem; }
.product-gallery-thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); cursor: pointer; border: 2px solid transparent; }
.product-gallery-thumbs img:hover, .product-gallery-thumbs img.active { border-color: var(--ti-accent); }
.product-info h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.product-info .price { font-size: 1.5rem; font-weight: 700; color: var(--ti-accent); margin: 1rem 0; }
.product-info ul { margin: 1rem 0; padding-left: 1.25rem; }
.qty-row { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.qty-row input { width: 60px; padding: 0.5rem; border: 1px solid var(--border); background: var(--ti-bg); color: var(--ti-fg); border-radius: var(--radius); text-align: center; }

/* Cart */
.cart-empty { text-align: center; padding: 3rem; color: var(--ti-fg-alt); }
.cart-items { margin-bottom: 2rem; }
.cart-item {
  display: grid; grid-template-columns: 80px 1fr auto auto; gap: 1rem; align-items: center;
  padding: 1rem; background: var(--ti-bg-alt); border-radius: var(--radius); margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
@media (max-width: 600px) { .cart-item { grid-template-columns: 60px 1fr; } }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }
.cart-item-info h4 { font-size: 1rem; }
.cart-item-info .price { color: var(--ti-accent); font-weight: 600; }
.cart-item .qty { display: flex; align-items: center; gap: 0.5rem; }
.cart-item .qty button { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--ti-bg); color: var(--ti-fg); border-radius: 4px; cursor: pointer; font-size: 1rem; }
.cart-item .remove { color: #dc2626; background: none; border: none; cursor: pointer; font-size: 0.9rem; padding: 0.25rem; }
.cart-items-grid { grid-column: 1; }
.cart-card { cursor: default; }
.cart-card .remove { color: #dc2626; background: none; border: none; cursor: pointer; font-size: 0.9rem; padding: 0.25rem 0; margin-top: 0.5rem; }
.cart-summary { background: var(--ti-bg-alt); padding: 1.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow); max-width: 400px; margin-left: auto; }
@media (max-width: 900px) {
  #cartContent { grid-template-columns: 1fr !important; }
  .cart-summary { margin-left: 0; max-width: none; }
}
.cart-summary .row { display: flex; justify-content: space-between; gap: 1.5rem; margin-bottom: 0.5rem; }
.cart-summary .total { font-size: 1.25rem; font-weight: 700; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-summary { position: sticky; top: 100px; }
.checkout-item { display: flex; gap: 1rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.checkout-item:last-of-type { border-bottom: none; }
.checkout-item img { width: 50px; height: 50px; object-fit: cover; border-radius: var(--radius); }
.checkout-item div { display: flex; flex-direction: column; gap: 0.25rem; }
.checkout-item .price { font-size: 0.9rem; color: var(--ti-accent); }
.checkout-items-list { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; }
.form-group input { width: 100%; padding: 0.75rem; border: 1px solid var(--border); background: var(--ti-bg); color: var(--ti-fg); border-radius: var(--radius); font-size: 1rem; }
.form-group input:focus { outline: none; border-color: var(--ti-accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* Testimonials */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.testimonial { background: var(--ti-bg-alt); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.testimonial .stars { color: var(--amber); margin-bottom: 0.5rem; }
.testimonial p { font-size: 0.95rem; margin-bottom: 0.5rem; }
.testimonial .author { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--ti-fg-alt); }

/* Footer */
.footer { background: var(--ti-bg-inv); color: white; padding: 2rem; text-align: center; margin-top: 3rem; }
.footer a { color: rgba(255,255,255,0.8); }

/* Two column layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }
.two-col img { border-radius: var(--radius); width: 100%; }
