/* ============================================
   SHOP.CSS — Greene Hart Gardens Farm Stand
   ============================================ */

:root {
  --green-deep: #1a3d2b;
  --green-mid: #2d7a4f;
  --green-light: #52b788;
  --green-pale: #95d5b2;
  --gold: #c9a84c;
  --cream: #faf8f2;
  --white: #ffffff;
  --text-dark: #1a2e1f;
  --text-muted: #6b7c6e;
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius: 18px;
}

body.shop-page {
  background: var(--cream);
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  margin: 0; padding: 0;
  padding-bottom: 100px;
}

/* ── NAV ── */
.shop-page #navbar {
  background: rgba(15,31,22,0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  padding: 14px 0;
}
.shop-nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 600;
  color: var(--white);
  display: flex; align-items: center; gap: 8px;
}
.btn-back-home {
  color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: 0.82rem; font-weight: 500;
  transition: color 0.2s; white-space: nowrap;
}
.btn-back-home:hover { color: var(--green-pale); }
.cart-trigger {
  position: relative; background: rgba(82,183,136,0.18);
  border: 1px solid rgba(82,183,136,0.4);
  border-radius: 50px; padding: 8px 14px;
  color: white; cursor: pointer; display: flex;
  align-items: center; gap: 8px;
  transition: background 0.2s;
}
.cart-trigger:hover { background: rgba(82,183,136,0.35); }
.cart-count {
  background: #e8612a; color: white;
  border-radius: 50%; width: 20px; height: 20px;
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  min-width: 20px;
}

/* ── HERO ── */
.shop-hero {
  background: linear-gradient(135deg, var(--green-deep) 0%, #2d5a3d 100%);
  padding: 120px 24px 60px;
  text-align: center; color: white;
}
.shop-hero-inner { max-width: 720px; margin: 0 auto; }
.shop-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700; margin: 16px 0 20px;
  line-height: 1.15;
}
.shop-hero h1 em { color: var(--green-pale); font-style: italic; }
.shop-hero p {
  font-size: 1.05rem; color: rgba(255,255,255,0.82);
  line-height: 1.7; margin-bottom: 28px;
}
.shop-hero-badges {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
}
.shop-hero-badges span {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px; padding: 6px 16px;
  font-size: 0.82rem; font-weight: 500;
}

/* ── FILTER BAR ── */
.shop-filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center;
  padding: 32px 24px 20px;
  max-width: 1200px; margin: 0 auto;
  position: sticky; top: 64px; z-index: 50;
  background: linear-gradient(to bottom, var(--cream) 85%, transparent);
}
.shop-filter {
  background: white; border: 1.5px solid #e0e8e2;
  border-radius: 50px; padding: 9px 20px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.shop-filter:hover { border-color: var(--green-light); color: var(--green-mid); }
.shop-filter.active {
  background: var(--green-deep); border-color: var(--green-deep);
  color: white; box-shadow: 0 4px 12px rgba(29,77,51,0.3);
}

/* ── PRODUCT GRID ── */
.shop-main { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.shop-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 60px;
}
.shop-product-card {
  background: white;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid #eef2ee;
  transition: transform 0.22s, box-shadow 0.22s;
  display: flex; flex-direction: column; gap: 16px;
}
.shop-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(82,183,136,0.3);
}
.shop-product-card.hidden { display: none; }
.featured-shop-card {
  border-color: rgba(201,168,76,0.4);
  background: linear-gradient(135deg, #fffdf5, white);
}

.prod-card-top {
  display: flex; align-items: flex-start; gap: 14px;
}
.prod-card-emoji {
  font-size: 2rem; line-height: 1;
  flex-shrink: 0; margin-top: 2px;
}
.prod-card-info { flex: 1; }
.prod-card-info h3 {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-dark); margin: 0 0 6px;
  line-height: 1.3;
}
.prod-local {
  display: block; font-size: 0.75rem;
  font-weight: 500; color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-style: normal;
}
.exclusive-tag {
  color: #92660a; background: rgba(201,168,76,0.15);
  border-radius: 4px; padding: 1px 6px; font-size: 0.68rem;
  font-weight: 700; text-transform: uppercase;
}
.prod-card-prices {
  display: flex; align-items: baseline; gap: 8px;
}
.price-dop {
  font-size: 1rem; font-weight: 700; color: var(--green-deep);
}
.price-usd {
  font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
}
.price-unit {
  font-size: 0.75rem; color: #aab5ad;
}
.prod-avail {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; border-radius: 6px;
  padding: 3px 8px; white-space: nowrap; flex-shrink: 0;
}
.prod-avail.seasonal { background: rgba(234,179,8,0.12); color: #92660a; }
.prod-avail.yearround { background: rgba(34,197,94,0.1); color: #166534; }
.prod-avail.fresh { background: rgba(59,130,246,0.1); color: #1e40af; }
.prod-avail.specialty { background: rgba(168,85,247,0.1); color: #6b21a8; }

/* Quantity controls */
.prod-card-actions {
  display: flex; align-items: center; gap: 12px;
}
.qty-control {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid #e0e8e2; border-radius: 50px;
  overflow: hidden; flex-shrink: 0;
}
.qty-btn {
  background: none; border: none;
  width: 32px; height: 32px;
  font-size: 1.1rem; font-weight: 600;
  cursor: pointer; color: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.qty-btn:hover { background: rgba(82,183,136,0.1); }
.qty-val {
  min-width: 28px; text-align: center;
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-dark);
}
.add-to-cart-btn {
  flex: 1; background: linear-gradient(135deg, var(--green-light), var(--green-mid));
  color: white; border: none; border-radius: 50px;
  padding: 9px 14px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}
.add-to-cart-btn:hover { opacity: 0.88; transform: scale(1.02); }
.add-to-cart-btn.added {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

/* ── EMPTY STATE ── */
.shop-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.shop-empty span { font-size: 3rem; display: block; margin-bottom: 12px; }

/* ── CART DRAWER ── */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 800; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.cart-overlay.active { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(420px, 100vw);
  background: white;
  z-index: 900; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eef2ee;
  background: var(--green-deep);
}
.cart-header h2 {
  color: white; font-family: 'Playfair Display', serif;
  font-size: 1.25rem; margin: 0;
}
.cart-close {
  background: rgba(255,255,255,0.15); border: none;
  color: white; border-radius: 50%; width: 32px; height: 32px;
  cursor: pointer; font-size: 0.9rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.cart-close:hover { background: rgba(255,255,255,0.25); }

.cart-delivery-note {
  background: rgba(82,183,136,0.08);
  border-bottom: 1px solid #eef2ee;
  padding: 10px 24px; font-size: 0.8rem;
  color: var(--green-mid); font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}

.cart-items {
  flex: 1; overflow-y: auto;
  padding: 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.cart-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.cart-empty span { font-size: 2.5rem; }
.cart-empty p { font-size: 0.9rem; line-height: 1.6; margin: 0; }

.cart-item {
  display: flex; align-items: center; gap: 12px;
  background: #f8faf8; border-radius: 12px;
  padding: 12px 14px; border: 1px solid #eef2ee;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
.cart-item-emoji { font-size: 1.4rem; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-dark); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cart-item-price {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 2px;
}
.cart-item-qty {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.cart-item-qty .qty-btn {
  width: 26px; height: 26px; font-size: 1rem;
  border: 1.5px solid #e0e8e2; border-radius: 50%;
}
.cart-item-qty .qty-val { min-width: 22px; font-size: 0.85rem; }
.cart-item-remove {
  background: none; border: none; color: #ccc;
  cursor: pointer; font-size: 1rem; padding: 4px;
  border-radius: 50%; transition: color 0.15s, background 0.15s;
}
.cart-item-remove:hover { color: #e74c3c; background: rgba(231,76,60,0.08); }

.cart-footer {
  border-top: 1px solid #eef2ee;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
  background: white;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: flex-end;
}
.cart-total-row > span {
  font-size: 0.88rem; color: var(--text-muted); font-weight: 500;
}
.cart-total-amounts {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.cart-total-amounts strong {
  font-size: 1.3rem; color: var(--green-deep); font-weight: 700;
}
.cart-total-amounts small { color: var(--text-muted); font-size: 0.8rem; }
.cart-delivery-info {
  font-size: 0.78rem; color: var(--text-muted);
  background: #f8faf8; border-radius: 10px;
  padding: 10px 14px; margin: 0; line-height: 1.5;
}
.btn-order-whatsapp {
  background: #25D366; color: white; border: none;
  border-radius: 50px; padding: 14px 20px;
  font-size: 0.92rem; font-weight: 700;
  cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(37,211,102,0.35);
}
.btn-order-whatsapp:hover { background: #1ebe5d; transform: translateY(-1px); }
.btn-clear-cart {
  background: none; border: none;
  color: var(--text-muted); font-size: 0.8rem;
  cursor: pointer; text-align: center;
  text-decoration: underline; padding: 4px;
}
.btn-clear-cart:hover { color: #e74c3c; }

/* ── ORDER MODAL ── */
.order-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000; display: flex;
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.order-modal {
  background: white; border-radius: 24px;
  padding: 36px; max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute; top: 20px; right: 20px;
  background: #f0f4f0; border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer;
  font-size: 0.9rem; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: #e0e8e0; }
.order-modal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; color: var(--green-deep);
  margin: 0 0 8px;
}
.modal-subtitle {
  font-size: 0.88rem; color: var(--text-muted);
  line-height: 1.6; margin-bottom: 24px;
}
.modal-form-group { margin-bottom: 18px; }
.modal-form-group label {
  display: block; font-size: 0.83rem;
  font-weight: 600; color: var(--text-dark);
  margin-bottom: 6px;
}
.modal-form-group input,
.modal-form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #e0e8e2; border-radius: 12px;
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
  color: var(--text-dark); background: #fafcfa;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.modal-form-group input:focus,
.modal-form-group textarea:focus {
  outline: none; border-color: var(--green-light);
  background: white;
}
.modal-order-summary {
  background: #f4faf6; border: 1px solid #d4eadb;
  border-radius: 14px; padding: 16px;
  margin-bottom: 20px; font-size: 0.82rem;
  color: var(--text-dark); line-height: 1.8;
}
.modal-order-summary strong { color: var(--green-deep); }
.btn-confirm-order {
  background: #25D366; color: white; border: none;
  border-radius: 50px; padding: 15px 24px;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(37,211,102,0.35);
}
.btn-confirm-order:hover { background: #1ebe5d; transform: translateY(-1px); }

/* ── FLOATING CART (mobile) ── */
.cart-float {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--green-deep); color: white;
  border: none; border-radius: 50px;
  padding: 14px 28px;
  font-size: 0.9rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  z-index: 700; transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}
.cart-float:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 12px 36px rgba(0,0,0,0.3); }
.cart-float-count {
  background: #e8612a; border-radius: 50%;
  width: 22px; height: 22px; font-size: 0.75rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  min-width: 22px;
}
.cart-float[data-empty="true"] { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .shop-hero { padding: 100px 16px 48px; }
  .shop-filter-bar { padding: 20px 16px 12px; gap: 8px; top: 56px; }
  .shop-filter { padding: 7px 14px; font-size: 0.78rem; }
  .shop-main { padding: 0 16px; }
  .shop-products { grid-template-columns: 1fr 1fr; gap: 12px; }
  .shop-product-card { padding: 14px; }
  .prod-card-emoji { font-size: 1.5rem; }
  .add-to-cart-btn { font-size: 0.75rem; padding: 8px 10px; }
  .cart-drawer { width: 100vw; }
}
@media (max-width: 380px) {
  .shop-products { grid-template-columns: 1fr; }
}

/* ===== PRODUCT IMAGE CARDS ===== */
.prod-card-img {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f4f0;
  flex-shrink: 0;
}
.prod-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.shop-product-card:hover .prod-card-img img {
  transform: scale(1.06);
}
.prod-card-emoji-fb {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; background: #f0f4f0;
}

/* Updated card layout for image-top style */
.shop-product-card {
  flex-direction: column;
}
.prod-card-top {
  flex-direction: column;
  gap: 12px;
}

/* ===== CART ITBIS BREAKDOWN ===== */
.cart-subtotal-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--text-muted);
  padding: 2px 0;
}
.cart-subtotal-val { font-weight: 500; }
.cart-itbis-val { font-weight: 500; color: #92660a; }
.cart-total-row {
  border-top: 1.5px solid #eef2ee;
  padding-top: 10px; margin-top: 4px;
}

/* ===== IMPROVED CARD LAYOUT (image top) ===== */
.prod-card-top {
  align-items: stretch;
}
.prod-card-info { padding: 0; }
.prod-card-info h3 { font-size: 0.92rem; }
.prod-avail { align-self: flex-start; }

/* ===== SHOP UX IMPROVEMENTS ===== */

/* Smooth card image zoom on hover */
.shop-product-card {
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}

/* Image skeleton loading shimmer */
.prod-card-img {
  background: linear-gradient(90deg, #f0f4f0 25%, #e4ede4 50%, #f0f4f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.prod-card-img img { position: relative; z-index: 1; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Stop shimmer once image loads */
.prod-card-img:has(img[complete]) {
  animation: none;
  background: #f0f4f0;
}

/* Product cards stagger entrance */
.shop-products .shop-product-card {
  animation: shopCardIn 0.4s ease both;
}
.shop-products .shop-product-card:nth-child(2)  { animation-delay: 0.05s; }
.shop-products .shop-product-card:nth-child(3)  { animation-delay: 0.10s; }
.shop-products .shop-product-card:nth-child(4)  { animation-delay: 0.15s; }
.shop-products .shop-product-card:nth-child(5)  { animation-delay: 0.20s; }
.shop-products .shop-product-card:nth-child(6)  { animation-delay: 0.25s; }
.shop-products .shop-product-card:nth-child(7)  { animation-delay: 0.30s; }
.shop-products .shop-product-card:nth-child(8)  { animation-delay: 0.35s; }
@keyframes shopCardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Qty button pulse on add */
@keyframes qtyPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.qty-val.pulse { animation: qtyPulse 0.25s ease; }

/* Cart item entrance (already in, but make smoother) */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Add to cart button bounce */
.add-to-cart-btn {
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.add-to-cart-btn:active { transform: scale(0.96); }

/* Filter active indicator */
.shop-filter.active {
  box-shadow: 0 4px 14px rgba(29,77,51,0.3);
  transform: translateY(-1px);
}
.shop-filter {
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* Hero text entrance */
.shop-hero-inner h1 {
  animation: heroSlideUp 0.6s ease both;
}
.shop-hero-inner p {
  animation: heroSlideUp 0.6s 0.15s ease both;
}
.shop-hero-badges {
  animation: heroSlideUp 0.6s 0.3s ease both;
}
@keyframes heroSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Availability badge tooltips */
.prod-avail {
  position: relative; cursor: help;
}

/* Cart total row better spacing */
.cart-total-row {
  padding-top: 12px; margin-top: 8px;
}
.cart-total-row > span {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-dark);
}
.cart-total-amounts strong {
  font-size: 1.4rem;
}

/* Order form focus glow */
.modal-form-group input:focus,
.modal-form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
}

/* WhatsApp button ripple effect */
.btn-order-whatsapp, .btn-confirm-order {
  position: relative; overflow: hidden;
}
.btn-order-whatsapp::after, .btn-confirm-order::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.3s;
}
.btn-order-whatsapp:active::after,
.btn-confirm-order:active::after {
  background: rgba(255,255,255,0.15);
}

/* Empty cart illustration */
.cart-empty span {
  animation: emptyBounce 2s ease infinite;
}
@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* Sticky filter bar blur */
.shop-filter-bar {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
