/* ==========================================================
   pro.css  -  Amma's Ingredients  -  Products page only
   This is the page-specific CSS that used to sit in the inline
   <style> block of pro.php. Header, footer and cart-sidebar CSS
   now come from header.css / footer.css / cart_sidebar.css.
   Product-card rules are unchanged from the original.
   ========================================================== */

/* ── CSS VARIABLES ── */
:root {
  --primary-color: #b94a1a;
  --primary-hover: #d05a22;
  --primary-light: #fdf0eb;
  --primary-border: #f5cfc0;
  --dark-color: #2c2c2c;
  --text-color: #2c2c2c;
  --text-light: #4b5563;
  --text-muted: #6b7280;
  --white: #fff;
  --border-color: #ebebeb;
  --bg-light: #fdf8f6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.1);
  --font-primary: 'Nunito', sans-serif;
  --font-heading: 'Playfair Display', serif;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-primary); color: var(--text-color); background: var(--white); overflow-x: hidden; width: 100%; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ── SEARCH BAR (only used if header.php outputs one) ── */
.search-bar { display: none; position: absolute; top: 70px; left: 0; right: 0; background: var(--white); padding: 16px 24px; box-shadow: var(--shadow); z-index: 100; border-top: 1px solid var(--border-color); }
.search-bar.active { display: flex; gap: 10px; animation: slideDown 0.2s ease forwards; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.search-bar input { flex: 1; padding: 12px 16px; border: 2px solid var(--border-color); border-radius: 8px; font-family: var(--font-primary); font-size: 14px; outline: none; transition: border-color 0.2s; }
.search-bar input:focus { border-color: var(--primary-color); }
.search-bar button { background: var(--primary-color); color: var(--white); border: none; padding: 12px 20px; border-radius: 8px; cursor: pointer; font-size: 16px; transition: background 0.2s; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.search-bar button:hover { background: var(--primary-hover); }

/* ── MAIN CONTENT ── */
.main-content { max-width: 1300px; margin: 0 auto; padding: 30px 24px; display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: start; }

/* ── CATEGORIES SIDEBAR (now real links, so Google can crawl each category) ── */
.categories-sidebar { background: var(--white); border: 1px solid var(--border-color); border-radius: 14px; padding: 20px; position: sticky; top: 90px; }
/* A plain block: header.css styles every bare <nav> as the header menu, so we deliberately do not use one here */
.categories-nav { display: block; width: 100%; }
.categories-title { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--text-color); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--primary-color); }
.category-list { list-style: none; }
.category-list li { margin-bottom: 4px; border-radius: 8px; transition: background 0.18s, color 0.18s; }
.category-list li a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-color); text-decoration: none; }
.category-list li:hover { background: var(--primary-light); }
.category-list li:hover a { color: var(--primary-color); }
.category-list li.active { background: var(--primary-light); border: 1px solid var(--primary-border); }
.category-list li.active a { color: var(--primary-color); }

/* ── PRODUCTS SECTION ── */
.products-section { flex: 1; min-width: 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.section-header h1 { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--text-color); line-height: 1.25; }
.products-intro { flex: 1; min-width: 250px; }
.products-intro p { font-size: 14.5px; color: var(--text-light); margin-top: 8px; line-height: 1.8; max-width: 900px; }
.sort-by { display: flex; align-items: center; gap: 10px; }
.sort-by label { font-size: 14px; font-weight: 600; color: var(--text-light); }
.sort-by select { padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 8px; font-family: var(--font-primary); font-size: 14px; color: var(--text-color); background: var(--white); cursor: pointer; outline: none; }
.sort-by select:focus { border-color: var(--primary-color); }
.sort-by .sort-go { padding: 10px 16px; border: 1px solid var(--primary-border); border-radius: 8px; background: var(--primary-light); color: var(--primary-color); font-weight: 700; cursor: pointer; }
.js .sort-by .sort-go { display: none; }   /* the select auto-submits when JS is on */
.search-note { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.search-note a { color: var(--primary-color); font-weight: 700; }

/* ── PRODUCTS GRID ── */
.products-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* ── PRODUCT CARD (unchanged) ── */
.product-card { background: #fff; border: 1px solid #ebebeb; border-radius: 12px; overflow: hidden; transition: transform 0.22s, box-shadow 0.22s; position: relative; display: flex; flex-direction: column; width: 100%; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); }

.product-image { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 12px 12px 0 0; overflow: hidden; background: #f9f5f2; flex-shrink: 0; }
.product-image img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; transition: opacity 0.3s ease, transform 0.4s; }
.product-image .img-primary { opacity: 1; z-index: 2; }
.product-image .img-hover { opacity: 0; z-index: 1; }
.product-card:hover .product-image .img-primary.has-hover { opacity: 0; }
.product-card:hover .product-image .img-hover { opacity: 1; z-index: 3; }
.product-card:hover .product-image img { transform: scale(1.05); }

.sale-badge { position: absolute; top: 8px; left: 8px; background: var(--primary-color) !important; color: var(--white) !important; font-size: 9.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; letter-spacing: 0.04em; z-index: 10; display: block !important; visibility: visible !important; }
.discount-badge-right { position: absolute; top: 8px; right: 8px; background: var(--dark-color) !important; color: var(--white) !important; font-size: 9.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.04em; z-index: 10; display: block !important; }

.wishlist-btn { position: absolute; bottom: 10px; right: -55px; background: rgba(0, 0, 0, 0.4) !important; border: 1.5px solid #ffffff; border-radius: 18px 0 0 18px; padding: 6px 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 5; color: #ffffff; font-size: 15px; opacity: 0; visibility: hidden; transition: all 0.25s ease; min-height: 34px; min-width: 44px; }
.product-card:hover .wishlist-btn { right: 0; opacity: 1; visibility: visible; }
.wishlist-btn:hover { background: rgba(0, 0, 0, 0.65) !important; }
.wishlist-btn.active { right: 0 !important; opacity: 1 !important; visibility: visible !important; color: #e11d48 !important; }

.product-info { padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.product-name { font-size: 13.5px; font-weight: 700; color: var(--text-color); line-height: 1.35; margin-bottom: 6px; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-sku-dropdown { width: 100%; padding: 6px 8px; border: 1px solid #f5cfc0; border-radius: 6px; color: #b94a1a; font-weight: 700; font-family: 'Nunito', sans-serif; cursor: pointer; outline: none; background: #fff; font-size: 12.5px; }

.price-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; margin-top: auto; flex-wrap: wrap; }
.price-sale { font-size: 15px; font-weight: 700; color: #b94a1a; }
.price-original { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }

.product-actions { display: flex; gap: 6px; }
.add-to-cart-btn { flex: 1; background: #2c2c2c; color: #fff; border: none; border-radius: 6px; padding: 9px 4px; font-family: var(--font-primary); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background 0.2s; letter-spacing: 0.03em; min-height: 40px; }
.add-to-cart-btn:hover { background: #b94a1a; }
.add-to-cart-btn.large { padding: 14px 24px; font-size: 14px; min-height: 48px; }
.view-details-btn { background: #fdf0eb; color: #b94a1a; border: 1px solid #f5cfc0; border-radius: 6px; padding: 9px 10px; font-size: 13px; cursor: pointer; transition: background 0.2s; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
.view-details-btn:hover { background: #b94a1a; color: #fff; }

.no-products { text-align: center; padding: 60px 20px; color: var(--text-muted); grid-column: 1 / -1; }
.no-products i { font-size: 48px; margin-bottom: 16px; color: #ccc; display: block; }
.no-products a { color: var(--primary-color); font-weight: 700; }

/* ── MODALS (product + login) ── */
.modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 1000; align-items: center; justify-content: center; padding: 16px; }
.modal-content { background: var(--white); border-radius: 14px; max-width: 860px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.close-modal { position: absolute; top: 12px; right: 16px; font-size: 26px; color: var(--text-muted); cursor: pointer; z-index: 10; transition: color 0.2s; border: none; background: transparent; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.close-modal:hover { color: var(--primary-color); }
.modal-body { padding: 24px; }

.modal-product { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.modal-slider-wrap { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: #f9f5f2; aspect-ratio: 1 / 1; }
.modal-slider-img { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: none; }
.modal-slider-img.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0.5; } to { opacity: 1; } }
.modal-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.9); border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #b94a1a; transition: background 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.modal-arrow:hover { background: #fff; }
.modal-arrow.left { left: 8px; }
.modal-arrow.right { right: 8px; }
.modal-thumbnails { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-top: 10px; }
.modal-thumbnail { width: 60px; height: 60px; aspect-ratio: 1; border-radius: 6px; cursor: pointer; border: 2px solid transparent; object-fit: cover; opacity: 0.6; transition: all 0.2s ease; flex-shrink: 0; }
.modal-thumbnail.active, .modal-thumbnail:hover { opacity: 1; border-color: #b94a1a; }

.modal-details h2 { font-family: var(--font-heading); font-size: 24px; font-weight: 700; color: var(--text-color); margin-bottom: 6px; }
.modal-category { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.modal-price { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.modal-price .price-sale { font-size: 22px; color: var(--primary-color); font-weight: 700; }
.modal-price .price-original { font-size: 15px; color: var(--text-muted); text-decoration: line-through; }
.discount-tag { background: var(--primary-light); color: var(--primary-color); font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--primary-border); }
.modal-description { font-size: 13.5px; color: var(--text-light); line-height: 1.6; margin-bottom: 20px; }
.quantity-selector { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.quantity-selector label { font-size: 13.5px; font-weight: 600; color: var(--text-color); }
.quantity-selector button { width: 38px; height: 38px; border: 1px solid var(--border-color); background: var(--white); border-radius: 6px; font-size: 18px; cursor: pointer; transition: background 0.2s; }
.quantity-selector button:hover { background: var(--primary-light); }
.quantity-selector input { width: 50px; height: 38px; text-align: center; border: 1px solid var(--border-color); border-radius: 6px; font-family: var(--font-primary); font-size: 14px; outline: none; }
.modal-sku-dropdown { width: 100%; max-width: 250px; padding: 8px 12px; border: 1px solid #f5cfc0; border-radius: 6px; color: #b94a1a; font-weight: 700; font-family: 'Nunito', sans-serif; cursor: pointer; outline: none; background: #fff; font-size: 13px; }

.login-modal { max-width: 400px; padding: 20px; }
.login-form, .register-form { padding: 10px 0; }
.login-form h2, .register-form h2 { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--text-color); margin-bottom: 20px; text-align: center; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-color); margin-bottom: 4px; }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-family: var(--font-primary); font-size: 13.5px; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: var(--primary-color); }
.login-btn, .register-btn { width: 100%; background: var(--primary-color); color: var(--white); border: none; border-radius: 6px; padding: 12px; font-family: var(--font-primary); font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background 0.2s; margin-top: 6px; min-height: 48px; }
.login-btn:hover, .register-btn:hover { background: var(--primary-hover); }
.register-link, .login-link { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--text-light); }
.register-link a, .login-link a { color: var(--primary-color); font-weight: 600; text-decoration: none; }

/* ── WHATSAPP WIDGET ── */
.whatsapp-container { position: fixed; bottom: 20px; left: 20px; z-index: 1000; font-family: 'Nunito', sans-serif; }
.whatsapp-float { width: 56px; height: 56px; background-color: #25d366; color: #FFF; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); cursor: pointer; transition: transform 0.25s ease; position: relative; }
.whatsapp-float::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #25d366; opacity: 0.8; animation: pulseWaGpu 2s infinite cubic-bezier(0.24, 0, 0.38, 1); pointer-events: none; }
@keyframes pulseWaGpu { 0% { transform: scale(0.95); opacity: 0.8; } 70% { transform: scale(1.35); opacity: 0; } 100% { transform: scale(1.35); opacity: 0; } }
.whatsapp-float:hover { transform: translateY(-3px); }
.whatsapp-popup { position: absolute; bottom: 70px; left: 0; width: 280px; background: #fff; border-radius: 12px; box-shadow: 0 8px 25px rgba(0,0,0,0.15); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(16px); transition: all 0.25s ease; }
.whatsapp-popup.active { opacity: 1; visibility: visible; transform: translateY(0); }
.wa-header { background: #075e54; color: #fff; padding: 14px; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.wa-close { cursor: pointer; font-size: 22px; line-height: 1; opacity: 0.8; border: none; background: transparent; color: #fff; min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.wa-close:hover { opacity: 1; }
.wa-body { padding: 16px; background: #ece5dd; }
.wa-message { background: #fff; padding: 10px 14px; border-radius: 0 10px 10px 10px; font-size: 12.5px; color: #2c2c2c; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); position: relative; line-height: 1.5; }
.wa-message::before { content: ''; position: absolute; top: 0; left: -8px; border-top: 10px solid #fff; border-left: 10px solid transparent; }
.wa-btn { display: block; text-align: center; background: #25d366; color: #fff; text-decoration: none; padding: 10px; border-radius: 20px; font-weight: 700; font-size: 13.5px; min-height: 40px; line-height: 20px; }

/* ══════════════════════════════════════════════════════════
   SEO TEXT BLOCK + CITATIONS (bottom of the page)
   Replaces the old inline styles. Real sources, real quote.
   ══════════════════════════════════════════════════════════ */
.seo-block { background: var(--bg-light); padding: 56px 20px; border-top: 1px solid var(--border-color); }
.seo-wrap { max-width: 900px; margin: 0 auto; }
.seo-block h2 { font-family: var(--font-heading); font-size: 26px; font-weight: 700; color: var(--dark-color); margin-bottom: 22px; text-align: center; line-height: 1.3; }
.seo-block h3 { font-family: var(--font-heading); font-size: 20px; font-weight: 600; color: var(--dark-color); margin: 32px 0 12px; line-height: 1.35; }
.seo-lead { font-size: 16px; color: #1f2937; line-height: 1.8; margin-bottom: 20px; font-weight: 500; }
.seo-block p { font-size: 15.5px; color: var(--text-light); line-height: 1.8; margin-bottom: 16px; }
.seo-block .seo-lead { font-size: 16px; color: #1f2937; }
.seo-block a { color: var(--primary-color); font-weight: 700; text-underline-offset: 3px; }
.seo-block a:hover { color: #9c3f14; }

.seo-quote { margin: 28px 0; padding: 20px 24px; background: #fff; border: 1px solid var(--border-color); border-left: 4px solid var(--primary-color); border-radius: 0 14px 14px 0; box-shadow: var(--shadow); }
.seo-quote blockquote p { font-family: var(--font-heading); font-size: 20px; font-style: italic; line-height: 1.5; color: var(--dark-color); margin: 0; }
.seo-quote figcaption { margin-top: 12px; font-size: 14px; color: var(--text-light); }
.seo-quote cite { font-style: normal; font-weight: 700; }

.seo-sources { margin: 0; padding-left: 22px; display: grid; gap: 12px; font-size: 15px; line-height: 1.7; color: var(--text-light); }
.seo-sources li::marker { color: var(--primary-color); font-weight: 700; }
.seo-sources cite { font-style: normal; font-weight: 700; }

.seo-block .seo-meta { margin-top: 32px; padding: 14px 18px; background: #fff; border: 1px solid var(--border-color); border-radius: 10px; font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.seo-block .seo-meta strong { color: var(--dark-color); font-weight: 700; }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 1200px) {
  .products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .main-content { grid-template-columns: 1fr; padding: 16px; gap: 15px; width: 100%; max-width: 100%; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; margin: 0; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-header h1 { font-size: 24px; line-height: 1.3; }
  .sort-by { width: 100%; justify-content: space-between; }
  .sort-by select { flex: 1; }

  /* Mobile categories: horizontal pills row */
  .categories-sidebar { position: static; padding: 0; border: none; border-radius: 0; margin-bottom: 5px; background: transparent; box-shadow: none; width: 100%; max-width: 100%; overflow: hidden; }
  .categories-title { display: none; }
  .category-list { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 4px 12px 10px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; background: transparent; border: none; width: 100%; }
  .category-list::-webkit-scrollbar { display: none; }
  .category-list li { flex: 0 0 auto; margin: 0; background: #f7f3f0; border: 1px solid var(--primary-border); border-radius: 20px; }
  .category-list li a { padding: 8px 16px; font-size: 13px; color: var(--primary-color); white-space: nowrap; border-radius: 20px; }
  .category-list li:hover { background: #f7f3f0; }
  .category-list li.active { background: var(--primary-color); border-color: var(--primary-color); }
  .category-list li.active a { color: #fff; }
}

@media (max-width: 540px) {
  .products-grid { gap: 8px; }
  .product-card { border-radius: 10px; }
  .product-info { padding: 10px; }
  .product-name { font-size: 12.5px; height: 34px; margin-bottom: 6px; }
  .product-sku-dropdown { padding: 5px 6px; font-size: 11.5px; }
  .price-row { margin-bottom: 8px; }
  .price-sale { font-size: 13.5px; }
  .price-original { font-size: 10.5px; }
  .product-actions { gap: 4px; }
  .add-to-cart-btn { padding: 7px 2px; font-size: 11.5px; }
  .view-details-btn { padding: 7px 8px; font-size: 12px; }

  .whatsapp-float { width: 50px; height: 50px; font-size: 28px; }
  .whatsapp-popup { width: 260px; left: 10px; }

  .modal-product { grid-template-columns: 1fr; gap: 16px; }

  .seo-block { padding: 40px 16px; }
  .seo-block h2 { font-size: 22px; }
  .seo-quote { padding: 16px 18px; }
  .seo-quote blockquote p { font-size: 18px; }
}
@media (max-width: 360px) { .price-sale { font-size: 13px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .whatsapp-float::before { animation: none; }
  .product-card, .product-image img { transition: none; }
}