
:root {
  /* Colors inspired by namathij.com */
  --namathij-green: #54ac54;
  --namathij-dark-text: #333333;
  --namathij-light-text: #ffffff;
  --namathij-card-bg: #ffffff;
  --namathij-border-color: #e0e0e0;
  --namathij-overlay-bg: rgba(0,122,139,0.85);
  --namathij-rating-color: #ffb900;

  --grid-gap: 20px;
  --card-radius: 12px;
  --card-shadow: 0 4px 12px rgba(0,0,0,0.08);
  --card-hover-shadow: 0 8px 20px rgba(0,0,0,0.12);

  --font-family-primary: 'Cairo',sans-serif;
}

/* Grid layout */
/*#custom-products-grid-namathij {
  display: grid;
  grid-template-columns: repeat(1,1fr);
  gap: var(--grid-gap);
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 15px;
  font-family: var(--font-family-primary);
}
@media (min-width: 768px) {
  #custom-products-grid-namathij {
    grid-template-columns: repeat(4,1fr);
  }
}*/

/* Modify your grid-template-columns at different breakpoints */
#custom-products-grid-namathij {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(1, 1fr); /* default: 1 column on small screens */
}

/* Tablet: 2 columns between 480px and 767px */
@media (min-width: 480px) and (max-width: 767px) {
  #custom-products-grid-namathij {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small desktop: 3 columns between 768px and 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  #custom-products-grid-namathij {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop: 4 columns at 1024px and above */
@media (min-width: 1024px) {
  #custom-products-grid-namathij {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* Loading spinner */
#custom-products-grid-namathij.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}
.loading-spinner {
  width: 50px; height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--namathij-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* "Load more" spinner */
.load-more-spinner {
  display: block;
  margin: 2rem auto;
  width: 40px; height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--namathij-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Product card */
.product-card-namathij {
  background: var(--namathij-card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative; cursor: pointer;
  transition: transform .35s, box-shadow .35s;
}
.product-card-namathij:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

/* Image area - FIXED to ensure no empty space */
.product-image-wrapper-namathij {
  position: relative;
  width: 100%;
  /* Use aspect-ratio for responsive 4:3, or set height:200px; */
  aspect-ratio: 1067/800;
  overflow: hidden;
  background: #f8f8f8;
}
.product-image-wrapper-namathij img {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;

  transition: transform 0.4s ease-in-out;
}
.product-card-namathij:hover .product-image-wrapper-namathij img {
  transform: scale(1.05);
}

/* Quick view button */
.quick-view-namathij {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(84,172,84,0.9); color: #fff;
  padding: 12px; text-align: center;
  transform: translateY(100%); opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  font-family: 'Cairo', var(--font-family-primary);
  font-weight: 500;
  z-index: 5;
}
#custom-products-grid-namathij .quick-view-namathij {
  font-family: 'Cairo', var(--font-family-primary) !important;
}
.product-card-namathij:hover .quick-view-namathij {
  transform: translateY(0); opacity: 1;
}

/* Sale badge */
.onsale-badge-namathij {
  position: absolute; top: 15px; right: 15px;
  background: var(--namathij-green);
  color: var(--namathij-light-text);
  padding: 6px 12px;
  font-size: .8rem; font-weight: 600;
  border-radius: 3px; z-index: 10;
  text-transform: uppercase;
}

/* Info section */
.product-info-namathij {
  padding: 18px; text-align: center;
  flex: 1; display: flex; flex-direction: column;
  border-top: 1px solid var(--namathij-border-color);
}
.product-info-namathij h3 {
  margin: 0;
  font-size: 1.1rem; font-weight: 600;
  color: var(--namathij-dark-text); line-height: 1.4;
  min-height: 2.8em;
}

/* Reserve space for dynamic content (breadcrumb + rating) */
.dynamic-content-placeholder {
  min-height: 2.2em;            /* roughly two lines of text */
  margin-bottom: 0.5em;         /* match spacing */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Placeholder styling for SSR */
.placeholder {
  background: rgba(0,0,0,0.05);
  color: transparent;
}

/* Breadcrumb (Parent / Child) */
.product-breadcrumb-namathij {
  font-family: 'Cairo', var(--font-family-primary);
  color: #999;
  font-size: .85rem;
  margin: 2px 0;
}



/* Review Summary Styles */
.review-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px;
  font-family: var(--font-family-primary);
  font-size: .9rem;
  color: var(--namathij-dark-text);
  gap: 8px;
}
.review-summary .count {
  opacity: .7;
  margin-left: 4px;
}
.review-summary .star {
  color: var(--namathij-rating-color);
}
.review-summary .avg {
  font-weight: 600;
}
.rating-count {
  color: #999;
  font-size: 0.85rem;
}
.rating-value {
  color: var(--namathij-rating-color);
  font-weight: 700;
}

/* Price */
.product-info-namathij .price {
  margin-top: auto;
  font-size: 1.1rem; font-weight: 700;
  color: var(--namathij-green);
}

/* Error message styling */
.products-error-message {
  grid-column: 1/-1;
  text-align: center;
  color: var(--namathij-dark-text);
  font-family: var(--font-family-primary);
  padding: 20px;
  background: rgba(255,0,0,0.05);
  border-radius: var(--card-radius);
}



