/* ============================================================
   Packagly — products.css  (split from style.css)
   Depends on: common.css (variables, reset, icon helpers)
   Responsive @media rules live in responsive.css
   ============================================================ */

/* ============================================================
   POPULAR PRODUCTS (light section + slider)
============================================================ */
.products-section {
  background: #ffffff;
  color: #14241b;
  padding: 55px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.section-overline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-overline::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--green);
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  color: #14241b;
}
.section-title .accent {
  color: var(--green);
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.slider-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #d8e0db;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.slider-btn .icon {
  width: 18px;
  height: 18px;
}
.slider-btn .icon.flip {
  transform: rotate(180deg);
}
.slider-btn:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--green);
}
.slider-btn:hover:not(:disabled) .icon {
  filter: brightness(0) invert(1);
}
.slider-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn-view-all {
  background: #0e2a1c;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}
.btn-view-all:hover {
  background: var(--green);
}
.btn-view-all .icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

/* ---- slider track ---- */
.products-slider {
  position: relative;
}
.products-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 8px;
  margin: -4px -4px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.products-track::-webkit-scrollbar {
  display: none;
}

/* ---- product card ---- */
.product-card {
  flex: 0 0 calc((100% - 72px) / 4); /* 4 per row (3 gaps × 24px) */
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #eef1ee;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}
.product-card:hover {
  border-color: #dfe7e1;
  box-shadow: 0 16px 34px rgba(20, 40, 30, 0.1);
  transform: translateY(-3px);
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f5f7f5;
}
.product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  z-index: 1;
}
.product-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  color: #b9c6bd;
}
.product-ph svg {
  width: 46px;
  height: 46px;
  opacity: 0.55;
}
.product-ph em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: #9aa89e;
}

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.product-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #16241c;
  margin: 0;
  min-height: 39px;
}
.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #8090869f;
}
.product-rating .stars {
  display: inline-flex;
  gap: 1px;
}
.product-rating .star {
  width: 15px;
  height: 15px;
}
.product-rating .rating-count {
  color: #8a988e;
  font-weight: 600;
}
.product-price {
  font-size: 14px;
  color: #2c3a32;
}
.product-price strong {
  font-weight: 800;
  color: #14241b;
}
.btn-details {
  margin-top: auto;
  background: #0e2a1c;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.btn-details:hover {
  background: var(--green);
}

/* ---- responsive: 4 -> 3 -> 2 per row ---- */
