/* ===========================================================
   CLEAN HEALTH FORMULA - PRODUCTS PAGE (v6.2 FINAL POLISHED)
   =========================================================== */

/* ---------- PAGE HEADER ---------- */
.page-header {
  text-align: center;
  margin: 24px 0 10px;
}
.page-header .centered-heading {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 6px;
}
.page-header .center-text {
  color: #777;
  font-size: 1rem;
}

/* ---------- SHOP CONTROLS (SEARCH + SORT) ---------- */
.shop-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 22px 0 36px;
}

/* Search box */
.inline-form {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  padding: 6px 10px;
  width: 60%;
  max-width: 700px;
  position: relative;
  transition: box-shadow 0.2s ease;
}
.inline-form:hover {
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
}
.inline-form .search-input {
  border: none;
  outline: none;
  flex: 1;
  padding: 8px 14px;
  font-size: 1rem;
  border-radius: 40px;
  background: transparent;
}
.inline-form .search-btn {
  border: none;
  background: transparent;
  color: var(--green-dark);
  font-size: 1.1rem;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.inline-form .search-btn:hover {
  transform: scale(1.1);
}

/* Search suggestions */
#searchSuggestions {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  z-index: 1200;
  max-height: 280px;
  overflow-y: auto;
}
#searchSuggestions li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
#searchSuggestions li:hover {
  background: var(--beige);
}
#searchSuggestions img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}
#searchSuggestions span {
  font-size: 0.95rem;
  color: #333;
}

/* Sort dropdown (desktop only) */
.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-label {
  font-weight: 600;
  color: #333;
}
.sort-wrapper select {
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  padding: 8px 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
  font-weight: 500;
}

/* ---------- MOBILE FILTER / SORT CONTROLS ---------- */
.mobile-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px auto 24px;
}
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
  border-radius: 25px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.pill-btn:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.pill-btn i {
  font-size: 1rem;
}

/* Clear Filters Button */
.clear-filter-mobile {
  display: none;
  background: #fff;
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
  border-radius: 25px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
}
.clear-filter-mobile:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.has-active-filter .clear-filter-mobile {
  display: inline-flex;
}

/* ---------- LAYOUT ---------- */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 60px;
}

/* ---------- FILTER SIDEBAR (DESKTOP) ---------- */
.filters {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 90px;
  height: fit-content;
}
.filter-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 14px;
}
.category-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cat-pill {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fafafa;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
}
.cat-pill:hover {
  background: var(--beige);
  transform: translateX(4px);
}
.cat-pill.active {
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 6px 18px rgba(47, 93, 56, 0.12);
}
.clear-filter {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  color: #d63031;
  text-decoration: none;
  font-weight: 600;
}
.clear-filter:hover {
  text-decoration: underline;
}

/* ---------- PRODUCT GRID ---------- */
.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}
.product-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border 0.25s ease;
  border: 1px solid transparent;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--beige);
}
.product-card .thumb {
  background: #fbfbfb;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-card .thumb img {
  max-width: 85%;
  height: 180px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}
.product-card:hover .thumb img {
  transform: scale(1.04);
}

/* MOBILE — Increase image size slightly */
@media (max-width: 600px) {
  .product-card .thumb img {
    height: 200px;
    max-width: 90%;
  }
}

/* Discount badge */
.discount-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  z-index: 5;
  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
}


/* Card body */
.card-body {
  padding: 12px 14px;
  text-align: center;
}
.card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin: 4px 0;
}
.card-body .muted {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 6px;
}
.card-body .price {
  font-weight: 700;
  color: var(--orange);
  font-size: 1rem;
}
.card-body .old-price {
  text-decoration: line-through;
  color: #bbb;
  margin-left: 6px;
  font-size: 0.9rem;
}


/* Add to cart */
.add-to-cart {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  background: var(--green-dark);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 12px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.add-to-cart:hover {
  background: var(--orange);
}


/* ---------- Product Card Actions ---------- */
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px 14px;
}

.card-actions button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 0;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

/* ===========================================================
   CLEAN HEALTH FORMULA - QUICK VIEW MODAL (v2.0 FINAL)
   =========================================================== */

.quick-view-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1300;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.quick-view-modal.show {
  display: flex;
  opacity: 1;
}

.qv-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1;
  opacity: 0;
  animation: fadeOverlay 0.3s forwards;
}

/* Modal Box */
.qv-content {
  position: relative;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  max-width: 850px;
  width: 92%;
  z-index: 2;
  overflow: hidden;
  transform: translateY(20px);
  animation: fadeUp 0.35s ease forwards;
}

.qv-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
}

/* Left: Image */
.qv-left img {
  width: 320px;
  height: 320px;
  object-fit: contain;
  border-radius: 12px;
  background: #fafafa;
}

/* Right: Info */
.qv-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.qv-right h2 {
  color: var(--green-dark);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.qv-price {
  font-size: 1.2rem;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 10px;
}
.qv-price .old-price {
  text-decoration: line-through;
  color: #aaa;
  font-size: 0.95rem;
  margin-left: 8px;
}

.qv-desc {
  color: #555;
  line-height: 1.55;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* Buttons */
#qvAddToCart {
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease;
}
#qvAddToCart:hover {
  background: var(--orange);
}

.view-details {
  display: inline-block;
  margin-top: 14px;
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.25s ease;
}
.view-details:hover {
  color: var(--orange);
}

/* Close Button */
.qv-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--green-dark);
  cursor: pointer;
  transition: color 0.25s ease;
}
.qv-close:hover {
  color: var(--orange);
}

/* =======================
   Animations
======================= */
@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =======================
   RESPONSIVE DESIGN
======================= */
@media (max-width: 768px) {
  .qv-content {
    width: 94%;
    margin: 0 auto;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 14px;
  }
  .qv-inner {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 18px;
  }
  .qv-left img {
    width: 260px;
    height: 260px;
  }
  .qv-right {
    text-align: center;
  }
  #qvAddToCart {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
  }
  .view-details {
    margin-top: 10px;
  }
}


/* ================================
   LOW STOCK BADGE OVERLAY
================================ */
.low-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e67e22;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  animation: fadeIn 0.3s ease;
}

/* Stock status text below price */
.stock-status {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 6px;
  text-align: center;
}
.stock-status.in {
  color: #1b7a36;
}
.stock-status.low {
  color: #e67e22;
}
.stock-status.out {
  color: #d63031;
}


/* ===========================================================
 🛍️ PRODUCT PAGE BUTTON LAYOUT FIX (v7.2 Consistent with Home)
----------------------------------------------------------- */

/* Wrap the buttons cleanly */
.product-card .card-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

/* Quick View button styled to match add-to-cart */
.product-card .quick-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 2px solid var(--green-dark);
  color: var(--green-dark);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.product-card .quick-view:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* Keep it responsive and balanced */
@media (max-width: 768px) {
  .product-card .card-actions {
    gap: 6px;
    padding: 8px 10px;
  }
  .product-card .quick-view {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
}

/* On very small screens, stack the buttons nicely */
@media (max-width: 480px) {
  .product-card .card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .product-card .quick-view {
    width: 100%;
    text-align: center;
  }
}




/* ============ Active Filters Bar ============ */
.active-filters-bar {
  margin: 15px 0 25px;
  text-align: center;
}
.filters-summary {
  display: inline-block;
  background: #f4faf5;
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
  border: 1px solid #d1e7d3;
}
.filters-summary a.clear-all {
  margin-left: 12px;
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}
.filters-summary a.clear-all:hover {
  text-decoration: underline;
}



/* ============ Empty State ============ */
.no-products {
  text-align: center;
  padding: 40px 0;
  color: #555;
}
.no-products .btn-primary {
  margin-top: 10px;
  display: inline-block;
}



/* ===================== Mobile Optimization ===================== */
@media (max-width: 480px) {
  .qty-selector {
    gap: 4px;
  }
  .qty-btn {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
  }
  .qty-input {
    width: 35px;
    font-size: 0.85rem;
  }
  .add-to-cart {
    font-size: 0.8rem;
    padding: 7px 0;
  }
}




/* ---------- NO PRODUCTS ---------- */
/* .no-products {
  text-align: center;
  color: #777;
  font-weight: 500;
  grid-column: 1 / -1;
  margin-top: 20px;
} */

/* ---------- FILTER BOTTOM SHEET (WHITE THEME) ---------- */
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  background: #fff;
  z-index: 1001;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.15);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bottom-sheet.open {
  transform: translateY(0%);
  opacity: 1;
  bottom: 0;
}
.sheet-inner {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.sheet-handle {
  width: 50px;
  height: 5px;
  background: #ccc;
  border-radius: 3px;
  margin: 10px auto 18px;
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.sheet-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
}
.close-sheet {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--green-dark);
  transition: color 0.25s ease, transform 0.2s ease;
}
.close-sheet:hover {
  color: var(--orange);
  transform: rotate(90deg);
}
.sheet-options {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sheet-options li {
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sheet-options li:hover {
  background: #f7f7f7;
}
.sheet-options li.active {
  background: #eaf5ec;
  color: var(--green-dark);
  font-weight: 600;
}
.sheet-footer {
  border-top: 1px solid #eee;
  padding: 16px 20px;
  background: #fff;
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.sheet-footer .btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease;
}
.sheet-footer .btn-primary:hover {
  background: var(--orange);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
  .shop-layout {
    grid-template-columns: 1fr;
    padding: 0 14px;
  }
  .filters {
    display: none;
  }
  .mobile-controls {
    display: flex;
  }
  .sort-wrapper {
    display: none; /* hide desktop sort on mobile */
  }
  .inline-form {
    width: 82%;
  }
  .page-header .centered-heading {
    font-size: 1.9rem;
  }
}
@media (max-width: 600px) {
  .inline-form {
    padding: 4px 8px;
    width: 100%;
  }
  .inline-form .search-input {
    font-size: 0.95rem;
  }
  #searchSuggestions span {
    font-size: 0.88rem;
  }
  .card-body h3 {
    font-size: 0.95rem;
  }
  .card-body .muted {
    font-size: 0.8rem;
  }
  .card-body .price {
    font-size: 0.95rem;
  }
  .page-header .centered-heading {
    font-size: 1.6rem;
  }
  .shop-controls {
    margin-bottom: 20px;
  }
  .grid-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}


/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .grid-products {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 992px) {
  .shop-layout {
    grid-template-columns: 1fr;
    padding: 0 14px;
  }

  /* Hide sidebar filters */
  .filters {
    display: none;
  }

  /* Hide desktop sort dropdown */
  .sort-wrapper {
    display: none;
  }

  /* Show mobile controls only on tablets & below */
  .mobile-controls {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 10px auto 24px;
  }

  .inline-form {
    width: 82%;
  }

  .page-header .centered-heading {
    font-size: 1.9rem;
  }
}

@media (max-width: 600px) {
  .inline-form {
    padding: 4px 8px;
    width: 80%;
  }

  .inline-form .search-input {
    font-size: 0.95rem;
  }

  #searchSuggestions span {
    font-size: 0.88rem;
  }

  .page-header .centered-heading {
    font-size: 1.6rem;
  }

  .shop-controls {
    margin-bottom: 20px;
  }

  /* ✅ Increase product image size on mobile */
  .product-card .thumb {
    padding: 10px;
  }

  .product-card .thumb img {
    height: 200px;
    max-width: 90%;
  }

  .card-body h3 {
    font-size: 0.95rem;
  }

  .card-body .muted {
    font-size: 0.8rem;
  }

  .card-body .price {
    font-size: 0.95rem;
  }

  .grid-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* ✅ Center mobile controls perfectly */
  .mobile-controls {
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
  }

  .clear-filter-mobile {
    display: inline-flex;
  }
}




/* SHARE BUTTON */

.share-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ffffffd8;
  border: none;
  padding: 6px 7px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--green-dark);
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  transition: transform 0.25s, background 0.25s;
}

.share-btn:hover {
  background: var(--green-dark);
  color: #fff;
  transform: scale(1.1);
}

@media (max-width: 600px) {
  .share-btn {
    top: 8px;
    right: 8px;
    padding: 5px 6px;
    font-size: 13px;
  }
}


/* ===========================================================
   LOAD MORE BUTTON — Clean Health Formula (v3.0)
   =========================================================== */

.load-more-container {
  text-align: center;
  margin: 40px 0 60px;
}

#loadMoreBtn {
  background: var(--green-dark);
  color: #fff;
  font-weight: 700;
  padding: 14px 26px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0, 128, 0, 0.12);
  transition: all 0.28s ease-in-out;
}

/* Hover */
#loadMoreBtn:hover {
  background: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 140, 0, 0.25);
}

/* Active / Loading State */
#loadMoreBtn:active {
  transform: scale(0.96);
}

/* Disabled (no more products) */
#loadMoreBtn:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
}

/* Mobile Optimization */
@media (max-width: 600px) {
  #loadMoreBtn {
    width: 92%;
    padding: 14px 0;
    font-size: 0.95rem;
    border-radius: 10px;
  }
}
