/* ============================================
   PRODUCTS PAGE — products.css
   Підключати ПІСЛЯ style.css
============================================ */

/* ── Hero banner ───────────────────────── */
.prod-hero {
  position: relative;
  margin-top: 72px; /* header height */
}

.prod-hero__img-wrap {
  position: relative;
  width: 100%;
  height: clamp(280px, 40vw, 480px);
  overflow: hidden;
}

.prod-hero__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a6339 0%, #0d3320 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: rgba(255,255,255,.5);
  font-size: 1rem;
  border-bottom: 3px solid var(--green-600);
}
.prod-hero__placeholder small {
  font-size: .75rem;
  color: rgba(255,255,255,.3);
}

.prod-hero__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.prod-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.15) 0%,
    rgba(0,0,0,.55) 100%
  );
}

.prod-hero__text {
  background: var(--green-900);
  padding: 2.5rem 0 3rem;
  text-align: center;
}

.prod-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: .75rem;
}

.prod-hero__sub {
  font-size: clamp(.95rem, 1.5vw, 1.1rem);
  color: rgba(255,255,255,.8);
  line-height: 1.7;
  margin-bottom: .5rem;
}

.prod-hero__sub2 {
  font-size: 1rem;
  color: var(--green-200);
  font-weight: 600;
  margin-top: .75rem;
}

/* ── Product sections ─────────────────── */
.prod-section {
  padding: clamp(4rem, 7vw, 6.5rem) 0;
  background: var(--white);
}

.prod-section--alt {
  background: var(--gray-50);
}

.prod-section__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

/* Flip layout for alt sections */
.prod-section--alt .prod-section__inner {
  direction: rtl;
}
.prod-section--alt .prod-section__inner > * {
  direction: ltr;
}

/* Badge number */
.prod-section__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .05em;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.prod-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .9rem;
  line-height: 1.2;
}

.prod-section__desc {
  font-size: .96rem;
  color: var(--gray-600);
  line-height: 1.75;
  margin-bottom: 1.75rem;
  max-width: 480px;
}

/* Table */
.prod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.prod-table tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background .15s;
}
.prod-table tr:last-child { border-bottom: none; }
.prod-table tr:hover { background: var(--green-50); }

.prod-table__key {
  padding: .7rem .5rem .7rem 0;
  color: var(--gray-500);
  font-weight: 500;
  width: 52%;
  vertical-align: top;
  white-space: nowrap;
}

.prod-table__val {
  padding: .7rem 0;
  color: var(--gray-800);
  font-weight: 600;
}

/* Visual / image side */
.prod-section__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.prod-img-wrap {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  position: relative;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
  filter: drop-shadow(0 20px 50px rgba(34,128,74,.18));
}

/* Hover float effect */
.prod-img-wrap:hover {
  transform: translateY(-10px) scale(1.03);
}

.prod-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Subtle rotation tilt on hover */
.prod-section:nth-child(odd) .prod-img-wrap:hover  { transform: translateY(-10px) rotate(-2deg) scale(1.03); }
.prod-section:nth-child(even) .prod-img-wrap:hover { transform: translateY(-10px) rotate(2deg) scale(1.03); }

/* Placeholder for image */
.prod-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--gray-400);
  font-size: 2.5rem;
}
.prod-img-placeholder small {
  font-size: .72rem;
  color: var(--gray-400);
}

/* Decorative background circle behind product image */
.prod-section__visual::before {
  content: '';
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--green-50) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.prod-section__visual { position: relative; }
.prod-img-wrap { position: relative; z-index: 1; }

/* ── Factory Gallery ──────────────────── */
.gallery-section {
  padding: clamp(3.5rem, 6vw, 5rem) 0 0;
  background: var(--white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 0;
  margin-top: 2rem;
  height: clamp(240px, 35vw, 420px);
}

.gallery-item {
  overflow: hidden;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
  display: block;
}

.gallery-item:hover img { transform: scale(1.06); }

.gallery-placeholder {
  width: 100%;
  height: 100%;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--gray-400);
  font-size: 2rem;
  transition: background .3s;
}
.gallery-placeholder:hover { background: var(--gray-200); }
.gallery-placeholder small { font-size: .72rem; }

.gallery-item--large .gallery-placeholder {
  background: var(--gray-200);
}

/* ── Lightbox ───────────────────────── */
.prod-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.prod-lightbox.active { display: flex; }
.prod-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.8);
}
.prod-lightbox__inner {
  position: relative;
  width: min(95vw, 900px);
  max-height: 95vh;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.prod-lightbox__image {
  width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}
.prod-lightbox__caption {
  margin-top: .65rem;
  color: #fff;
  font-size: .95rem;
  text-align: center;
  opacity: .95;
}
.prod-lightbox__close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.65);
  color: white;
  font-size: 1.35rem;
  cursor: pointer;
}

/* ── Responsive ───────────────────────── */
@media (max-width: 900px) {
  .prod-section__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Remove RTL flip on mobile */
  .prod-section--alt .prod-section__inner {
    direction: ltr;
  }

  /* Image goes on top on mobile */
  .prod-section__visual {
    order: -1;
  }

  .prod-img-wrap {
    max-width: 280px;
    margin: 0 auto;
  }

  .prod-section__visual::before {
    width: 260px;
    height: 260px;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    height: auto;
  }
  .gallery-item--large {
    grid-column: 1 / -1;
    height: clamp(180px, 40vw, 300px);
  }
  .gallery-item:not(.gallery-item--large) {
    height: clamp(140px, 25vw, 220px);
  }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item--large { grid-column: auto; height: clamp(180px, 55vw, 280px); }
  .gallery-item:not(.gallery-item--large) { height: clamp(150px, 45vw, 240px); }

  .prod-table__key { white-space: normal; font-size: .82rem; }

  .prod-hero__sub br { display: none; }
}

/* ── Utility ──────────────────────────── */
.hide-mobile { display: inline; }
@media (max-width: 600px) {
  .hide-mobile { display: none; }
}
