/* ============================================================
   JL Engineering — Products Catalog Page Styles
   Imports styles.css for shared tokens; adds catalog-specific rules.
============================================================ */

/* ---------- Active nav link (current page) ---------- */
.nav-active {
  color: var(--amber) !important;
}

/* ---------- Products Hero ---------- */
.products-hero {
  background: var(--navy);
  padding: 8rem 1.5rem 5rem;
  position: relative;
  overflow: hidden;
}

.products-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(251,251,250,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(251,251,250,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.products-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.products-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 900;
  color: var(--paper);
  line-height: 1.1;
  margin-bottom: 1.25rem;
  margin-top: 0.5rem;
}

.products-hero h1 em {
  font-style: normal;
  color: var(--amber);
}

.products-hero > .products-hero-inner > p {
  font-size: 1.0625rem;
  color: rgba(251,251,250,.7);
  max-width: 520px;
}

/* ---------- Catalog Section ---------- */
.catalog-section {
  padding: 5rem 0 6rem;
  background: var(--paper);
}

.catalog-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Filter Bar ---------- */
.catalog-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--steel-light);
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--steel);
  background: none;
  border: 1.5px solid var(--steel-light);
  border-radius: 100px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.filter-btn:hover {
  color: var(--navy);
  border-color: var(--navy);
}

.filter-btn.active {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

/* ---------- Catalog Grid ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ---------- Catalog Card ---------- */
.catalog-card {
  background: var(--white);
  border: 1px solid var(--steel-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.catalog-card:hover {
  border-color: var(--amber);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Square image placeholder */
.catalog-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #eef1f4;
  background-image:
    linear-gradient(rgba(26,54,80,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,54,80,.05) 1px, transparent 1px);
  background-size: 20px 20px;
  flex-shrink: 0;
  position: relative;
}

/* Subtle placeholder icon */
.catalog-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' fill='none'%3E%3Crect x='8' y='8' width='32' height='32' rx='4' stroke='%231A3650' stroke-width='1.5' stroke-opacity='0.15' fill='none'/%3E%3Cpath d='M16 24h16M24 16v16' stroke='%231A3650' stroke-width='1.5' stroke-opacity='0.15' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 48px 48px;
}

.catalog-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.catalog-card-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 1.5rem;
}

.catalog-card-desc {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.6;
  flex: 1;
}

/* Name + Add to Cart row — name left, button right */
.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--steel-light);
}

.catalog-card-name {
  font-family: var(--font-head);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  flex: 1;
  min-width: 0; /* allow text truncation if needed */
}

/* Small button variant */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Disabled / coming-soon state for Add to Cart */
.btn-sm:disabled,
.btn-sm[data-status="coming-soon"],
.btn-sm[data-status="sold-out"] {
  background: var(--steel-light);
  border-color: var(--steel-light);
  color: var(--steel);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- Cart Toast ---------- */
.cart-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1.5rem);
  background: var(--navy);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
  z-index: 300;
  white-space: nowrap;
}

.cart-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .products-hero {
    padding: 7rem 1.5rem 4rem;
  }

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

  .catalog-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .btn-sm {
    width: 100%;
    justify-content: center;
  }
}
