/* ================= ROOT & RESET ================= */
/* ================= GLOBAL FONT ================= */

html, body,
button,
input,
textarea,
select,
a,
h1, h3, h4, h5, h6,
p, span, li, div {
  font-family: 'Jost', sans-serif;
}

h2 {
  font-family: 'Prosto One', sans-serif;
}

:root {
  --primary-green: #2e7d32;
  --dark-green: #1b5e20;
  --light-bg: #f4f7f4;
  --border: #ddd;
}

* {
  box-sizing: border-box;
}

body {
  
  background: var(--light-bg);
  margin: 0;
  padding: 10px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
}

em {
  font-style: normal;
}


/* ================= FILTER BAR ================= */
.filter-wrapper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap; /* Allow buttons to wrap to 2-3 lines */
  padding: 10px 5px 20px 5px;
  margin-bottom: 10px;
  justify-content: center; /* Center buttons on mobile */
}

.filter-wrapper::-webkit-scrollbar {
  display: none;
}

/* Category Buttons Styling */
.filter-btn {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border: 2px solid #4caf50;
  color: #1b5e20;
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}

/* Hover Effect */
.filter-btn:hover {
  background: #4caf50;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* Active Button */
.filter-btn.active {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* ================= MAIN LAYOUT ================= */
.product-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 45px;
}

/* ================= PRODUCT LIST ================= */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-item {
  background: white;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.25s ease;
}

.product-item:hover {
  border-color: var(--primary-green);
}

.product-item.active {
  background: #e8f5e9;
  border-color: var(--primary-green);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* ================= PRODUCT DETAILS ================= */
.product-details {
  background: white;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  order: 1; /* Move UP on mobile */
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  order: 2; /* Move DOWN on mobile */
}

/* Container */
.zoom-container {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fbf9;
}

/* Image */
.product-img {
  width: 100%;
  max-width: 320px;
  height: 320px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Lens (Amazon style) */
.zoom-lens {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 2px solid #ccc;
  background: rgba(255,255,255,0.3);
  display: none;
  pointer-events: none; /* Let cursor events pass to container */
}

/* Desktop hover zoom */
@media (hover: hover) {
  .zoom-container:hover .product-img {
    transform: scale(1.8);
  }

  .zoom-container:hover .zoom-lens {
    display: block;
  }
}

/* Mobile tap */
@media (hover: none) {
  .zoom-container:active .product-img {
    transform: scale(1.2);
  }
}
h2 {
  color: var(--primary-green);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.8rem;
}

h4 {
  font-size: 0.9rem;
  text-transform: none;
  margin-top: 15px;
  margin-bottom: 8px;
  color: var(--dark-green);
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

ul {
  padding-left: 18px;
  margin: 8px 0;
}

li {
  margin-bottom: 5px;
}

/* ================= DETAIL GRID ================= */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin-top: 10px;
}

/* ================= TABLET (≥768px) ================= */
@media (min-width: 768px) {
  body {
    padding: 0px;
  }

  .product-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .product-list {
    flex: 1;
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 8px;
  }

  .product-details {
    flex: 2;
    position: sticky;
    top: 20px;
    order: 2; /* Restore desktop order */
  }

  .product-list {
    flex: 1;
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 8px;
    order: 1; /* Restore desktop order */
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ================= LARGE DESKTOP (≥1200px) ================= */
@media (min-width: 1200px) {
  .product-details {
    padding: 30px 40px;
  }

  .product-img {
    max-width: 260px;
  }
}

/* ================= DESKTOP LAYOUT UPDATES ================= */
@media (min-width: 1025px) {
  .filter-container {
      max-width: 95% !important; /* Allow the container to be wider than 1200px to accommodate 2 lines */
      margin-top: 40px;
      margin-bottom: 30px;
  }

  .filter-wrapper {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    max-width: 1500px; 
    margin: 0 auto 20px auto;
    padding: 10px 5px;
    gap: 8px;
  }

  .filter-btn {
    padding: 6px 14px; /* Further reduced to ensure 2 rows */
    font-size: 0.9rem; /* Further reduced to ensure 2 rows */
  }
}
