

/* Root spacing */
:root {
  --grid-max-width: 1200px;
  --card-radius: 12px;
  --card-shadow: 0 10px 28px rgba(3,10,24,0.06);
  --accent: #ff6a00;
}

/* Layout container - responsive grid */
.product-list-wrapper {
  max-width: var(--grid-max-width);
  margin: 30px auto;
  padding: 18px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
  align-items: start;
}

/* Each existing .product-row becomes a card inside the grid */
.product-list-wrapper > .product-row {
  display: flex;
  flex-direction: column; /* image on top, text below */
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform .28s ease, box-shadow .28s ease;
  margin: 0;    /* grid gap handles spacing */
  padding: 0;
  min-height: 0;
  height: 100%; /* stretch to match grid row height */
}

/* Hover lift */
.product-list-wrapper > .product-row:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px rgba(3,10,24,0.12);
}

/* IMAGE AREA: fixed visual height so cards align */
.product-list-wrapper .product-img-box {
  width: 100%;
  height: 220px;     /* consistent image height - change if needed */
  position: relative; /* required for overlay absolute placement */
  overflow: hidden;
  background: #f5f5f5;
  flex: 0 0 auto;
}

/* product-slider wrapper inside image area */
.product-list-wrapper .product-img-box .product-slider {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Keep slider images absolutely positioned (works with your JS),
   ensure active image is visible and covers the box */
.product-list-wrapper .product-img-box img.p-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: scale(1.03);
  display: block;
  pointer-events: none;
  z-index: 1;
}

.product-list-wrapper .product-img-box img.p-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

/* ===========================
   Overlay: LEFT -> RIGHT slide
   =========================== */
.product-list-wrapper .product-hover {
  position: absolute;
  inset: 0;                         /* cover full image area */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;

  background: rgba(0,0,0,0.48);    /* semi-transparent overlay color */
  opacity: 0;
  transform: translateX(-100%);     /* start hidden to the left */
  transition: transform 0.45s cubic-bezier(.2,.9,.2,1), opacity 0.45s ease;
  pointer-events: none;
  z-index: 10;
}

/* show overlay on hover (desktop) and when .hover class is present (mobile tap) */
.product-list-wrapper > .product-row:hover .product-hover,
.product-list-wrapper > .product-row.hover .product-hover {
  opacity: 1;
  transform: translateX(0);         /* slide fully into view */
  pointer-events: auto;
}

/* icon styling (overlay buttons) */
.product-hover .p-icon {
  background: rgba(255,255,255,0.95);
  padding: 12px;
  border-radius: 50%;
  font-size: 18px;
  color: #222;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 22px rgba(3,10,24,0.08);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s;
}
.product-hover .p-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(3,10,24,0.12);
}

/* make overlay icons link-friendly */
.product-hover .p-icon a { color: inherit; text-decoration: none; display:inline-flex; align-items:center; }

/* Touch friendly: enlarge tap targets slightly */
@media (max-width: 768px) {
  .product-hover .p-icon { padding: 14px; font-size: 20px; }
  .product-list-wrapper .product-img-box { height: 200px; }
}

/* ===========================
   TEXT area under image
   =========================== */
.product-list-wrapper .product-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto; /* makes content area stretch so card heights match */
}

.product-list-wrapper .product-info h3 {
  font-size: 20px;
  margin: 0;
  color: #111;
  line-height: 1.18;
  font-weight: 700;
}

.product-list-wrapper .product-info h3 a {
  color: inherit;
  text-decoration: none;
}

.product-list-wrapper .product-info h3 a:hover {
  color: var(--accent);
}

.product-list-wrapper .product-info p {
  color: #555;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  /* truncate to keep uniform card heights if content long */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ensure modal overlays everything */
#imgModal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.7) !important;
  z-index: 2147483647 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* centered inner box - SINGLE DEFINITION ONLY */
#imgModal .modal-inner {
  width: 1000px;
  height: 640px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  position: relative;
}

#modalImage {
  width: 1000px;
  height: 640px;
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  background: transparent !important;
  display: block;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.modal-open .w3l-top-menu-1,
body.modal-open .w3l-header-4,
body.modal-open .about-inner,
body.modal-open .breadcrumbs-custom-path {
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#imgModalClose, .modal-nav {
  z-index: 2147483648 !important;
}

/* Close button stays visible above modal */
#imgModalClose {
  position: fixed;
  top: 18px;
  right: 18px;
  font-size: 34px;
  color: #fff;
  cursor: pointer;
  z-index: 2147483648;
  background: transparent;
  border: none;
  line-height: 1;
  padding: 5px;
}

/* Prev/Next controls - visible and outside the image */
.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: auto;
  right: auto;

  display: none !important;   /* default hidden */
  pointer-events: none;

  background: transparent !important;
  border: none;
  color: #fff;
  font-size: 32px;
  padding: 10px;
  z-index: 2147483648;
}


.modal-nav:hover {
  background: rgba(255,255,255,0.18);
}


#imgModal.show .modal-nav {
  display: inline-flex !important;
  pointer-events: auto;
}

/* explicit left/right positions */
#modalPrev { left: 24px; }
#modalNext { right: 24px; }

/* hide prev/next if only one image (visibility toggled in JS) */
.modal-nav.hidden { display: none !important; }

/* Click-outside hint: small text (optional) */
#imgModal .hint {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  z-index: 999999;
}

/* Responsive tweaks for modal */
@media (max-width: 1024px) {
  .modal-nav { font-size: 24px; padding: 10px 12px; }
  #imgModal .modal-inner { width: 800px; height: 520px; }
  #modalImage { width: 800px; height: 520px; }
}

@media (max-width: 640px) {
  .modal-nav { display: none; }
  #imgModalClose { top: 12px; right: 12px; font-size: 28px; }
  #imgModal .modal-inner { width: 95vw; height: 60vh; }
  #modalImage { width: 95vw; height: 60vh; }
}

/* End of file */