/* ============================================
   Products Page Styles — Aligned with index.html
   ============================================ */

/* Hero Banner — premium sub-page hero */
.products-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 110px 0 64px;
}

.products-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.products-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.08);
  transition: transform 10s ease-out;
}

.products-hero.loaded .products-hero-img {
  transform: scale(1);
}

.products-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(5,14,31,0.3) 0%, rgba(5,14,31,0.75) 100%),
    linear-gradient(180deg, rgba(5,14,31,0.5) 0%, rgba(5,14,31,0.25) 40%, rgba(5,14,31,0.6) 75%, rgba(5,14,31,0.95) 100%);
}

.products-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 720px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Glass-morphism eyebrow pill */
.products-hero-content .sub-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 7px 18px 7px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  animation: subHeroFadeUp 800ms cubic-bezier(0.16,1,0.3,1) 200ms forwards;
}

.sub-hero-eyebrow .sub-hero-badge {
  display: inline-flex;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary, #0f66e8), #0a4db8);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sub-hero-eyebrow span:last-child {
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  font-weight: 500;
}

.products-hero-content h1 {
  font-family: "Sora", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 18px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-shadow: 0 4px 48px rgba(0,0,0,0.35);
  opacity: 0;
  animation: subHeroFadeUp 900ms cubic-bezier(0.16,1,0.3,1) 400ms forwards;
}

/* Gradient accent line */
.sub-hero-accent {
  width: 60px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent, #ffb547), var(--primary, #0f66e8));
  margin-bottom: 20px;
  opacity: 0;
  animation: subHeroFadeUp 700ms cubic-bezier(0.16,1,0.3,1) 600ms forwards;
}

.products-hero-content p {
  color: rgba(255,255,255,0.7);
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0;
  max-width: 540px;
  opacity: 0;
  animation: subHeroFadeUp 800ms cubic-bezier(0.16,1,0.3,1) 700ms forwards;
}

/* Shared sub-hero animation */
@keyframes subHeroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Filter Bar */
.products-filter-bar.section {
  padding: 14px 0;
  position: sticky;
  top: 68px;
  z-index: 30;
  margin-bottom: 0;
  background: rgba(246, 247, 251, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line, rgba(15, 37, 87, 0.1));
}

.filter-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm, 14px);
  border: 1px solid var(--line, rgba(15, 37, 87, 0.1));
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft, #5f6d89);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 250ms ease;
}

.filter-tab:hover {
  color: var(--primary, #0f66e8);
  background: rgba(15, 102, 232, 0.06);
}

.filter-tab.active {
  background: var(--primary, #0f66e8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 102, 232, 0.25);
}

.filter-count {
  font-size: 0.88rem;
  color: var(--text-soft, #5f6d89);
  font-weight: 500;
  white-space: nowrap;
}

.filter-count span {
  font-weight: 800;
  color: var(--primary, #0f66e8);
}

/* Products Grid Section */
.products-grid-section {
  padding-bottom: 80px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Product Card */
.product-card {
  background: var(--surface, #fff);
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--line, rgba(15, 37, 87, 0.1));
  box-shadow: var(--shadow-soft, 0 14px 40px rgba(15, 45, 99, 0.06));
  overflow: hidden;
  transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow, 0 24px 80px rgba(15, 45, 99, 0.08));
  border-color: rgba(15, 102, 232, 0.15);
}

.product-card.hidden {
  display: none;
}

.product-card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #ffffff;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.product-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 14px;
  border-radius: 10px;
  background: var(--primary, #0f66e8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 2;
}

.product-card-badge.badge-new {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.product-card-badge.badge-hot {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.product-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card-cat {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary, #0f66e8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-card-body h3 {
  font-family: "Sora", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text, #102550);
  letter-spacing: -0.01em;
  margin: 0;
}

.product-card-name {
  color: var(--text-soft, #5f6d89);
  font-size: 0.92rem;
  margin: 0 0 4px;
}

.product-card-specs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.product-card-specs span {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(15, 102, 232, 0.06);
  color: var(--primary-deep, #0a4db5);
  font-size: 0.78rem;
  font-weight: 600;
}

.product-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.product-card-actions .button {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  font-size: 0.85rem;
  border-radius: 12px;
}

.product-detail-btn {
  cursor: pointer;
}

/* Product Detail Modal */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 37, 87, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 300ms ease;
  padding: 24px;
}

.product-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.product-modal {
  background: var(--surface, #fff);
  border-radius: var(--radius-xl, 32px);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow, 0 24px 80px rgba(15, 45, 99, 0.08));
  transform: translateY(20px) scale(0.97);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.product-modal-overlay.active .product-modal {
  transform: translateY(0) scale(1);
}

.product-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 37, 87, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 200ms ease;
}

.product-modal-close:hover {
  background: rgba(15, 37, 87, 0.12);
  transform: rotate(90deg);
}

.product-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: var(--text, #102550);
  stroke-width: 2;
  fill: none;
}

.product-modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.product-modal-img {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-xl, 32px) 0 0 var(--radius-xl, 32px);
  background: #ffffff;
}

.product-modal-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-modal-info {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-modal-cat {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary, #0f66e8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-modal-info h2 {
  font-family: "Sora", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text, #102550);
  letter-spacing: -0.02em;
  margin: 0;
}

.product-modal-info .product-modal-desc {
  color: var(--text-soft, #5f6d89);
  line-height: 1.7;
  font-size: 0.95rem;
}

.product-modal-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 8px 0;
}

.product-modal-spec {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(15, 102, 232, 0.04);
  border: 1px solid rgba(15, 102, 232, 0.06);
}

.product-modal-spec strong {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-deep, #0a4db5);
}

.product-modal-spec span {
  font-size: 0.78rem;
  color: var(--text-soft, #5f6d89);
  font-weight: 500;
}

.product-modal-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-modal-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text, #102550);
}

.product-modal-feature svg {
  width: 18px;
  height: 18px;
  fill: #16a34a;
  flex-shrink: 0;
}

.product-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.product-modal-actions .button {
  flex: 1;
}

/* CTA Section — full-width dark like homepage */
.products-cta-section {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 80px 0;
  background: linear-gradient(135deg, #050e1f 0%, #0a2540 50%, #0f3460 100%);
  overflow: hidden;
}

.products-cta-content {
  position: relative;
  z-index: 2;
  width: var(--page-width);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
}

.products-cta-content h2 {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}

.products-cta-content p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  margin: 0 0 32px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.products-cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.products-cta-actions .button-primary {
  box-shadow: 0 14px 28px rgba(15, 102, 232, 0.3), 0 0 40px rgba(117, 182, 255, 0.15);
}

.products-cta-actions .button-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ====== Responsive ====== */

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

  .products-hero-content h1 {
    font-size: 2rem;
  }
}

@media (max-width: 900px) {
  .products-filter-bar.section {
    top: 56px;
  }
}

@media (max-width: 768px) {
  .products-hero {
    min-height: 36vh;
    padding: 80px 0 50px;
  }

  .products-hero-content {
    padding: 0 20px;
  }

  .products-hero-content h1 {
    font-size: 1.7rem;
  }

  .products-hero-content p {
    font-size: 0.92rem;
  }

  /* Filter bar: sticky + padding */
  .products-filter-bar.section {
    top: 56px;
    padding: 10px 0;
  }

  /* Stack tabs above count */
  .filter-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Tabs: wrap into 2 rows */
  .filter-tabs {
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
  }

  .filter-tab {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 8px;
  }

  .filter-count {
    font-size: 0.8rem;
    padding-left: 4px;
  }

  /* Modal */
  .product-modal-layout {
    grid-template-columns: 1fr;
  }

  .product-modal-img {
    border-radius: var(--radius-xl, 32px) var(--radius-xl, 32px) 0 0;
    aspect-ratio: 16/9;
  }

  .product-modal-info {
    padding: 24px 20px;
  }

  .product-modal-info h2 {
    font-size: 1.4rem;
  }

  /* CTA */
  .products-cta-section {
    padding: 60px 0;
  }

  .products-cta-content h2 {
    font-size: 1.4rem;
  }

  .products-cta-content p {
    font-size: 0.92rem;
  }
}

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

  .products-hero {
    min-height: 30vh;
    padding: 70px 0 40px;
  }

  .products-hero-content h1 {
    font-size: 1.5rem;
  }

  .products-hero-content .sub-hero-eyebrow {
    font-size: 0.78rem;
    padding: 5px 14px 5px 5px;
    gap: 8px;
    margin-bottom: 18px;
  }

  .sub-hero-accent {
    width: 40px;
    margin-bottom: 14px;
  }

  /* Even more compact tabs */
  .filter-tabs {
    gap: 3px;
    padding: 3px;
  }

  .filter-tab {
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  .product-card-body {
    padding: 16px;
  }

  .product-card-body h3 {
    font-size: 1.15rem;
  }

  .product-card-specs span {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .product-card-actions {
    flex-direction: column;
  }

  .product-modal-specs {
    grid-template-columns: 1fr;
  }

  .product-modal-actions {
    flex-direction: column;
  }

  .products-cta-actions {
    flex-direction: column;
    align-items: center;
  }

  .products-cta-content h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .products-hero {
    min-height: 26vh;
    padding: 64px 0 32px;
  }

  .products-hero-content h1 {
    font-size: 1.3rem;
  }

  .filter-tab {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
}
