/* ===== Products Grid (responsive 1 / 2 / 3) ===== */
.products-grid {
  display: grid !important;
  grid-template-columns: 1fr !important; /* mobile: 1 */
  gap: 30px;
  margin: 40px 0;
}

/* Tablet */
@media (min-width: 601px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Desktop */
@media (min-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Product card */
.product-item {
  text-align: center;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.product-thumb {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 15px;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-title {
  font-size: 18px;
  font-weight: 600;
  margin: 10px 0;
  color: #333;
}
.view-more {
  padding: 8px 18px;
  border: 2px solid #333;
  background: transparent;
  color: #333;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.view-more:hover {
  background: #333;
  color: #fff;
}

/* ===== Modal (global) ===== */
#product-modal {
  position: fixed;
  inset: 0;
  display: none;               /* JS toggles display:flex */
  align-items: center;         /* vertical center */
  justify-content: center;     /* horizontal center */
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* when JS adds "open" class we show the fade */
#product-modal.open {
  opacity: 1;
}

/* inner box centered and responsive */
.product-modal-inner {
  position: relative;
  max-width: 900px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* image */
#product-modal img {
  display: block;
  margin: 0 auto;
  max-width: 90%;
  max-height: 70vh;
  border-radius: 12px;
}

/* description */
#product-modal p {
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  margin: 0 auto;
  max-width: 800px;
}

/* close button (styled as round icon) */
#close-modal {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 26px;
  color: #fff;
  cursor: pointer;
  background: rgba(0,0,0,0.4);
  border: none;
  width: 40px;
  height: 40px;
  line-height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* responsive tweaks */
@media (max-width: 600px) {
  .product-thumb { height: 180px; }
  #product-modal p { font-size: 14px; padding: 0 10px; }
  #close-modal { top: 6px; right: 6px; width: 36px; height: 36px; font-size: 22px; }
}
