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

/* ── Reset scope: the two sections we own ── */


.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: 0vw;
}

.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: 980px;
  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; }

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

.detail-image-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 40px;
  background: #f9faf8;
  border-right: 1px solid #e0e0e0;
}
.detail-image-col img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  display: block;
}

.detail-info-col {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.detail-name {
  font-size: 1.9rem;
  font-weight: 700;
  color: #2eac1e;
  line-height: 1.2;
  margin: 0;
}

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

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

.detail-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  margin-bottom: 6px;
}

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

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@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;}
}
@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.45rem; }
  .filter-section { margin-top: 22vw;}
}
