/* ============================================================
   PRODUCTS CSS — Designcraft USA
   Product catalog, category, subcategory, and detail page styles
   ============================================================ */

/* ─── Breadcrumbs ─────────────────────────────────────────── */

.product-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.product-breadcrumbs li {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.product-breadcrumbs li:not(:last-child)::after {
  content: '›';
  margin-left: 0.4rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.product-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.product-breadcrumbs a:hover {
  color: var(--primary);
}

.product-breadcrumbs .current {
  color: var(--text);
  font-weight: 500;
}

/* ─── Products Landing Page ───────────────────────────────── */

.product-landing-hero {
  padding: calc(var(--header-height, 90px) + 3rem) 0 1.5rem;
  text-align: center;
}


.product-landing-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.product-landing-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.product-categories-section {
  padding: 1.5rem 0 4rem;
}

.product-categories-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.product-category-card {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
  text-decoration: none;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.product-category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.category-card-bg {
  position: absolute;
  inset: 0;
}

.category-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.product-category-card:hover .category-card-bg img {
  transform: scale(1.05);
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,15,15,0.85) 0%, rgba(15,15,15,0.5) 100%);
}

.category-card-content {
  position: relative;
  z-index: 2;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 280px;
  color: #fff;
}

.category-card-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.category-card-subs {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-bottom: 0.75rem;
}

.category-card-count {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.category-card-cta {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.product-category-card:hover .category-card-cta {
  transform: translateX(6px);
}

/* ─── Category Page (Subcategories Grid) ──────────────────── */

.category-hero,
.subcategory-hero {
  padding: calc(var(--header-height, 90px) + 3rem) 0 1.5rem;
}

.category-page-title,
.subcategory-page-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin: 0.75rem 0 0.5rem;
}

.category-page-subtitle,
.subcategory-page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

.subcategory-grid-section,
.product-grid-section {
  padding: 0 0 4rem;
}

.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.subcategory-card {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e5e5);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.subcategory-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.subcategory-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f5f5f5;
}

.subcategory-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.subcategory-card:hover .subcategory-card-image img {
  transform: scale(1.05);
}

.subcategory-card-info {
  padding: 1.25rem 1.5rem;
}

.subcategory-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.subcategory-card-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Product Grid (Subcategory Page) ─────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.product-card {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e5e5);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.product-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0ede8;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-info {
  padding: 1rem 1.25rem 1.25rem;
}

.product-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.product-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Product Detail Page ─────────────────────────────────── */

.product-detail-page {
  overflow-x: hidden;
}

.product-detail-hero {
  padding: calc(var(--header-height, 90px) + 1.5rem) 0 0.5rem;
}

.product-detail-main {
  padding: 1rem 0 3rem;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- Gallery --- */

.product-gallery {
  max-width: 100%;
  overflow: hidden;
}

.gallery-main {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f0ede8;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  max-width: 100%;
}

.gallery-slide {
  display: none;
  width: 100%;
  height: 100%;
}

.gallery-slide.active {
  display: block;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f0ede8;
  max-width: 100%;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 0.8rem;
  margin: 0;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #f0ede8;
  padding: 0;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.6;
}

.gallery-thumb.active {
  border-color: var(--primary);
  opacity: 1;
}

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Product Info Panel --- */

.product-info {
  padding-top: 0.5rem;
}

.product-name {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.product-subtitle {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.product-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body, var(--text));
  margin-bottom: 1.5rem;
}

.product-description p {
  margin-bottom: 1rem;
}

.product-description ul.options,
.product-description ul {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
}

.product-description li {
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.product-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, #e5e5e5);
}

.product-quote-btn {
  flex: 1;
  min-width: 180px;
  text-align: center;
}

.product-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

/* ─── Plans / Drawings Section ────────────────────────────── */

.product-plans-section {
  padding: 3rem 0;
  background: var(--section-alt-bg, #faf9f7);
  margin-top: 3rem;
}

.plans-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.plan-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e5e5);
  transition: box-shadow 0.3s ease;
}

.plan-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.plan-card-label {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--section-alt-bg, #f9f9f9);
  border-bottom: 1px solid var(--border, #e5e5e5);
}

.plan-card-image {
  padding: 1rem;
  background: #fff;
}

.plan-card-image img {
  width: 100%;
  height: auto;
  display: block;
}

.plan-download-btn {
  display: block;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border-top: 1px solid var(--border, #e5e5e5);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.plan-download-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ─── Related Products ────────────────────────────────────── */

.related-products-section {
  padding: 3rem 0 4rem;
}

.related-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.related-products-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.related-product-card {
  flex-shrink: 0;
  width: 180px;
  text-decoration: none;
  scroll-snap-align: start;
  transition: transform 0.3s ease;
}

.related-product-card:hover {
  transform: translateY(-3px);
}

.related-product-image {
  width: 180px;
  height: 135px;
  border-radius: 10px;
  overflow: hidden;
  background: #f0ede8;
  margin-bottom: 0.5rem;
}

.related-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-product-card:hover .related-product-image img {
  transform: scale(1.05);
}

.related-product-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  display: block;
}

/* ─── Lightbox Overlay ────────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  text-align: center;
  max-width: 80%;
}

/* ─── Mega Menu ───────────────────────────────────────────── */

.has-mega-menu .mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 680px;
  max-width: 900px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  z-index: 1000;
  animation: megaMenuIn 0.2s ease;
}

@keyframes megaMenuIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.has-mega-menu:hover .mega-menu,
.has-mega-menu .mega-menu:hover {
  display: block;
}

.mega-menu-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.mega-menu-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.mega-menu-heading a {
  color: var(--text);
  text-decoration: none;
}

.mega-menu-heading a:hover {
  color: var(--primary);
}

.mega-menu-sub {
  margin-bottom: 1rem;
}

.mega-menu-sub-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 0.4rem;
}

.mega-menu-sub-link:hover {
  color: var(--primary);
}

.mega-menu-products {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-menu-products li {
  margin-bottom: 0.2rem;
}

.mega-menu-products a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.15rem 0;
  display: block;
}

.mega-menu-products a:hover {
  color: var(--primary);
}

.mega-menu-more a {
  color: var(--primary);
  font-weight: 500;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .product-category-card {
    min-height: 220px;
  }

  .category-card-content {
    padding: 2rem;
    min-height: 220px;
  }

  .subcategory-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .product-card-info {
    padding: 0.75rem 1rem 1rem;
  }

  .plans-grid {
    grid-template-columns: 1fr 1fr;
  }

  .related-product-card {
    width: 150px;
  }

  .related-product-image {
    width: 150px;
    height: 112px;
  }

  .has-mega-menu .mega-menu {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .gallery-thumb {
    width: 52px;
    height: 39px;
  }
}

