/* =====================================================
   FSY-HOT Products Page
   Product listing + detail template
   ===================================================== */

[hidden] {
  display: none !important;
}


/* ============== Page Hero ============== */
.products-hero {
  position: relative;
  padding: calc(var(--space-xxl, 80px) + var(--space-xl, 48px)) 0 var(--space-xxl, 80px);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 180, 216, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(26, 115, 232, 0.22), transparent 55%),
    linear-gradient(135deg, #0f1a2e 0%, #1a1a2e 60%, #1a2a44 100%);
  color: var(--color-white, #ffffff);
  overflow: hidden;
  isolation: isolate;
}

.products-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}

.products-hero::after {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  right: -180px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.35), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
}

.products-hero .breadcrumb-item a,
.products-hero .breadcrumb-item {
  color: rgba(255, 255, 255, 0.65);
}

.products-hero .breadcrumb-item a:hover {
  color: var(--color-accent, #00b4d8);
}

.products-hero .breadcrumb-item.active {
  color: var(--color-accent, #00b4d8);
}

.products-hero-inner {
  max-width: 720px;
  position: relative;
}

.products-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: 6px 14px;
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent, #00b4d8);
  background-color: rgba(0, 180, 216, 0.12);
  border: 1px solid rgba(0, 180, 216, 0.35);
  border-radius: var(--border-radius-full, 9999px);
  margin-bottom: var(--space-lg, 24px);
}

.products-hero-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent, #00b4d8);
  box-shadow: 0 0 8px var(--color-accent, #00b4d8);
}

.products-hero h1 {
  font-size: clamp(2rem, 4vw, var(--font-size-5xl, 48px));
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md, 16px);
  color: var(--color-white, #ffffff);
}

.products-hero p {
  font-size: var(--font-size-lg, 18px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
}


/* ============== Filter Tabs ============== */
.products-filters {
  position: sticky;
  top: 70px;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border, #e0e0e0);
  padding: var(--space-md, 16px) 0;
  margin-bottom: var(--space-xl, 48px);
}

.filter-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-sm, 8px);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border, #e0e0e0) transparent;
  padding-bottom: 4px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.filter-tabs::-webkit-scrollbar {
  height: 4px;
}

.filter-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.filter-tabs::-webkit-scrollbar-thumb {
  background: var(--color-border, #e0e0e0);
  border-radius: var(--border-radius-full, 9999px);
}

.filter-tab {
  flex: 0 0 auto;
  padding: 8px 18px;
  font-size: var(--font-size-sm, 14px);
  font-weight: 600;
  color: var(--color-text, #333333);
  background-color: var(--color-bg-light, #f5f7fa);
  border: 1px solid transparent;
  border-radius: var(--border-radius-full, 9999px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s ease);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.filter-tab:hover {
  color: var(--color-primary, #1a73e8);
  border-color: var(--color-primary-light, #e8f0fe);
  background-color: var(--color-white, #ffffff);
}

.filter-tab.active {
  color: var(--color-white, #ffffff);
  background-color: var(--color-primary, #1a73e8);
  border-color: var(--color-primary, #1a73e8);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.28);
}

.filter-tab .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 6px;
  font-size: var(--font-size-xs, 12px);
  font-weight: 700;
  border-radius: var(--border-radius-full, 9999px);
  background-color: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.filter-tab:not(.active) .filter-count {
  background-color: var(--color-bg-section, #eef2f7);
  color: var(--color-text-muted, #666666);
}


/* ============== Product Grid ============== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg, 24px);
  align-items: stretch;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--color-white, #ffffff);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--border-radius-lg, 16px);
  overflow: hidden;
  transition: transform var(--transition-normal, 0.3s ease),
              box-shadow var(--transition-normal, 0.3s ease),
              border-color var(--transition-normal, 0.3s ease);
  text-decoration: none;
  color: inherit;
  height: 100%;
  opacity: 0;
  transform: translateY(20px);
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary-light, #e8f0fe);
  color: inherit;
}

.product-card .card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background-color: var(--color-bg-light, #f5f7fa);
}

.product-card .card-img-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow, 0.5s ease);
}

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

.product-card .product-category {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-white, #ffffff);
  background-color: rgba(26, 26, 46, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--border-radius-full, 9999px);
  z-index: 2;
}

.product-card .card-body {
  padding: var(--space-lg, 24px);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card .card-title {
  font-size: var(--font-size-lg, 18px);
  color: var(--color-dark, #1a1a2e);
  margin-bottom: var(--space-sm, 8px);
  font-weight: 700;
  line-height: 1.4;
  transition: color var(--transition-fast, 0.2s ease);
}

.product-card:hover .card-title {
  color: var(--color-primary, #1a73e8);
}

.product-card .card-text {
  font-size: var(--font-size-sm, 14px);
  color: var(--color-text-muted, #666666);
  line-height: 1.6;
  margin-bottom: var(--space-md, 16px);
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm, 14px);
  font-weight: 600;
  color: var(--color-primary, #1a73e8);
  margin-top: auto;
  transition: gap var(--transition-fast, 0.2s ease);
}

.product-card:hover .card-link {
  gap: 10px;
  color: var(--color-primary-dark, #1557b0);
}

.product-card .card-link::after {
  content: "→";
  font-size: var(--font-size-base, 16px);
  line-height: 1;
}


/* ============== Empty State ============== */
.products-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xxl, 80px) var(--space-md, 16px);
  background-color: var(--color-bg-light, #f5f7fa);
  border: 1px dashed var(--color-border, #e0e0e0);
  border-radius: var(--border-radius-lg, 16px);
  margin-top: var(--space-lg, 24px);
}

.products-empty .empty-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg, 24px);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light, #e8f0fe), var(--color-bg-section, #eef2f7));
  color: var(--color-primary, #1a73e8);
  font-size: 32px;
  font-weight: 700;
}

.products-empty .empty-title {
  font-size: var(--font-size-xl, 20px);
  font-weight: 700;
  color: var(--color-dark, #1a1a2e);
  margin-bottom: var(--space-sm, 8px);
}

.products-empty .empty-hint {
  font-size: var(--font-size-base, 16px);
  color: var(--color-text-muted, #666666);
  max-width: 420px;
}


/* ============== Detail Page ============== */
.product-detail-hero {
  position: relative;
  padding: calc(var(--space-xxl, 80px) + var(--space-xl, 48px)) 0 var(--space-xl, 48px);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 180, 216, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(26, 115, 232, 0.22), transparent 55%),
    linear-gradient(135deg, #0f1a2e 0%, #1a1a2e 60%, #1a2a44 100%);
  color: var(--color-white, #ffffff);
  overflow: hidden;
  isolation: isolate;
}

.product-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}

.product-detail-hero .breadcrumb-item a,
.product-detail-hero .breadcrumb-item {
  color: rgba(255, 255, 255, 0.65);
}

.product-detail-hero .breadcrumb-item a:hover {
  color: var(--color-accent, #00b4d8);
}

.product-detail-hero .breadcrumb-item.active {
  color: var(--color-accent, #00b4d8);
}


/* ============== Detail Layout ============== */
.product-detail {
  padding: var(--space-xxl, 80px) 0;
  background-color: var(--color-white, #ffffff);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--space-xl, 48px);
  align-items: start;
}

.product-gallery {
  position: sticky;
  top: 100px;
  background-color: var(--color-bg-light, #f5f7fa);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--border-radius-lg, 16px);
  overflow: hidden;
}

.product-gallery .gallery-main {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background-color: var(--color-bg-section, #eef2f7);
}

.product-gallery .gallery-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info .product-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: var(--font-size-xs, 12px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary, #1a73e8);
  background-color: var(--color-primary-light, #e8f0fe);
  border-radius: var(--border-radius-full, 9999px);
  margin-bottom: var(--space-md, 16px);
}

.product-info .product-name {
  font-size: clamp(1.75rem, 3vw, var(--font-size-3xl, 32px));
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-dark, #1a1a2e);
  margin-bottom: var(--space-md, 16px);
}

.product-info .product-summary {
  font-size: var(--font-size-lg, 18px);
  line-height: 1.7;
  color: var(--color-text, #333333);
  margin-bottom: var(--space-lg, 24px);
  padding-bottom: var(--space-lg, 24px);
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.product-detail-section {
  margin-top: var(--space-xl, 48px);
  padding-top: var(--space-xl, 48px);
  border-top: 1px solid var(--color-border, #e0e0e0);
}

.product-detail-section .section-heading {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  font-size: var(--font-size-xl, 20px);
  font-weight: 700;
  color: var(--color-dark, #1a1a2e);
  margin-bottom: var(--space-lg, 24px);
  padding-bottom: var(--space-sm, 8px);
  position: relative;
}

.product-detail-section .section-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  background-color: var(--color-primary, #1a73e8);
  border-radius: var(--border-radius-full, 9999px);
}

.product-detail-section .section-heading::before {
  content: "";
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--color-primary, #1a73e8), var(--color-accent, #00b4d8));
  border-radius: var(--border-radius-sm, 4px);
}

.product-description {
  font-size: var(--font-size-base, 16px);
  line-height: 1.8;
  color: var(--color-text, #333333);
}

.product-description p {
  margin-bottom: var(--space-md, 16px);
}

.product-description p:last-child {
  margin-bottom: 0;
}

.product-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-md, 16px);
}

.product-features-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm, 8px);
  font-size: var(--font-size-base, 16px);
  line-height: 1.6;
  color: var(--color-text, #333333);
  padding: var(--space-md, 16px) var(--space-lg, 24px);
  background-color: var(--color-bg-light, #f5f7fa);
  border-left: 3px solid var(--color-primary, #1a73e8);
  border-radius: 0 var(--border-radius-md, 8px) var(--border-radius-md, 8px) var(--border-radius-md, 8px);
}

.product-features-list li::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-white, #ffffff);
  background: linear-gradient(135deg, var(--color-primary, #1a73e8), var(--color-accent, #00b4d8));
  border-radius: 50%;
  margin-top: 1px;
}


/* ============== Specs Table ============== */
.specs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-size-sm, 14px);
  background-color: var(--color-white, #ffffff);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--border-radius-md, 8px);
  overflow: hidden;
}

.specs-table th,
.specs-table td {
  padding: 14px var(--space-lg, 24px);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.specs-table tr:last-child th,
.specs-table tr:last-child td {
  border-bottom: none;
}

.specs-table th {
  width: 38%;
  font-weight: 600;
  color: var(--color-dark, #1a1a2e);
  background-color: var(--color-bg-light, #f5f7fa);
  border-right: 1px solid var(--color-border, #e0e0e0);
  white-space: nowrap;
}

.specs-table td {
  color: var(--color-text, #333333);
  font-weight: 500;
}

.specs-table tr:nth-child(even) th,
.specs-table tr:nth-child(even) td {
  background-color: var(--color-bg-section, #eef2f7);
}

.specs-table tr:nth-child(even) th {
  background-color: #e6ecf3;
}


/* ============== Detail CTA ============== */
.product-cta {
  margin-top: var(--space-xl, 48px);
  padding: var(--space-xl, 48px) var(--space-lg, 24px);
  background: linear-gradient(135deg, var(--color-dark, #1a1a2e) 0%, #243a64 100%);
  border-radius: var(--border-radius-lg, 16px);
  text-align: center;
  color: var(--color-white, #ffffff);
  position: relative;
  overflow: hidden;
}

.product-cta::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.35), transparent 60%);
  pointer-events: none;
}

.product-cta h3 {
  font-size: var(--font-size-2xl, 24px);
  font-weight: 700;
  margin-bottom: var(--space-md, 16px);
  position: relative;
  z-index: 1;
}

.product-cta p {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: var(--space-lg, 24px);
  position: relative;
  z-index: 1;
}

.product-cta .btn {
  position: relative;
  z-index: 1;
}


/* ============== Related Products ============== */
.related-products {
  background-color: var(--color-bg-section, #eef2f7);
  padding: var(--space-xxl, 80px) 0;
}

.related-products .section-title {
  margin-bottom: var(--space-xl, 48px);
}

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


/* ============== Error State ============== */
.product-error {
  padding: var(--space-xxl, 80px) 0;
  text-align: center;
  background-color: var(--color-white, #ffffff);
}

.product-error .error-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-lg, 24px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light, #e8f0fe), var(--color-bg-section, #eef2f7));
  color: var(--color-primary, #1a73e8);
  font-size: 44px;
  font-weight: 700;
}

.product-error h2 {
  font-size: var(--font-size-2xl, 24px);
  font-weight: 700;
  color: var(--color-dark, #1a1a2e);
  margin-bottom: var(--space-md, 16px);
}

.product-error p {
  font-size: var(--font-size-base, 16px);
  color: var(--color-text-muted, #666666);
  max-width: 480px;
  margin: 0 auto var(--space-lg, 24px);
}

.product-error .error-actions {
  display: flex;
  gap: var(--space-md, 16px);
  justify-content: center;
  flex-wrap: wrap;
}


/* ============== Loading State ============== */
.product-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xxl, 80px) 0;
  color: var(--color-text-muted, #666666);
  font-size: var(--font-size-base, 16px);
  gap: var(--space-sm, 8px);
}

.product-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border, #e0e0e0);
  border-top-color: var(--color-primary, #1a73e8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ============== Responsive ============== */
@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg, 24px);
  }
  .product-gallery {
    position: static;
  }
}

@media (max-width: 768px) {
  .products-filters {
    top: 60px;
  }
  .products-hero,
  .product-detail-hero {
    padding-top: var(--space-xl, 48px);
  }
  .product-card .card-body {
    padding: var(--space-md, 16px);
  }
  .product-features-list li {
    padding: var(--space-sm, 8px) var(--space-md, 16px);
  }
  .product-cta {
    padding: var(--space-lg, 24px) var(--space-md, 16px);
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .specs-table th,
  .specs-table td {
    padding: 12px var(--space-md, 16px);
  }
  .specs-table th {
    width: 42%;
  }
}
