/* ============================================================
   products.css  — scoped styles for product listing & detail
   Import AFTER your main style.css so these win any conflicts
   ============================================================ */

.filter-section,
.filter-section *,
.products-section,
.products-section *,
.detail-wrapper,
.detail-wrapper * {
  box-sizing: border-box;
}

/* ── FILTER BAR ── */
.filter-section {
  position: static !important;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 36px 24px 28px;
  background: #ffffff;
  width: 100%;
  overflow: visible !important;
  margin-top: 0;
}

.filter-btn {
  position: static !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  padding: 10px 28px;
  border-radius: 10px;
  border: 2px solid #d6d8d4;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: #222;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  white-space: nowrap;
}
.filter-btn:hover  { border-color: #2eac1e; color: #2eac1e; }
.filter-btn.active { background: #2eac1e !important; border-color: #2eac1e !important; color: #fff !important; }

/* ── PRODUCTS SECTION ── */
.products-section {
  position: static !important;
  float: none !important;
  display: block !important;
  width: 100% !important;
  overflow: visible !important;
  padding: 40px 40px 70px;
  background: #ffffff;
}

/* ── PRODUCT GRID ── */
.product-grid {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100% !important;
  max-width: 1280px;
  margin: 0 auto;
  overflow: visible !important;
}

/* ── LOADING / EMPTY STATES ── */
.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 0.95rem;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #2eac1e;
  border-radius: 50%;
  animation: prod-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes prod-spin { to { transform: rotate(360deg); } }

/* ── PRODUCT CARD ── */
.product-card {
  position: static !important;
  float: none !important;
  display: flex !important;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: prod-fadeup 0.35s ease both;
  width: 100% !important; height: auto !important;
  top: auto !important; left: auto !important;
  right: auto !important; bottom: auto !important;
  transform: none;
}
.product-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 30px rgba(46,172,30,0.14);
}
@keyframes prod-fadeup {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-image-wrap {
  position: static !important;
  display: flex !important;
  align-items: center; justify-content: center;
  height: 220px; padding: 20px;
  background: #ffffff;
  border-bottom: 1px solid #ebebeb;
  overflow: hidden;
}
.card-image-wrap img {
  max-height: 190px; max-width: 100%;
  object-fit: contain; display: block;
  transition: transform 0.3s ease;
}
.product-card:hover .card-image-wrap img { transform: scale(1.05); }

.card-body {
  position: static !important;
  padding: 18px 20px 0;
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  text-align: center;
}
.card-name { font-size: 1.05rem; font-weight: 700; color: #2eac1e; line-height: 1.3; margin: 0; }
.card-desc { font-size: 0.82rem; color: #666; line-height: 1.55; flex: 1; margin: 0; }

.card-footer { padding: 16px 20px 20px; }
.btn-view {
  display: block !important; position: static !important;
  width: 100% !important; padding: 12px 16px;
  background: #2eac1e; color: #fff !important;
  border: none; border-radius: 8px;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; text-align: center; text-decoration: none !important;
  transition: background 0.18s ease; letter-spacing: 0.3px;
}
.btn-view:hover { background: #239116 !important; color: #fff !important; text-decoration: none !important; }

/* ══════════════════════════════════════════════
   DETAIL PAGE
   ══════════════════════════════════════════════ */
.detail-wrapper {
  position: static !important;
  max-width: 1020px;
  margin: 115px auto;
  padding: 0 24px 80px;
  overflow: visible !important;
}

.back-btn {
  display: inline-flex !important;
  align-items: center; gap: 6px;
  color: #2eac1e; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; margin-bottom: 30px;
  cursor: pointer; background: none; border: none;
  font-family: inherit; padding: 0;
  transition: gap 0.2s;
}
.back-btn:hover { gap: 10px; }

/* Card shell */
.detail-card {
  display: grid;
  grid-template-columns: 420px 1fr;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  overflow: hidden;
}

/* Left — image */
.detail-image-col {
  display: flex; align-items: center; justify-content: center;
  padding: 50px 40px;
  border-right: 1px solid #e0e0e0;
  position: sticky; top: 100px; align-self: start;
}
.detail-image-col img {
  max-width: 100%; max-height: 380px;
  object-fit: contain; display: block;
}

/* Right — info column */
.detail-info-col {
  padding: 44px 48px;
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto;
}

.detail-category {
  font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: #2eac1e; background: #e8f5e6;
  display: inline-block; padding: 5px 14px;
  border-radius: 20px; width: fit-content;
}

.detail-name {
  font-size: 2rem; font-weight: 800;
  color: #1a1a1a; line-height: 1.2; margin: 0;
}

.detail-short {
  font-size: 0.97rem; color: #777;
  font-style: italic; margin: 0;
}

.detail-divider {
  border: none; border-top: 1px solid #ebebeb; margin: 4px 0;
}

/* ── Generic field block ── */
.detail-field { display: flex; flex-direction: column; gap: 10px; }

.detail-label {
  font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: #999; display: flex; align-items: center; gap: 6px;
}

.detail-full {
  font-size: 0.93rem; color: #333; line-height: 1.8; margin: 0;
}

/* ── Advantages list ── */
.detail-advantages {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.detail-advantages li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.92rem; color: #333; line-height: 1.5;
}
.detail-advantages li::before {
  content: "✓";
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: #e8f5e6; color: #2eac1e;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
  margin-top: 1px;
}

/* ── Dosage ── */
.dosage-grid {
  display: flex; flex-wrap: wrap; gap: 14px;
}
.dosage-block {
  flex: 1 1 200px;
  background: #f8fdf8;
  border: 1px solid #d8efd6;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.dosage-block p { font-size: 0.88rem; color: #444; margin: 0; line-height: 1.6; }

.dosage-tag {
  display: inline-block;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 3px 10px; border-radius: 20px;
  width: fit-content;
}
.dosage-tag.liquid  { background: #dff0ff; color: #1a6ba8; }
.dosage-tag.powder  { background: #fff3e0; color: #b36000; }

/* ── Packing ── */
.packing-tags {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.packing-tag {
  display: inline-block;
  background: #f0f9ee; color: #2a8020;
  border: 1.5px solid #c5e8c1;
  border-radius: 8px;
  font-size: 0.88rem; font-weight: 600;
  padding: 7px 16px;
}

/* ── WhatsApp CTA ── */
.detail-cta { margin-top: 8px; }
.btn-whatsapp {
  display: inline-flex;
  align-items: center; gap: 10px;
  background: #25d366; color: #fff;
  padding: 14px 28px; border-radius: 12px;
  font-size: 0.95rem; font-weight: 700;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 4px 14px rgba(37,211,102,0.35);
}
.btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-2px);
  color: #fff !important;
}
.btn-whatsapp i { font-size: 1.2rem; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .detail-card  { grid-template-columns: 1fr 1fr; }
  .detail-image-col { position: static; }
}
@media (max-width: 780px) {
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .products-section { padding: 24px 16px 50px; }
  .detail-card { grid-template-columns: 1fr; }
  .detail-image-col { border-right: none; border-bottom: 1px solid #e0e0e0; }
  .detail-info-col  { padding: 30px 24px; }
  .filter-section   { margin-top: 22vw; }
  .detail-wrapper   { margin-top: 90px; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr !important; }
  .filter-btn { padding: 9px 18px; font-size: 0.88rem; }
  .detail-name { font-size: 1.5rem; }
  .detail-info-col { padding: 24px 18px; }
  .filter-section { margin-top: 22vw; }
  .dosage-grid { flex-direction: column; }
}