/* فقط استایل صفحه محصولات */

/* ---------------------- Product Grid ---------------------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  padding: 4rem 2rem;
  }

.product-card {
  background: #0f1c2e;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #1c2c42;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  /* category landing thumbnail cards: image band on top, natural height */
  display: flex;
  flex-direction: column;
  position: relative;   /* anchor for the full-card click overlay */
  cursor: pointer;      /* whole card is clickable, not just the CTA */
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
}

/* === Category-landing thumbnail: large white image band (~64% of card),
      full product visible, never cropped, centered both axes === */
.product-card img {
  width: 100%;
  flex: 1 1 auto;            /* grows to absorb extra height -> equal card heights */
  min-height: clamp(230px, 25vw, 310px);  /* larger image band (~30% bigger product) */
  max-height: 360px;
  height: auto;
  max-width: none;
  aspect-ratio: auto;
  object-fit: contain;       /* never crop; show the whole product */
  object-position: center;   /* centered horizontally + vertically */
  padding: clamp(6px, 0.7vw, 10px);  /* minimal padding so the product fills the band */
  box-sizing: border-box;
  background: #fff;
  border-radius: 0;          /* flush band; card overflow:hidden rounds top corners */
  margin: 0;
  display: block;
}

.product-card-content {
  padding: 1.25rem 1.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;               /* compact, uniform spacing - no large gaps */
  flex: 0 0 auto;            /* short lower section; CTA sits right under the text */
}

/* Make the whole card clickable (stretched link over the CTA's href) */
.product-card-content a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
/* CTA arrow (like the reference design) */
.product-card-content a::after {
  content: "→";
  font-weight: 700;
}

.product-card-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

.product-card-content p {
  font-size: 0.95rem;
  color: #d0d6e0;
}

.product-card-content a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  padding: 0.7rem 1.6rem;
  color: #0f1c2e;
  background: linear-gradient(135deg, #f9d976, #f39f19);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(243, 159, 25, 0.45);
  transition: all 0.3s ease;
}

.product-card-content a:hover {
  background: linear-gradient(135deg, #f1c63f, #e68a00);
  box-shadow: 0 6px 18px rgba(243, 159, 25, 0.6);
}

/* ---------------------- Lux Product Detail ---------------------- */
.product-detail {
 
  padding: 3rem 2rem;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.07);
  max-width: 900px;
  margin: 3rem auto;
  border-left: 6px solid #f9b233;
  border-right: 1px solid #fcd68e;
  border-top: 1px solid #fcd68e;
  border-bottom: 1px solid #fcd68e;
}

.product-detail h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #081b35;
  margin-bottom: 1rem;
  text-align: center;
}

.product-detail p,
.product-detail li {
  font-size: 1.05rem;
  color: #333;
  line-height: 1.8;
}

.product-detail ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
  list-style-type: square;
}

.product-detail a {
  color: #b30000;
  text-decoration: underline;
  transition: all 0.3s ease;
  font-weight: 500;
}

.product-detail a:hover {
  color: #800000;
}

/* ---------------------- Responsive ---------------------- */
@media (max-width: 768px) {
  .products-grid {
    padding: 2rem 1rem;
  }

  .product-card img {
    width: 100%;
    flex: 1 1 auto;
    min-height: clamp(220px, 58vw, 300px);
    max-height: 340px;
    height: auto;
    max-width: none;
    aspect-ratio: auto;
    object-fit: contain;
    padding: clamp(10px, 3vw, 18px);
    box-sizing: border-box;
    background: #fff;
    border-radius: 0;
    display: block;
    margin: 0;
  }

  .product-card-content {
    flex: 0 0 auto;
    height: auto;
  }

  .product-card-content h3 {
    font-size: 1.1rem;
    min-height: auto;
  }

  .product-card-content p {
    font-size: 0.9rem;
  }

  .product-detail {
    padding: 2rem 1rem;
  }

  .product-detail h2 {
    font-size: 1.5rem;
  }

  .product-detail p,
  .product-detail li {
    font-size: 1rem;
  }
}


/* مرکزچینِ محتوا در صفحات محصول */
main.container{ max-width:1120px; margin:0 auto; padding:0 16px; }

/* بردکرامب: لطیف و وسط */
.breadcrumbs{
  max-width:1120px; margin:12px auto 0; padding:0 12px;
  text-align:center; color:#6b7a90; font-size:.95rem;
}
.breadcrumbs a{ color:#6b7a90; text-decoration:none; }
.breadcrumbs a:hover{ text-decoration:underline; }

/* کارت‌های زیرشاخه دقیقاً وسط بمانند */
.subcategory-cards-row{ margin: 1.5rem auto; }
/* وقتی مودال بازه، اسکرول صفحه قفل بشه */
body.modal-open{
  overflow: hidden;
  height: 100vh;              /* جلوی تکان‌های ناگهانی موبایل */
}
@supports (overscroll-behavior: contain){
  body.modal-open{ overscroll-behavior: contain; }
}

/* استایل سکشن “Weiterführende Inhalte” که اسکریپت اضافه کرده */
.more-links{
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1rem 1rem 1.2rem;
  background: #ffffff;
  border: 1px solid #e6eef8;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(8,27,53,.06);
}
.more-links h2{
  margin: 0 0 .9rem;
  color: #0f1c2e;
  font-weight: 800;
  letter-spacing: .2px;
  text-align: center;
}
.more-links-grid{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 14px;
}
.more-link-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 9999px;
  background: #0f1c2e;
  color: #ffd666;
  border: 1px solid rgba(255,214,102,.4);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(8,27,53,.12), inset 0 -2px 0 rgba(255,255,255,.08);
  transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
}
.more-link-chip:hover{
  transform: translateY(-1px);
  background: #0c1830;
  border-color: rgba(255,214,102,.7);
}
@media (max-width:700px){
  .more-links{ padding: .9rem .8rem 1.1rem; border-radius: 16px; }
  .more-link-chip{ padding: 9px 12px; min-height: 38px; }
}

/* ===== H1 — Desktop one-line centered; Mobile wraps & centered ===== */
h1,
.product-main-title,
.page-title{
  margin: 1.8rem auto 1.2rem;
  text-align: center;
  font-weight: 800;
  color: #0f1c2e;
  line-height: 1.2;
  /* Desktop: exactly one line, no breaking */
  white-space: nowrap;
  text-wrap: nowrap;
  hyphens: none;
  overflow: hidden;          /* در صورت طولانی بودن، از باکس بیرون نزنه */
  text-overflow: ellipsis;   /* ... در انتها */
  max-width: 90vw;           /* حاشیه امن */
  font-size: clamp(1.5rem, 5vw, 2.6rem);
}
/* Mobile: allow wrap but keep centered & balanced */
@media (max-width: 768px){
  h1,
  .product-main-title,
  .page-title{
    white-space: normal;
    text-wrap: balance;
    hyphens: auto;
    overflow: visible;
    text-overflow: clip;
    max-width: 28ch;
  }
}

/* ===== Weiterführende Inhalte — unified, centered, responsive ===== */
/* ظرف اصلی: وسط و باکس تمیز */
.more-links{
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1rem 1rem 1.2rem;
  background: #ffffff;
  border: 1px solid #e6eef8;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(8,27,53,.06);
}
.more-links h2{
  margin: 0 0 .9rem;
  color: #0f1c2e;
  font-weight: 800;
  letter-spacing: .2px;
  text-align: center;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
}

/* حالت 1: ساختار UL/LI/A (بدون نیاز به کلاس اضافه) */
.more-links > ul{
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  justify-items: center;     /* آیتم‌ها دقیقاً وسط ستون‌ها */
}
.more-links > ul > li{ width: 100%; display: flex; justify-content: center; }
.more-links > ul > li > a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  text-decoration: none;
  border-radius: 9999px;
  background: #0f1c2e;
  color: #ffd666;
  border: 1px solid rgba(255,214,102,.4);
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 6px 20px rgba(8,27,53,.12), inset 0 -2px 0 rgba(255,255,255,.08);
  transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
  text-align: center;
}
.more-links > ul > li > a:hover{
  transform: translateY(-1px);
  background: #0c1830;
  border-color: rgba(255,214,102,.7);
}

/* حالت 2: اگر قبلاً markup سفارشی داشتی (.more-links-grid / .more-link-chip) */
.more-links-grid{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 14px;
}
.more-link-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 9999px;
  background: #0f1c2e;
  color: #ffd666;
  border: 1px solid rgba(255,214,102,.4);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(8,27,53,.12), inset 0 -2px 0 rgba(255,255,255,.08);
  transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
}
.more-link-chip:hover{
  transform: translateY(-1px);
  background: #0c1830;
  border-color: rgba(255,214,102,.7);
}

/* موبایل: spacing جمع‌وجور، همچنان وسط */
@media (max-width: 700px){
  .more-links{ padding: .9rem .8rem 1.1rem; border-radius: 16px; }
  .more-links > ul{ grid-template-columns: 1fr; gap: 12px; }
  .more-links > ul > li{ justify-content: center; }
  .more-links > ul > li > a,
  .more-link-chip{ padding: 9px 12px; min-height: 38px; }
}
/* === FIX: prevent H1 ellipsis on desktop; allow balanced wrap === */
@media (min-width: 992px){
  h1,
  .product-main-title,
  .page-title{
    white-space: normal;     /* اجازه‌ی شکستن */
    text-wrap: balance;      /* شکستِ متعادل خطوط */
    hyphens: auto;
    overflow: visible;       /* سه‌نقطه غیرفعال */
    text-overflow: clip;
    max-width: 30ch;         /* معمولاً ۱–۲ خط، وسطِ ظرف */
    margin-left: auto;
    margin-right: auto;
  }
}

/* برای نمایشگرهای خیلی بزرگ دوباره یک‌خطی کن (اگه جا شد) */
@media (min-width: 1600px){
  h1,
  .product-main-title,
  .page-title{
    max-width: 90vw;         /* فضای کافی، بدون محدودیت شدید */
  }
}

/* =========================================================
   Product index responsive layout (mobile-first)
   ========================================================= */

body:has(main .products-grid) {
  overflow-x: clip;
}

main.container:has(.products-grid) {
  padding-inline: var(--product-gutter);
  box-sizing: border-box;
}

.products-grid {
  grid-template-columns: 1fr;
  padding-block: 2rem;
  padding-inline: 0;
  gap: 2rem;
  box-sizing: border-box;
}

main.container:has(.products-grid) .product-card img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    padding-block: 3rem;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding-block: 4rem;
    padding-inline: 0;
  }
}
