/* ─── Variables ─── */
:root {
  --green: #1a5c3a;
  --green-dark: #0f3d26;
  --green-light: #2a7a50;
  --gold: #c9a227;
  --gold-light: #e8b93a;
  --text: #1a1a1a;
  --text-muted: #555;
  --border: #e0e0e0;
  --bg: #f9f7f2;
  --white: #ffffff;
  --red: #e85d24;
  --radius: 10px;
}

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

body { font-family: 'Inter', -apple-system, sans-serif; color: var(--text); background: var(--white); line-height: 1.6; }

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

/* ─── Info Bar ─── */
.info-bar {
  background: var(--green-dark);
  color: #acd5bb;
  font-size: 0.78rem;
  padding: 6px 2rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

/* ─── Navbar ─── */
.main-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon { font-size: 1.8rem; }
.brand-name { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; color: var(--green-dark); }
.brand-sub { font-size: 0.72rem; color: var(--text-muted); }

.nav-links { display: flex; gap: 0.5rem; margin-left: 1rem; }
.nav-link { padding: 0.4rem 0.9rem; border-radius: 6px; font-size: 0.9rem; color: var(--text-muted); transition: all 0.2s; }
.nav-link:hover { background: var(--bg); color: var(--green); }
.nav-shop { background: #fff8e8; color: var(--gold); font-weight: 600; border: 1px solid #f0d98a; }
.nav-shop:hover { background: #fef3c7; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

.cart-btn {
  position: relative;
  font-size: 1.3rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--green);
  transition: background 0.2s;
}
.cart-btn:hover { background: #e8f5ee; }
.cart-badge {
  background: var(--green);
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 4px;
}

.btn-invest {
  background: var(--green);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-invest:hover { background: var(--green-light); }

/* ─── Shop Hero ─── */
.shop-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: white;
  text-align: center;
  padding: 4rem 2rem;
}
.shop-hero h1 { font-family: 'Playfair Display', serif; font-size: 2.4rem; margin-bottom: 0.75rem; }
.shop-hero p { color: rgba(255,255,255,0.8); font-size: 1.1rem; }

/* ─── Shop Layout ─── */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.shop-sidebar { }

.sidebar-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sidebar-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; font-weight: 600; }

.search-box { display: flex; gap: 0.5rem; }
.search-input { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }
.search-btn { background: var(--green); color: white; border: none; border-radius: 6px; padding: 0.5rem 0.75rem; cursor: pointer; }

.category-list { list-style: none; }
.cat-link { display: block; padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.9rem; color: var(--text-muted); transition: all 0.2s; }
.cat-link:hover { background: var(--bg); color: var(--green); }
.cat-link--active { background: #e8f5ee; color: var(--green); font-weight: 600; }

/* ─── Products Grid ─── */
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.result-count { font-size: 0.88rem; color: var(--text-muted); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }

.product-img-link { display: block; position: relative; aspect-ratio: 1; overflow: hidden; }
.product-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-img-link:hover .product-img { transform: scale(1.05); }
.product-img-placeholder {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; background: var(--bg);
}

.sale-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--red); color: white;
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
}

.product-info { padding: 0.9rem; }
.product-category { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.3rem; }
.product-name a { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.product-name a:hover { color: var(--green); }
.product-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.product-price { margin: 0.6rem 0; display: flex; gap: 0.5rem; align-items: baseline; }
.price-now { font-size: 1.1rem; font-weight: 700; color: var(--green); }
.price-old { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }

.product-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.btn-add-cart {
  flex: 1; background: var(--green); color: white;
  border: none; border-radius: 6px; padding: 0.5rem;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.btn-add-cart:hover { background: var(--green-light); }
.btn-add-cart:disabled { opacity: 0.6; cursor: default; }
.btn-view {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.btn-view:hover { border-color: var(--green); color: var(--green); }
.out-of-stock { font-size: 0.8rem; color: #999; align-self: center; }

/* ─── Product Detail ─── */
.product-detail { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }
.breadcrumb { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--green); }
.breadcrumb a:hover { text-decoration: underline; }

.product-detail-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.product-detail-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); object-fit: cover; aspect-ratio: 1; }
.product-detail-placeholder { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 5rem; background: var(--bg); border-radius: var(--radius); }

.product-detail-cat { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.5rem; }
.product-detail-name { font-family: 'Playfair Display', serif; font-size: 2rem; margin-bottom: 1rem; color: var(--green-dark); }
.product-detail-price { display: flex; gap: 1rem; align-items: baseline; margin-bottom: 1rem; }
.price-now-lg { font-size: 1.8rem; font-weight: 700; color: var(--green); }
.price-old-lg { font-size: 1.1rem; color: var(--text-muted); text-decoration: line-through; }
.sale-pill { background: var(--red); color: white; font-size: 0.7rem; padding: 2px 10px; border-radius: 4px; font-weight: 700; }

.product-detail-short { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.7; }
.product-detail-stock { margin-bottom: 1.25rem; font-size: 0.9rem; }
.in-stock { color: var(--green); font-weight: 600; }
.out-of-stock-lg { color: #999; }

.add-cart-form { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.qty-selector { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-selector button { background: var(--bg); border: none; padding: 0.5rem 0.9rem; font-size: 1.1rem; cursor: pointer; }
.qty-selector input { width: 50px; border: none; text-align: center; font-size: 1rem; padding: 0.5rem; }

.btn-add-cart-lg {
  background: var(--green); color: white;
  border: none; border-radius: 8px; padding: 0.75rem 1.5rem;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.btn-add-cart-lg:hover { background: var(--green-light); }

.product-description { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.product-description h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--text-muted); }

.related-products { max-width: 1100px; margin: 3rem auto; padding: 0 1.5rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.related-products h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 1.25rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }

/* ─── Cart ─── */
.cart-page { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }
.page-title { font-family: 'Playfair Display', serif; font-size: 2rem; margin-bottom: 1.5rem; color: var(--green-dark); }

.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; }
.cart-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: white; margin-bottom: 1rem;
}
.cart-item-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.cart-item-img-ph { width: 80px; height: 80px; background: var(--bg); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0; }
.cart-item-details { flex: 1; }
.cart-item-name { font-weight: 600; margin-bottom: 0.25rem; }
.cart-item-price { font-size: 0.85rem; color: var(--text-muted); }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.cart-item-line { font-weight: 700; font-size: 1.05rem; color: var(--green); }
.qty-input { width: 50px; padding: 0.3rem; text-align: center; border: 1px solid var(--border); border-radius: 4px; }
.btn-remove { background: none; border: none; color: #999; font-size: 0.8rem; cursor: pointer; }
.btn-remove:hover { color: var(--red); }

.summary-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 80px; }
.summary-card h3 { font-family: 'Playfair Display', serif; margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.summary-total { display: flex; justify-content: space-between; padding: 0.75rem 0; font-size: 1.1rem; margin-top: 0.5rem; }
.btn-checkout {
  display: block; text-align: center;
  background: var(--green); color: white;
  padding: 0.9rem; border-radius: 8px;
  font-weight: 700; font-size: 1rem;
  margin-top: 1rem; transition: background 0.2s;
}
.btn-checkout:hover { background: var(--green-light); }
.btn-continue { display: block; text-align: center; color: var(--text-muted); font-size: 0.88rem; margin-top: 0.75rem; }
.btn-continue:hover { color: var(--green); }

/* ─── Checkout ─── */
.checkout-page { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; }
.form-section-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

.payment-options { display: flex; flex-direction: column; gap: 0.5rem; }
.payment-option {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: border-color 0.2s;
}
.payment-option:has(input:checked) { border-color: var(--green); background: #f0faf5; }

/* ─── Form Shared ─── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-span-2 { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; }
.form-label { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--text); }
.form-input {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(26,92,58,0.1); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 0.2rem; }
..form-check { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; padding: 0.4rem 0; }

/* ─── Auth Pages ─── */
.auth-page { background: #f6f4ef; min-height: calc(100vh - 160px); padding: 3rem 1rem; }
.auth-shell { max-width: 520px; margin: 0 auto; }
.auth-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 18px 40px rgba(0,0,0,0.05);
}
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head .brand-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.auth-head h1 { font-family: 'Playfair Display', serif; font-size: 2.2rem; margin-bottom: 0.5rem; color: var(--green-dark); }
.auth-head p { color: var(--text-muted); line-height: 1.6; }
.auth-title { font-size: 1.1rem; margin-bottom: 1rem; color: var(--green); font-weight: 700; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-btn {
  width: 100%; border: none; background: var(--green); color: white;
  padding: 0.95rem 1rem; border-radius: 10px; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
}
.auth-btn:hover { background: var(--green-light); }
.auth-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: space-between; margin-top: 1.25rem; }
..auth-note { text-align: center; margin-top: 1rem; color: var(--text-muted); font-size: 0.95rem; }
.auth-note a { color: var(--green); font-weight: 600; }
.auth-note a:hover { color: var(--green-dark); }
.message-box { border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; border: 1px solid #d6e6d6; background: #f3faf6; color: var(--green-dark); }

.login-partial { display: flex; align-items: center; gap: 0.75rem; }
.login-partial a { color: var(--green); font-weight: 600; }
.login-partial .btn-outline { border-color: var(--green); color: var(--green); background: transparent; padding: 0.4rem 0.85rem; border-radius: 8px; }
.logout-form { margin: 0; }
.logout-button { background: var(--gold); color: var(--white); border: none; padding: 0.4rem 0.85rem; border-radius: 8px; font-weight: 600; cursor: pointer; }
.logout-button:hover { background: var(--gold-light); }

/* ─── Order Confirmed ─── */
.order-confirmed {
  text-align: center; max-width: 500px; margin: 6rem auto; padding: 2rem;
}
.confirmed-icon { font-size: 4rem; margin-bottom: 1rem; }
.order-confirmed h1 { font-family: 'Playfair Display', serif; font-size: 2.2rem; margin-bottom: 1rem; color: var(--green-dark); }
.confirmed-number { font-size: 1.1rem; margin-bottom: 0.75rem; }

/* ─── Empty State ─── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ─── Pagination ─── */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 2rem; }
.page-btn { padding: 0.5rem 0.9rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; transition: all 0.2s; }
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn--active { background: var(--green); color: white; border-color: var(--green); }

/* ─── Cart Toast ─── */
.cart-toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--green-dark); color: white;
  padding: 0.9rem 1.5rem; border-radius: 10px;
  font-size: 0.9rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Buttons ─── */
.btn-green { background: var(--green); color: white; padding: 0.7rem 1.5rem; border-radius: 8px; font-weight: 600; display: inline-block; transition: background 0.2s; }
.btn-green:hover { background: var(--green-light); }
.btn-outline { border: 2px solid var(--green); color: var(--green); padding: 0.65rem 1.5rem; border-radius: 8px; font-weight: 600; display: inline-block; transition: all 0.2s; }
.btn-outline:hover { background: var(--green); color: white; }

/* ─── Footer ─── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.7);
  margin-top: 4rem;
  padding: 2rem;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 2rem; align-items: center; font-size: 0.85rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.3rem; }
.footer-links a { color: rgba(255,255,255,0.6); }
.footer-links a:hover { color: white; }
.footer-right { text-align: right; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .product-detail-inner { grid-template-columns: 1fr; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-nav { padding: 0.75rem 1rem; gap: 0.75rem; }
  .nav-links { display: none; }
  .info-bar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: 1; }
}
