/* =====================================================
   HIMALAYA HARVEST – SUPPLEMENTARY STYLES
   File: app-extras.css
   Purpose: Styles for dynamically generated elements
   (product cards, toast, cart drawer, modals, etc.)
   These complement style.css without conflicting with it.
   ===================================================== */

/* ── PRODUCT CARDS ──────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.card-img-wrap {
  position: relative;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  cursor: pointer;
  overflow: hidden;
}
.card-img-placeholder {
  font-size: 4rem;
  line-height: 1;
  transition: transform var(--duration) var(--ease);
}
.product-card:hover .card-img-placeholder { transform: scale(1.1); }

.card-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}
.card-label.bestseller { background: var(--amber-primary); color: #fff; }
.card-label.new { background: var(--green-primary); color: #fff; }
.card-label.offer { background: #e53e3e; color: #fff; }
.card-label.oos { background: var(--gray-400); color: #fff; }

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: var(--radius-full);
}

/* Wishlist button on card */
.wishlist-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: scale(0.8);
}
.product-card:hover .wishlist-btn { opacity: 1; transform: scale(1); }
.wishlist-btn.active { color: #e53e3e; border-color: #e53e3e; background: #fff0f0; }

/* Quick view button */
.quick-view-btn {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--green-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  transition: all var(--duration-fast);
}
.product-card:hover .quick-view-btn { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Card body */
.card-body {
  padding: 14px 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-cat {
  font-size: 11px;
  color: var(--green-medium);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 4px;
  line-height: 1.3;
}
.card-name:hover { color: var(--green-primary); }
.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.stars { color: var(--amber-primary); font-size: 13px; }
.stars.gold { color: #F59327; }
.rating-count { font-size: 12px; color: var(--text-muted); }
.rating-num { font-weight: 700; color: var(--text-secondary); }

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  margin-top: auto;
}
.card-price { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.card-mrp { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.card-save { font-size: 12px; color: #16a34a; font-weight: 600; }

.card-actions {
  display: flex;
  gap: 8px;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* ── PRODUCT DETAIL PAGE ─────────────────────────────── */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 32px 0;
}
@media (max-width: 768px) {
  .product-detail-layout { grid-template-columns: 1fr; gap: 24px; }
}

.gallery-main {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.detail-emoji { font-size: 8rem; user-select: none; }
.main-product-img { max-width: 100%; max-height: 320px; object-fit: contain; }
.img-zoom-hint { position: absolute; bottom: 10px; right: 10px; font-size: 11px; color: var(--text-muted); background: rgba(255,255,255,0.8); padding: 3px 8px; border-radius: var(--radius-full); }

.product-labels { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.product-title { font-family: 'Playfair Display', serif; font-size: clamp(20px, 3vw, 28px); font-weight: 700; margin-bottom: 6px; }
.product-subtitle { color: var(--text-secondary); margin-bottom: 12px; }
.product-rating-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }

.product-price-block { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.product-price { font-size: 26px; font-weight: 700; }
.product-mrp { font-size: 16px; color: var(--text-muted); text-decoration: line-through; }
.product-discount { font-size: 14px; color: #16a34a; font-weight: 700; background: #dcfce7; padding: 2px 8px; border-radius: var(--radius-full); }

.product-stock { font-size: 13px; margin-bottom: 16px; font-weight: 600; }
.product-stock.in-stock { color: #16a34a; }
.product-stock.oos { color: #dc2626; }

.product-qty-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.qty-control { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qty-control button { width: 36px; height: 38px; background: var(--gray-50); border: none; cursor: pointer; font-size: 18px; font-weight: 500; transition: background var(--duration-fast); }
.qty-control button:hover { background: var(--green-soft); }
.qty-control span { width: 40px; text-align: center; font-weight: 600; }

.wishlist-btn-detail {
  width: 42px; height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--duration-fast);
}
.wishlist-btn-detail.active { color: #e53e3e; border-color: #e53e3e; background: #fff0f0; }

/* Product tabs */
.product-tabs { margin-top: 24px; }
.tab-buttons { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--duration-fast);
}
.tab-btn.active { color: var(--green-primary); border-bottom-color: var(--green-primary); font-weight: 700; }
.tab-content { display: none; line-height: 1.8; }
.tab-content.active { display: block; }
.tab-content p { margin-bottom: 10px; color: var(--text-secondary); }
.nutrition-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nutrition-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.nutrition-table td:first-child { font-weight: 600; color: var(--text-secondary); width: 45%; }

/* Reviews section */
.reviews-section { margin: 40px 0; }
.reviews-section h3 { font-family: 'Playfair Display', serif; margin-bottom: 20px; }
.reviews-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.rating-big { font-size: 48px; font-weight: 700; color: var(--green-primary); }
.review-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.reviewer-avatar {
  width: 36px; height: 36px;
  background: var(--green-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.review-date { margin-left: auto; font-size: 12px; color: var(--text-muted); }

.add-review-box { margin-top: 24px; background: var(--green-soft); border-radius: var(--radius-lg); padding: 24px; }
.add-review-box h4 { margin-bottom: 12px; }
.star-selector { display: flex; gap: 4px; margin-bottom: 12px; font-size: 28px; cursor: pointer; }
.star-selector span { color: var(--border); transition: color var(--duration-fast); }
.star-selector span:hover, .star-selector span.active { color: var(--amber-primary); }
#reviewText { width: 100%; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; font-family: inherit; font-size: 14px; resize: vertical; }

/* Related products */
.related-products { margin: 32px 0 48px; }
.related-products h3 { font-family: 'Playfair Display', serif; margin-bottom: 20px; }

/* ── CART PAGE ────────────────────────────────────────── */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
}
.cart-item-img { font-size: 3rem; flex-shrink: 0; width: 64px; text-align: center; }
.cart-item-details { flex: 1; }
.cart-item-details h4 { font-weight: 600; margin-bottom: 4px; }
.cart-item-weight { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.cart-item-saving { font-size: 12px; color: #16a34a; font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.cart-item-price { text-align: right; flex-shrink: 0; }
.item-total { font-size: 17px; font-weight: 700; display: block; }
.item-mrp { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}
.remove-btn:hover { background: #fee2e2; color: #dc2626; }

.qty-mini { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qty-mini button { width: 30px; height: 30px; background: var(--gray-50); border: none; cursor: pointer; font-size: 16px; font-weight: 500; }
.qty-mini button:hover { background: var(--green-soft); }
.qty-mini span { width: 32px; text-align: center; font-weight: 600; font-size: 13px; }

/* Cart summary */
.cart-summary {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 140px;
}
.cart-summary h4 { margin-bottom: 16px; font-size: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.summary-row.total-row { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.summary-row.discount-row span:last-child { color: #16a34a; font-weight: 600; }
.summary-divider { height: 1px; background: var(--border-light); margin: 8px 0; }

.coupon-row { display: flex; gap: 8px; margin: 12px 0; }
.coupon-row input { flex: 1; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; text-transform: uppercase; }
.coupon-row input:focus { outline: none; border-color: var(--green-primary); }

.cart-trust { display: flex; gap: 12px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); }

/* ── CART DRAWER ──────────────────────────────────────── */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity var(--duration);
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(380px, 100vw);
  height: 100vh;
  background: var(--white);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease);
  box-shadow: var(--shadow-xl);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
}
.cart-drawer-header h4 { font-weight: 700; }
.cart-drawer-header button { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background var(--duration-fast); }
.cart-drawer-header button:hover { background: var(--gray-100); }

.cart-drawer-items { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart-drawer-footer { padding: 16px 20px; border-top: 1px solid var(--border-light); }

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.drawer-item:last-child { border-bottom: none; }
.drawer-item-emoji { font-size: 2rem; flex-shrink: 0; }
.drawer-item-info { flex: 1; }
.drawer-item-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.drawer-qty-row { display: flex; align-items: center; justify-content: space-between; }
.drawer-item-price { font-weight: 700; font-size: 14px; }
.drawer-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all var(--duration-fast); flex-shrink: 0; }
.drawer-remove:hover { background: #fee2e2; color: #dc2626; }

/* ── TOAST NOTIFICATIONS ──────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 80px; /* above mobile bottom nav */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 768px) { .toast-container { bottom: 24px; } }

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--charcoal);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s var(--ease);
  max-width: 90vw;
  pointer-events: auto;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #15803d; }
.toast-error { background: #dc2626; }
.toast-warning { background: var(--amber-primary); }
.toast-info { background: var(--green-primary); }
.toast-icon { font-size: 16px; }

/* ── EMPTY STATE ──────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-emoji { font-size: 4rem; }
.empty-state h3 { font-size: 20px; }
.empty-state p { color: var(--text-muted); }

/* ── QUICK VIEW MODAL ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1100;
  display: none;
}
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--white);
  border-radius: var(--radius-xl);
  z-index: 1101;
  padding: 32px;
  max-width: 700px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-xl);
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--gray-100); border: none; border-radius: 50%;
  width: 36px; height: 36px; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast);
}
.modal-close:hover { background: var(--gray-200); }

.quick-view-content { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
@media (max-width: 600px) { .quick-view-content { grid-template-columns: 1fr; } }
.qv-img { background: var(--gray-50); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; min-height: 180px; }
.qv-emoji { font-size: 5rem; }

/* ── ADMIN MODAL ──────────────────────────────────────── */
.admin-product-modal, .admin-coupon-modal { max-width: 780px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--white);
  color: var(--text-primary);
  transition: border-color var(--duration-fast);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--green-primary);
}
.form-group input:disabled { background: var(--gray-50); cursor: not-allowed; }
.pm-labels { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; font-size: 14px; }
.pm-labels label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.admin-product-modal h3, .admin-coupon-modal h3 { margin-bottom: 20px; }

/* ── POLICY MODAL ─────────────────────────────────────── */
.policy-modal { max-width: 700px; }
.policy-modal h2 { font-family: 'Playfair Display', serif; margin-bottom: 16px; }
.policy-modal h4 { margin: 20px 0 8px; }
.policy-modal p { margin-bottom: 10px; color: var(--text-secondary); }

/* ── CHECKOUT PAGE ────────────────────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; padding: 32px 0; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }

.checkout-section { background: var(--white); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.checkout-section h4 { margin-bottom: 16px; font-size: 16px; font-weight: 700; }

.payment-methods { display: flex; flex-direction: column; gap: 10px; }
.payment-option {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.payment-option:hover, .payment-option.selected { border-color: var(--green-primary); background: var(--green-soft); }
.payment-option input[type="radio"] { margin-right: 12px; accent-color: var(--green-primary); }
.payment-option-content { display: flex; align-items: center; gap: 12px; }
.payment-icon { font-size: 20px; }
.payment-option-content strong { font-size: 14px; }
.payment-option-content p { font-size: 12px; color: var(--text-muted); margin: 0; }
.payment-detail { margin-top: 10px; }
.payment-detail input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; }

.checkout-summary { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); height: fit-content; position: sticky; top: 140px; }
.checkout-summary h4 { margin-bottom: 16px; font-size: 16px; font-weight: 700; }
.co-item-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--text-secondary); border-bottom: 1px dotted var(--border-light); }
.checkout-security { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.btn-lg { padding: 16px 24px; font-size: 16px; }
.page-heading { font-family: 'Playfair Display', serif; font-size: clamp(22px, 4vw, 32px); margin: 24px 0 20px; }

/* ── ORDER SUCCESS ─────────────────────────────────────── */
.order-success-box {
  text-align: center;
  max-width: 500px;
  margin: 60px auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  box-shadow: var(--shadow-lg);
}
.success-animation { font-size: 4rem; margin-bottom: 16px; animation: successBounce 0.6s var(--ease-bounce); }
@keyframes successBounce { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.order-success-box h2 { margin-bottom: 12px; }
.order-success-box p { color: var(--text-secondary); margin-bottom: 20px; }
.order-success-id { background: var(--green-soft); border-radius: var(--radius-md); padding: 12px 20px; font-size: 15px; margin-bottom: 24px; }
.order-success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── ACCOUNT PAGE ─────────────────────────────────────── */
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 32px 0; }
@media (max-width: 768px) { .account-layout { grid-template-columns: 1fr; } }

.account-sidebar { background: var(--white); border-radius: var(--radius-lg); padding: 24px; height: fit-content; box-shadow: var(--shadow-sm); }
.account-avatar { text-align: center; margin-bottom: 16px; }
.avatar-lg { font-size: 3rem; width: 72px; height: 72px; background: var(--green-soft); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 28px; font-weight: 700; color: var(--green-primary); }
.account-sidebar h4 { font-weight: 700; }
.account-sidebar p { font-size: 13px; color: var(--text-muted); }
.account-nav { list-style: none; margin-top: 16px; border-top: 1px solid var(--border-light); padding-top: 16px; }
.account-nav li { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 500; transition: all var(--duration-fast); }
.account-nav li:hover, .account-nav li.active { background: var(--green-soft); color: var(--green-primary); }
.account-nav .logout-item:hover { background: #fee2e2; color: #dc2626; }

.account-content { background: var(--white); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.account-tab { display: none; }
.account-tab.active { display: block; }
.account-tab h3 { margin-bottom: 20px; font-family: 'Playfair Display', serif; }
.profile-form { max-width: 480px; display: flex; flex-direction: column; gap: 16px; }

/* Order cards in account */
.order-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}
.order-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.order-items-preview { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; border-bottom: 1px dashed var(--border-light); padding-bottom: 10px; }
.order-card-footer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.order-status { padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; text-transform: capitalize; }
.status-confirmed { background: #dbeafe; color: #1d4ed8; }
.status-processing { background: var(--amber-soft); color: var(--amber-primary); }
.status-shipped { background: #ede9fe; color: #7c3aed; }
.status-delivered { background: #dcfce7; color: #15803d; }
.status-cancelled { background: #fee2e2; color: #dc2626; }
.status-pending { background: var(--amber-soft); color: var(--amber-primary); }

/* Address cards */
.address-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
}
.address-card p { font-size: 13px; color: var(--text-secondary); }

/* ── FAQ SECTION ──────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 8px; max-width: 800px; margin: 0 auto; }
.faq-item { background: var(--white); border-radius: var(--radius-md); border: 1px solid var(--border-light); overflow: hidden; }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background var(--duration-fast);
}
.faq-question:hover { background: var(--green-soft); }
.faq-icon { font-size: 20px; color: var(--green-primary); flex-shrink: 0; margin-left: 12px; font-weight: 400; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease), padding 0.35s; padding: 0 20px; }
.faq-answer p { color: var(--text-secondary); line-height: 1.7; }
.faq-item.open .faq-answer { max-height: 200px; padding: 0 20px 16px; }

/* ── TESTIMONIALS ─────────────────────────────────────── */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--green-light);
}
.testimonial-stars { color: var(--amber-primary); font-size: 16px; margin-bottom: 12px; }
.testimonial-text { color: var(--text-secondary); font-size: 14px; line-height: 1.7; margin-bottom: 16px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 10px; }
.testimonial-author strong { font-size: 14px; }
.testimonial-author p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* ── ADMIN PANEL EXTRAS ───────────────────────────────── */
.badge-green { background: #dcfce7; color: #15803d; padding: 2px 8px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700; }
.badge-red { background: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700; }
.admin-link { color: var(--amber-primary) !important; font-weight: 700; }

.recent-order-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.recent-order-row:last-child { border-bottom: none; }
.low-stock-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.low-stock-row:last-child { border-bottom: none; }

.admin-faq-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}
.faq-edit-header { display: flex; align-items: center; margin-bottom: 10px; }
.faq-admin-input { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.faq-admin-textarea { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; min-height: 70px; resize: vertical; }

.admin-contact-card { background: var(--gray-50); border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 12px; }
.admin-contact-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.admin-contact-header .hint { margin-left: auto; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.settings-card { background: var(--gray-50); border-radius: var(--radius-md); padding: 20px; border: 1px solid var(--border-light); }
.settings-card h4 { margin-bottom: 14px; font-size: 15px; }
.toggle-setting { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.hint { font-size: 12px; color: var(--text-muted); }

/* ── USER DROPDOWN ────────────────────────────────────── */
.user-dropdown {
  position: fixed;
  top: 130px;
  right: 16px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 260px;
  z-index: 990;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all var(--duration) var(--ease);
  border: 1px solid var(--border-light);
}
.user-dropdown.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.dropdown-user-info { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-light); }
.dropdown-user-info .avatar-circle { width: 40px; height: 40px; background: var(--green-soft); color: var(--green-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.dropdown-user-info strong { font-size: 14px; }
.dropdown-user-info p { font-size: 12px; color: var(--text-muted); }
.dropdown-links { list-style: none; padding: 8px 0; }
.dropdown-links li { padding: 10px 16px; font-size: 14px; cursor: pointer; transition: background var(--duration-fast); }
.dropdown-links li:hover { background: var(--green-soft); color: var(--green-primary); }
.dropdown-links .logout-item:hover { background: #fee2e2; color: #dc2626; }
.dropdown-guest { padding: 16px; border-bottom: 1px solid var(--border-light); }
.dropdown-guest p { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

/* ── SCROLL ANIMATIONS ────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── BREADCRUMB ────────────────────────────────────────── */
.breadcrumb { font-size: 13px; color: var(--text-muted); padding: 16px 0; }
.breadcrumb a { color: var(--green-primary); cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── SEARCH DROPDOWN ──────────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 900;
  border: 1px solid var(--border-light);
  max-height: 340px;
  overflow-y: auto;
  display: none;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--duration-fast);
  border-bottom: 1px solid var(--border-light);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--green-soft); }
.search-item-emoji { font-size: 1.5rem; }
.search-item-name { font-size: 14px; font-weight: 500; }
.search-item-price { font-size: 13px; color: var(--green-primary); font-weight: 700; }
.search-no-result { padding: 16px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* ── AUTH EXTRAS ──────────────────────────────────────── */
.password-group { position: relative; }
.pwd-toggle {
  position: absolute;
  right: 10px;
  bottom: 9px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}
/* demo-admin-box removed in production */
.btn-google {
  background: var(--white) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text-primary) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-google:hover { background: var(--gray-50) !important; }
.auth-link { font-size: 13px; text-align: center; color: var(--text-secondary); margin-top: 8px; }
.auth-link a { color: var(--green-primary); font-weight: 600; }

/* ── MOBILE FORM ──────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } }


/* ══════════════════════════════════════════════════════
   HIMCREST FOODS – PRODUCTION ADDITIONS
   Weight Variant Selector, Phone Login, etc.
══════════════════════════════════════════════════════ */

/* ── WEIGHT VARIANT CHIPS ─────────────────────────── */
.weight-options {
  margin: 12px 0 16px;
}

.weight-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.weight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weight-chip {
  padding: 6px 14px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  background: var(--white, #fff);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text-primary);
  position: relative;
}

.weight-chip:hover:not(:disabled) {
  border-color: var(--green-primary, #2A5F2E);
  color: var(--green-primary, #2A5F2E);
}

.weight-chip.active {
  background: var(--green-primary, #2A5F2E);
  border-color: var(--green-primary, #2A5F2E);
  color: #fff;
  font-weight: 600;
}

.weight-chip.oos {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}

.weight-chip .chip-stock {
  display: block;
  font-size: 10px;
  font-weight: 400;
  margin-top: 1px;
  color: var(--amber-primary, #d97706);
}

.weight-chip.active .chip-stock {
  color: rgba(255,255,255,0.8);
}

.weight-single {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
}

/* Product saving badge */
.product-saving-badge {
  font-size: 13px;
  color: var(--green-primary, #2A5F2E);
  font-weight: 600;
}

/* Product delivery note */
.product-delivery-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Card weight hint */
.card-weight-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 4px;
}

/* ── AUTH TABS (Email / Phone OTP toggle) ──────────── */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-tabs .btn {
  flex: 1;
  font-size: 13px;
  padding: 8px 12px;
}

/* ── CART FREE SHIPPING NOTE ──────────────────────── */
#cartFreeShipNote {
  font-size: 12px;
  text-align: center;
  padding: 4px 0;
  transition: color 0.2s;
}

/* ── PAYMENT OPTION IDS ────────────────────────────── */
#payOptCOD,
#payOptOnline {
  transition: opacity 0.2s;
}

/* ── POLICIES ADMIN ────────────────────────────────── */
#adminPoliciesList textarea {
  font-family: 'DM Sans', monospace, sans-serif;
  line-height: 1.6;
  resize: vertical;
}

/* ── SOCIAL LINKS ─────────────────────────────────── */
.social-instagram,
.social-facebook,
.whatsapp-link {
  transition: opacity 0.2s;
}

.social-instagram:hover,
.social-facebook:hover,
.whatsapp-link:hover {
  opacity: 0.75;
}

/* ── FOOTER BRAND DYNAMIC ─────────────────────────── */
#footerCopyText {
  transition: opacity 0.2s;
}

/* ── PRODUCT DETAIL DELIVERY ──────────────────────── */
.product-detail-layout .product-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── VARIANT SELECTOR IN QUICK VIEW ──────────────── */
.quick-view-content .weight-chips {
  margin: 12px 0;
}

/* ── ORDER ID BADGE (HC prefix) ───────────────────── */
.order-success-id {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 12px 0 24px;
}

.order-success-id strong {
  color: var(--green-primary, #2A5F2E);
  font-size: 1.1rem;
  font-family: monospace;
  letter-spacing: 1px;
}

/* ── SKIP PHONE VERIFICATION LINK ─────────────────── */
#verifyPhoneForm .auth-link a[onclick*="skipPhone"] {
  color: var(--text-secondary);
  font-weight: 400;
  text-decoration: underline;
}

/* ── ADMIN POLICIES TAB ───────────────────────────── */
#admin-tab-policies-admin .hint {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ── MAINTENANCE MODE SCREEN ──────────────────────── */
.maintenance-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'DM Sans', sans-serif;
  text-align: center;
  padding: 32px;
}

@media (max-width: 600px) {
  .weight-chips { gap: 6px; }
  .weight-chip  { padding: 5px 11px; font-size: 12px; }
  .auth-tabs .btn { font-size: 12px; padding: 7px 8px; }
}

/* =====================================================
   HIMCREST FOODS – MOBILE FIXES & GALLERY STYLES
   All changes are additions / overrides only.
   No existing rules removed.
===================================================== */

/* ── GLOBAL MOBILE OVERFLOW PREVENTION ───────────────── */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}
img {
  max-width: 100%;
  height: auto;
}

/* ── SHOP PAGE – MOBILE SIDEBAR FIX ──────────────────── */
/*
  On mobile: sidebar is hidden by default.
  It slides in as a drawer (fixed overlay) when user taps the filter button.
  No overlap with the product grid.
*/
@media (max-width: 899px) {
  /* Grid becomes single column; sidebar is removed from flow */
  .shop-layout {
    display: block !important;
    padding: 16px 0 !important;
  }

  /* Sidebar hidden by default on mobile — shown as slide-in drawer */
  .shop-sidebar {
    position: fixed !important;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    overflow-y: auto;
    z-index: 1100;
    padding: 24px 20px;
    background: var(--white, #fff);
    border-right: 1.5px solid var(--border-light);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    transition: left 0.28s ease;
    border-radius: 0;
  }

  .shop-sidebar.mobile-open {
    left: 0 !important;
  }

  /* Overlay behind sidebar drawer */
  .shop-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1099;
  }
  .shop-sidebar-overlay.open {
    display: block;
  }

  /* Main product area takes full width */
  .shop-main {
    width: 100% !important;
    overflow: hidden;
  }

  .shop-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .shop-controls {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
}

/* ── PRODUCT GRID – MOBILE ────────────────────────────── */
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .card-img-wrap { height: 140px !important; }
  .card-body { padding: 10px 12px 14px !important; }
  .card-name { font-size: 13px !important; }
  .card-price { font-size: 15px !important; }
  .card-actions { gap: 6px !important; }
  .btn-sm { padding: 7px 10px !important; font-size: 12px !important; }

  /* Ensure product cards don't overflow */
  .product-card {
    min-width: 0;
    overflow: hidden;
  }
}

/* ── MOBILE MENU DRAWER ───────────────────────────────── */
@media (max-width: 899px) {
  .mobile-menu {
    width: 280px !important;
    max-width: 85vw !important;
    padding-bottom: 80px; /* space for bottom nav */
  }
  .mobile-nav-links li a {
    padding: 13px 20px !important;
    font-size: 15px !important;
  }
  .mobile-menu-user {
    padding: 16px 20px !important;
  }
}

/* ── AUTH PAGE – MOBILE ──────────────────────────────── */
@media (max-width: 600px) {
  .auth-container {
    padding: 12px !important;
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }
  .auth-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 24px 16px !important;
    border-radius: 12px !important;
  }
  .auth-card h2 { font-size: 20px !important; }
  .btn-google {
    font-size: 14px !important;
    padding: 11px 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Prevent iOS zoom on inputs */
  input, select, textarea {
    font-size: 16px !important;
  }
  .password-group input {
    padding-right: 44px !important;
  }
  .form-row {
    grid-template-columns: 1fr !important;
  }
}

/* ── MODAL WIDTHS – MOBILE ───────────────────────────── */
@media (max-width: 600px) {
  .modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 12px !important;
    padding: 20px 16px !important;
    border-radius: 12px !important;
    max-height: 90vh;
    overflow-y: auto;
  }
  /* Product modal specifically */
  #productModal {
    width: calc(100vw - 24px) !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }
  .pm-grid {
    grid-template-columns: 1fr !important;
  }
  /* Quick view modal */
  .quick-view-content {
    grid-template-columns: 1fr !important;
  }
}

/* ── PRODUCT DETAIL PAGE – MOBILE ───────────────────── */
@media (max-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 16px 0 !important;
  }
  .gallery-main {
    min-height: 260px !important;
    max-height: 320px;
  }
  .product-title {
    font-size: 20px !important;
  }
  .weight-chips {
    flex-wrap: wrap;
    gap: 6px;
  }
  .weight-chip {
    padding: 5px 12px;
    font-size: 13px;
  }
  .tab-buttons {
    flex-wrap: wrap;
    gap: 4px;
  }
  .tab-btn {
    font-size: 13px !important;
    padding: 7px 12px !important;
  }
}

/* ── GALLERY THUMBNAILS ─────────────────────────────── */
#galleryThumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.thumb-btn {
  width: 60px;
  height: 60px;
  border: 2px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--gray-50, #f8fafc);
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.18s;
}
.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-btn.active {
  border-color: var(--green-primary, #2A5F2E);
}
.thumb-btn:hover {
  border-color: var(--green-medium, #4a8c4e);
}

/* Video thumbnail */
.thumb-video {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft, #f0fdf4);
  border-color: var(--green-light, #86efac);
}
.thumb-play-icon {
  font-size: 22px;
  color: var(--green-primary, #2A5F2E);
}

/* Video player inside gallery */
.gallery-video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-xl, 16px);
  background: #000;
}

@media (max-width: 480px) {
  .thumb-btn { width: 50px; height: 50px; }
}

/* ── CART PAGE – MOBILE ──────────────────────────────── */
@media (max-width: 600px) {
  .cart-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  .cart-item-details {
    flex: 1;
    min-width: 0;
  }
  .cart-item-price {
    width: 100%;
    text-align: left;
    padding-left: 64px; /* align under item name */
  }
  .cart-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ── CHECKOUT – MOBILE ───────────────────────────────── */
@media (max-width: 600px) {
  .checkout-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ── HEADER NAV – MOBILE OVERFLOW FIX ───────────────── */
@media (max-width: 900px) {
  .nav-container {
    padding: 0 12px !important;
    gap: 10px !important;
  }
  .nav-actions {
    gap: 6px !important;
  }
}
/* Hide desktop search bar on very small screens */
@media (max-width: 480px) {
  .search-wrapper {
    display: none !important;
  }
}

/* ── CATEGORY NAV STRIP – NO OVERFLOW ───────────────── */
.cat-nav-strip {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav-strip::-webkit-scrollbar { display: none; }
.cat-nav-strip .cat-list {
  display: flex;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

/* ── FOOTER – MOBILE ─────────────────────────────────── */
@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    gap: 8px !important;
  }
}

/* ── ADMIN PRODUCT MODAL – URL FORM STYLES ───────────── */
.pm-img-preview {
  margin-top: 6px;
  min-height: 4px;
}
.pm-img-preview img,
.pm-img-preview video {
  max-width: 140px;
  max-height: 110px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

/* Remove auth-tabs phone toggle (no longer needed) */
.auth-tabs { display: none !important; }

/* Phone-related forms — hidden completely */
#verifyPhoneForm,
#phoneLoginForm {
  display: none !important;
}


/* =====================================================
   HIMCREST FOODS – COMPREHENSIVE FIX PACK
   Fixes: product card classes, mobile UI, nav account,
          admin modal, shop layout, auth page
   ===================================================== */

/* ── PRODUCT CARD CLASS ALIASES ──────────────────────
   products.js uses these class names; wire them to
   the existing product-card-* styles                */

.card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--gray-50, #f9fafb);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.product-card:hover .card-img { transform: scale(1.05); }

.card-img-placeholder {
  font-size: 3.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-cat {
  font-size: 10px;
  font-weight: 600;
  color: var(--green-medium, #4a7c59);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #1a2e1a);
  line-height: 1.3;
  margin: 0;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-name:hover { color: var(--green-primary, #2A5F2E); }

.card-subtitle {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.card-rating .stars { color: #f59e0b; font-size: 11px; }
.card-rating .rating-count { color: var(--text-muted, #6b7280); }

.card-weight-hint {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  margin: 0;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.card-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-primary, #2A5F2E);
}
.card-mrp {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  text-decoration: line-through;
}
.card-save {
  font-size: 10px;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  padding: 1px 5px;
  border-radius: 4px;
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.card-actions .btn {
  flex: 1;
  padding: 7px 8px;
  font-size: 12px;
  min-width: 0;
}

/* Card label badges */
.card-label {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  z-index: 2;
  pointer-events: none;
}
.card-label.bestseller { background: #fef3c7; color: #92400e; }
.card-label.new        { background: #ede9fe; color: #5b21b6; }
.card-label.offer      { background: #fee2e2; color: #991b1b; }

.discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}

/* Wishlist btn on card */
.wishlist-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.2s, color 0.2s;
  color: #9ca3af;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.wishlist-btn.active, .wishlist-btn:hover { color: #ef4444; transform: scale(1.15); }

/* Quick view btn */
.quick-view-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(42,95,46,0.92);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 3;
}
.card-img-wrap:hover .quick-view-btn { opacity: 1; transform: translateY(0); }

/* ── MOBILE PRODUCT GRID – NO OVERFLOW ───────────────
   Force 2-col grid; prevent cards from overflowing   */
@media (max-width: 899px) {
  .product-grid,
  #mainProductGrid,
  #bestsellerGrid,
  #newArrivalsGrid,
  #offersGrid,
  #wishlistGrid,
  #relatedGrid,
  #accWishlistGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .product-grid,
  #mainProductGrid,
  #bestsellerGrid {
    grid-template-columns: 1fr !important;
  }
  .card-actions { flex-direction: column; }
}

/* ── SHOP PAGE – NO HORIZONTAL OVERFLOW ──────────────*/
.shop-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
@media (min-width: 900px) {
  .shop-layout {
    grid-template-columns: 240px 1fr;
    gap: 24px;
  }
}
.shop-main {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

/* ── NAV ACTIONS – ALWAYS VISIBLE ON MOBILE ──────────
   The account/cart/wishlist icons must be visible
   and tappable on all screen sizes                   */
.nav-actions {
  display: flex !important;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-action {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  color: var(--text-secondary, #666);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  min-width: 40px;
  min-height: 44px;          /* comfortable tap target */
  transition: background 0.15s;
}
.nav-action:hover { background: var(--green-soft, #f0fdf4); }
.nav-action svg   { width: 22px; height: 22px; flex-shrink: 0; }

/* Show action label only on wide screens */
.action-label { display: none; font-size: 10px; line-height: 1; }
@media (min-width: 900px) { .action-label { display: block; } }

/* User menu trigger — always show label "Login" / name on mobile */
#userMenuTrigger .action-label {
  display: block !important;
  font-size: 10px;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--green-primary, #2A5F2E);
  font-weight: 700;
}

/* Nav container — clamp search width on mobile */
.nav-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  flex-wrap: nowrap;
}
@media (max-width: 639px) {
  .search-wrapper {
    display: none;  /* hide on very small screens; use category nav to browse */
  }
  .nav-container { gap: 4px; padding: 0 8px; }
  .logo-tagline  { display: none; }
  .logo-brand    { font-size: 15px !important; }
}
@media (min-width: 480px) {
  .search-wrapper { display: block !important; flex: 1; min-width: 0; }
}

/* Cart/wishlist badge */
.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* ── AUTH PAGE – MOBILE FIX ──────────────────────────*/
.auth-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}
.auth-card {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 0 40px;
  overflow-x: hidden;
}

/* ── ADMIN PRODUCT MODAL – MOBILE SCROLL ─────────────*/
.admin-product-modal {
  max-width: 860px !important;
  width: calc(100vw - 32px) !important;
  max-height: 92vh !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}
.pm-modal-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 0 4px 16px;
  max-height: calc(92vh - 80px);
}
.pm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .pm-grid { grid-template-columns: 1fr; }
  .admin-product-modal {
    width: calc(100vw - 16px) !important;
    max-height: 96vh !important;
  }
}
.pm-img-preview {
  margin-top: 6px;
  min-height: 4px;
}
.pm-img-preview img,
.pm-img-preview video {
  max-width: 140px;
  max-height: 110px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-light, #e5e7eb);
}

/* ── CART PAGE – MOBILE ──────────────────────────────*/
@media (max-width: 640px) {
  .cart-item {
    flex-direction: row;
    gap: 10px;
  }
  .cart-item-img {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px;
    flex-shrink: 0;
  }
  .cart-item-details h4 { font-size: 13px; }
  .cart-item-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cart-item-price { flex-direction: column; gap: 2px; }
}

/* ── CHECKOUT PAGE – MOBILE ──────────────────────────*/
@media (max-width: 640px) {
  .checkout-layout {
    grid-template-columns: 1fr !important;
  }
  .checkout-summary-box {
    order: -1;
  }
}

/* ── HERO – MOBILE ───────────────────────────────────*/
@media (max-width: 640px) {
  .hero-slide {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 20px 24px;
    min-height: auto;
  }
  .hero-heading { font-size: clamp(1.6rem, 6vw, 2.4rem) !important; }
  .hero-visual   { display: none !important; }
  .hero-ctas     { flex-direction: column; gap: 8px; }
  .hero-ctas .btn { width: 100%; text-align: center; }
}

/* ── SHOP SIDEBAR – MOBILE DRAWER ────────────────────*/
#shopSidebar {
  display: block;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: 280px;
  background: var(--white, #fff);
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 20px 16px 40px;
  box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  box-sizing: border-box;
}
#shopSidebar.mobile-open { transform: translateX(0); }

@media (min-width: 900px) {
  #shopSidebar {
    position: static;
    transform: none;
    height: auto;
    box-shadow: none;
    padding: 0;
    width: auto;
  }
}

/* ── PRODUCT DETAIL – MOBILE ─────────────────────────*/
@media (max-width: 899px) {
  .product-detail-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .gallery-main {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
  }
  #galleryThumbs {
    gap: 6px !important;
    flex-wrap: wrap;
  }
  .thumb-btn {
    width: 56px !important;
    height: 56px !important;
  }
  .weight-chips { flex-wrap: wrap; gap: 8px; }
  .weight-chip  { min-width: 52px; }
}

/* ── GLOBAL OVERFLOW GUARD ────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; }
body, .page, .container, main, section {
  max-width: 100vw;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }

/* ── CATEGORY CARDS – MOBILE ─────────────────────────*/
@media (max-width: 600px) {
  .category-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .cat-card { padding: 16px 12px !important; }
  .cat-card-icon { font-size: 2rem !important; }
}

/* ── SECTION SPACING – MOBILE ────────────────────────*/
@media (max-width: 640px) {
  .section { padding: 32px 0 !important; }
  .section-title { font-size: 1.4rem !important; }
  .container { padding: 0 12px !important; }
}

/* ── TRUST STRIP – MOBILE ────────────────────────────*/
@media (max-width: 640px) {
  .trust-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .trust-item { padding: 10px !important; }
}

/* ── TESTIMONIAL GRID – MOBILE ───────────────────────*/
@media (max-width: 640px) {
  .reviews-grid, #homeReviewsGrid {
    grid-template-columns: 1fr !important;
  }
}

/* ── FILTER TOGGLE BTN – ALWAYS VISIBLE BELOW 900px ─*/
.filter-toggle-btn {
  display: flex !important;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white, #fff);
  border: 1.5px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1a2e1a);
  margin-bottom: 12px;
}
@media (min-width: 900px) {
  .filter-toggle-btn { display: none !important; }
}

/* ── FORM INPUTS – MOBILE FONT SIZE (prevent zoom) ──*/
@media (max-width: 640px) {
  input, select, textarea {
    font-size: 16px !important;  /* prevents iOS zoom */
  }
}

/* ── ADMIN TABLE – HORIZONTAL SCROLL ON MOBILE ───────*/
@media (max-width: 768px) {
  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .admin-table { min-width: 640px; }
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    padding: 0;
    scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav li {
    white-space: nowrap;
    padding: 10px 14px;
    border-bottom: none !important;
    border-right: 3px solid transparent;
  }
  .admin-nav li.active { border-right-color: var(--green-primary, #2A5F2E); }
}

/* ── MODAL OVERLAY FIX ───────────────────────────────*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1299;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white, #fff);
  border-radius: 16px;
  z-index: 1300;
  padding: 24px;
  box-sizing: border-box;
}

/* ── SHOP HEADER ROW – MOBILE ────────────────────────*/
@media (max-width: 640px) {
  .shop-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .shop-controls {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .sort-select { flex: 1; min-width: 120px; }
}

/* ── FOOTER MOBILE ───────────────────────────────────*/
@media (max-width: 600px) {
  .footer-links {
    flex-wrap: wrap;
    gap: 6px 12px;
  }
}
