/* ==========================================================================
   SHOP PAGE ONLY (shop.php). Product cards, search, categories, details popup.
   Nothing here is used by the home page, so home-page edits can never affect items.
   ========================================================================== */
.shop-hero { position: relative; z-index: 1; padding: 34px 20px 8px; text-align: center; }
.shop-hero-inner { max-width: 900px; margin: 0 auto; }
.crumbs { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.crumbs a { color: var(--primary); text-decoration: none; }
.shop-title { font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.15; color: var(--text-main); }
.shop-sig { font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--accent-chilli); line-height: 1.2; margin: 4px 0 10px; }
.shop-lead { color: var(--text-muted); max-width: 56ch; margin: 0 auto 18px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.trust-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 30px; font-size: .78rem; font-weight: 700; background: var(--surface); border: 1px solid var(--border); color: var(--text-main); }
.trust-chip b { color: var(--accent-leaf); }

/* festival ribbon (only written to the page while the offer is active) */
.offer-ribbon { max-width: 1240px; margin: 18px auto 0; padding: 12px 18px; border-radius: 16px; display: flex; align-items: center; gap: 12px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent-chilli) 60%, var(--accent-turmeric)); box-shadow: 0 8px 22px var(--primary-glow); position: relative; z-index: 1; }
.offer-ribbon .oe { font-size: 1.8rem; flex: none; }
.offer-ribbon p { font-size: .9rem; font-weight: 600; line-height: 1.4; }
.offer-ribbon small { display: block; opacity: .9; font-weight: 500; }
.offer-wrap { padding: 0 20px; position: relative; z-index: 1; }

.shop-section { padding-top: 26px; }

/* toolbar: search + sort */
.shop-toolbar { max-width: 860px; margin: 0 auto 14px; display: flex; gap: 10px; align-items: center; }
.shop-search { position: relative; flex: 1; min-width: 0; }
.shop-search input { width: 100%; min-height: 50px; padding: 12px 46px; border-radius: 50px; border: 1.5px solid var(--accent-brass); background: var(--surface); color: var(--text-main); font-family: inherit; font-size: 16px; outline: none; box-shadow: 0 6px 18px rgba(148,24,52,.08); transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.shop-search input:focus { border-color: var(--primary); box-shadow: 0 8px 22px var(--primary-glow); }
.shop-search input::-webkit-search-cancel-button { display: none; }
.shop-search-ico { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); font-size: 1.05rem; pointer-events: none; }
.shop-search-clear { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 1.05rem; cursor: pointer; }
.shop-search-clear[hidden] { display: none; }
.shop-search-clear:hover { color: var(--primary); background: rgba(148,24,52,.08); }
.sort-select { flex: none; min-height: 50px; padding: 0 16px; border-radius: 50px; border: 1.5px solid var(--accent-brass); background: var(--surface); color: var(--text-main); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; outline: none; max-width: 190px; }
.sort-select:focus { border-color: var(--primary); }
.search-count { text-align: center; min-height: 1.4em; margin-bottom: 14px; font-size: .84rem; font-weight: 600; color: var(--text-muted); }
.search-count b { color: var(--primary); }

/* categories */
.category-nav { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 auto 36px; max-width: 860px; }
.category-pill { flex: none; min-height: 44px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); padding: 8px 20px; border-radius: 30px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap; }
.category-pill.active, .category-pill:hover { background: var(--primary); color: #FFF; border-color: var(--primary); box-shadow: 0 4px 12px var(--primary-glow); }
html[data-theme="dark"] .category-pill.active, html[data-theme="dark"] .category-pill:hover { background: #D6304F; border-color: #D6304F; }

/* grid + shelf */
.shelf-rack { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px,100%),1fr)); gap: 24px; position: relative; padding-bottom: 2px; }
.shelf-rack::after { content: ''; position: absolute; bottom: -14px; left: 0; right: 0; height: 14px; background: var(--wood-shelf); border-radius: 4px; }
.podi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--card-shadow); position: relative; overflow: hidden; min-width: 0; transition: transform .25s ease, border-color .25s ease; }
.podi-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.podi-card.is-off { opacity: .92; }
.podi-card.is-off .jar-image { filter: grayscale(.6) drop-shadow(0 8px 16px rgba(0,0,0,.15)); }
.jar-visual-container { height: 160px; display: grid; place-items: center; margin-bottom: 14px; overflow: hidden; border-radius: 14px; background: radial-gradient(circle at 50% 40%, rgba(232,158,25,.14), rgba(197,136,43,.04) 70%); position: relative; }
.jar-image { width: 130px; height: 130px; max-width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: center; border-radius: 12px; transition: transform .4s cubic-bezier(.16,1,.3,1); filter: drop-shadow(0 8px 16px rgba(0,0,0,.15)); }
.podi-card:hover .jar-image { transform: scale(1.15); }

.badge-container { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; z-index: 10; pointer-events: none; }
.badge-discount { background: linear-gradient(135deg,#FF4D6D,#D8311E); color: #FFF; padding: 4px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; box-shadow: 0 4px 10px rgba(216,49,30,.3); }
.badge-special { background: linear-gradient(135deg,#E89E19,#C5882B); color: #FFF; padding: 3px 8px; border-radius: 14px; font-size: .68rem; font-weight: 700; }
.badge-featured { background: linear-gradient(135deg,#2A6F41,#38A169); color: #FFF; padding: 3px 8px; border-radius: 14px; font-size: .68rem; font-weight: 700; }
.badge-recommended { background: linear-gradient(135deg,#8B5CF6,#6D28D9); color: #FFF; padding: 3px 8px; border-radius: 14px; font-size: .68rem; font-weight: 700; }
.badge-coming { background: linear-gradient(135deg,#3B82F6,#1D4ED8); color: #FFF; padding: 4px 10px; border-radius: 14px; font-size: .7rem; font-weight: 700; animation: badgePulse 2s infinite; }
.badge-out { background: linear-gradient(135deg,#EF4444,#B91C1C); color: #FFF; padding: 4px 10px; border-radius: 14px; font-size: .7rem; font-weight: 700; animation: badgePulse 2s infinite; }
@keyframes badgePulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: .85; } }

.card-cat { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--accent-brass); margin-bottom: 4px; }
.meta-badges-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.packing-select { font-size: .85rem; min-height: 36px; max-width: 100%; color: var(--text-main); background-color: var(--bg); border: 1.5px solid var(--accent-brass); font-weight: 700; font-family: inherit; padding: 5px 10px; border-radius: 10px; outline: none; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.06); transition: border-color .2s; }
.packing-select:focus { border-color: var(--primary); }
.packing-select:disabled { opacity: .6; cursor: not-allowed; }
.age-group-tag { font-size: .75rem; color: var(--accent-leaf); font-weight: 700; background: rgba(42,111,65,.1); padding: 6px 10px; border-radius: 10px; max-width: 100%; overflow-wrap: anywhere; }
.podi-name { font-size: 1.2rem; color: var(--primary); margin-bottom: 2px; overflow-wrap: anywhere; }
.podi-per-kg { font-size: .8rem; font-weight: 700; color: var(--accent-chilli); margin-bottom: 6px; display: block; }
.podi-desc { font-size: .88rem; color: var(--text-muted); margin-bottom: 14px; flex-grow: 1; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { border-top: 1px dashed var(--border); padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-box { display: flex; flex-direction: column; line-height: 1.15; }
.price-tag { font-family: 'Rozha One', serif; font-size: 1.25rem; color: var(--primary); white-space: nowrap; }
.price-was { font-size: .78rem; color: var(--text-muted); text-decoration: line-through; white-space: nowrap; min-height: 1em; }
.card-action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-details { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 9px 14px; min-height: 44px; border-radius: 22px; font: inherit; font-weight: 600; cursor: pointer; font-size: .8rem; transition: all .2s; }
.btn-details:hover { border-color: var(--primary); color: var(--primary); }
.btn-cart { background: var(--primary); color: #FFF; border: none; padding: 9px 16px; min-height: 44px; border-radius: 22px; font: inherit; font-weight: 700; cursor: pointer; font-size: .8rem; }
html[data-theme="dark"] .btn-cart { background: #D6304F; }
.btn-cart:disabled { background: #9CA3AF !important; color: #E5E7EB !important; cursor: not-allowed; box-shadow: none; opacity: .65; }
.empty-note { grid-column: 1/-1; text-align: center; color: var(--text-muted); padding: 40px 0; }
.empty-note a { color: #25D366; font-weight: 700; }

.help-strip { max-width: 1240px; margin: 56px auto 0; padding: 22px; border-radius: 20px; border: 1.5px dashed var(--accent-brass); background: var(--surface); text-align: center; position: relative; z-index: 1; }
.help-strip h3 { font-size: 1.25rem; margin-bottom: 4px; }
.help-strip p { color: var(--text-muted); font-size: .9rem; margin-bottom: 12px; }
.help-strip .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* product details popup */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,6,12,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: max(16px,var(--sat)) max(16px,var(--sar)) max(16px,var(--sab)) max(16px,var(--sal)); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 1200; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; max-width: 560px; width: 100%; padding: 22px; position: relative; box-shadow: 0 24px 60px rgba(0,0,0,.4); max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transform: translateY(18px) scale(.97); transition: transform .3s cubic-bezier(.16,1,.3,1); }
.modal-overlay.active .modal-card { transform: none; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; background: transparent; border: none; font-size: 1.4rem; color: var(--text-muted); cursor: pointer; z-index: 2; border-radius: 50%; }
.modal-close:hover { color: var(--primary); background: rgba(148,24,52,.08); }
.modal-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding-right: 40px; }
.modal-thumb { width: 74px; height: 74px; flex: none; border-radius: 18px; object-fit: cover; border: 2px solid var(--accent-brass); background: rgba(197,136,43,.1); box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.modal-hero-text { min-width: 0; }
.modal-eyebrow { display: block; font-size: .72rem; font-weight: 700; color: var(--accent-brass); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.modal-title { font-size: 1.4rem; line-height: 1.2; color: var(--primary); overflow-wrap: anywhere; }
.info-card { position: relative; overflow: hidden; border-radius: 20px; padding: 20px 18px 16px; margin-bottom: 14px; border: 1.5px solid; }
.info-card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 5px; }
.info-desc { background: linear-gradient(135deg, rgba(148,24,52,.08), rgba(216,49,30,.04)); border-color: rgba(148,24,52,.3); }
.info-desc::before { background: linear-gradient(90deg, var(--primary), var(--accent-chilli), var(--accent-turmeric)); }
.info-health { background: linear-gradient(135deg, rgba(42,111,65,.11), rgba(232,158,25,.07)); border-color: rgba(42,111,65,.34); }
.info-health::before { background: linear-gradient(90deg, var(--accent-leaf), #38A169, var(--accent-turmeric)); }
.info-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.info-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.info-desc .info-icon { background: linear-gradient(135deg, var(--primary), var(--accent-chilli)); }
.info-health .info-icon { background: linear-gradient(135deg, var(--accent-leaf), #38A169); }
.info-head h4 { font-family: 'Rozha One', serif; font-weight: 400; font-size: 1.12rem; line-height: 1.2; }
.info-desc .info-head h4 { color: var(--primary); }
.info-health .info-head h4 { color: var(--accent-leaf); }
.rich { font-size: .94rem; line-height: 1.7; color: var(--text-main); overflow-wrap: anywhere; }
.rich p, .rich div { margin: 0 0 .7em; }
.rich ul, .rich ol { margin: 0 0 .7em 1.25em; }
.rich li { margin-bottom: .3em; }
.rich h3, .rich h4, .rich h5 { font-family: inherit; font-size: 1rem; font-weight: 700; margin: .4em 0 .3em; }
.rich strong, .rich b { color: var(--primary); }
.info-health .rich strong, .info-health .rich b { color: var(--accent-leaf); }
.rich > :last-child { margin-bottom: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .primary-btn, .modal-actions .secondary-btn { flex: 1; justify-content: center; }

@media (max-width: 600px) {
  .shop-hero { padding: 22px 14px 4px; }
  .offer-wrap { padding: 0 12px; }
  .offer-ribbon { padding: 10px 14px; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .sort-select { max-width: none; width: 100%; min-height: 46px; }
  .category-nav { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -14px 28px; padding: 2px 14px 8px; max-width: none; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  .category-nav::-webkit-scrollbar { display: none; }
  .category-pill { scroll-snap-align: start; }
  .shelf-rack { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .podi-card { padding: 12px; border-radius: 16px; }
  .jar-visual-container { height: 150px; margin-bottom: 10px; border-radius: 10px; }
  .badge-container { top: 8px; left: 8px; right: 8px; gap: 4px; }
  .badge-discount, .badge-special, .badge-featured, .badge-recommended, .badge-coming, .badge-out { font-size: .6rem; padding: 2px 7px; }
  .meta-badges-row { gap: 4px; margin-bottom: 6px; }
  .packing-select { font-size: 16px; padding: 3px 6px; min-height: 40px; width: 100%; }
  .age-group-tag { font-size: .62rem; padding: 4px 6px; }
  .card-cat { font-size: .6rem; }
  .podi-name { font-size: .95rem; }
  .podi-per-kg { font-size: .68rem; }
  .podi-desc { font-size: .75rem; -webkit-line-clamp: 2; line-clamp: 2; margin-bottom: 10px; }
  .card-footer { flex-direction: column; align-items: stretch; gap: 8px; }
  .price-box { align-items: center; }
  .price-tag { font-size: 1.05rem; }
  .card-action-btns { width: 100%; flex-direction: column; gap: 6px; }
  .card-action-btns .btn-details, .card-action-btns .btn-cart { width: 100%; font-size: .75rem; padding: 8px 10px; min-height: 44px; }
  .modal-overlay { padding: 10px; }
  .modal-card { padding: 18px 14px; border-radius: 20px; }
  .modal-thumb { width: 60px; height: 60px; border-radius: 14px; }
  .modal-title { font-size: 1.2rem; }
  .info-card { padding: 18px 14px 14px; }
  .modal-actions { flex-direction: column-reverse; }
}
@media (max-width: 340px) { .shelf-rack { gap: 8px; } .podi-card { padding: 10px; } .jar-image { width: 110px; height: 110px; } }
@media (hover: none) {
  .podi-card:hover { transform: none; border-color: var(--border); }
  .podi-card:hover .jar-image { transform: none; }
  .category-pill:hover:not(.active) { background: var(--surface); color: var(--text-muted); border-color: var(--border); box-shadow: none; }
}
