/* ═══════════════════════════════════════════════════════
   Products Page Styles: Phượng Hoàng Design System
   Matches index.html: white/sage/navy/green palette
   Browse Header → Category Tabs + Grid → Support Strip → CTA → FAQ
   ═══════════════════════════════════════════════════════ */

/* ═══════════ BROWSE HEADER: first section; clears the fixed header (top bar in flow) ═══════════ */
.ph-browse-header {
  padding: calc(var(--ph-header-h) + clamp(1.75rem, 4vw, 3rem)) 0 clamp(1.5rem, 3vw, 2.5rem);
}

/* ═══════════ PRODUCT LAYOUT: Category tabs + 3-card grid ═══════════ */
#ph-product-section {
  padding-top: 0;
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.ph-products-layout {
  display: block;
}

/* ── Category tabs ── */
.ph-products-sidebar {
  margin-bottom: 1.5rem;
}
.ph-sidebar-title {
  font-family: var(--ph-font-display);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ph-text-muted);
  margin: 0 0 .625rem;
}
.ph-sidebar-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.ph-sidebar-nav a,
.ph-sidebar-nav button {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  text-align: left;
  padding: .85rem 1rem;
  min-height: 68px;
  border-radius: var(--ph-radius-md);
  font-size: .875rem;
  font-weight: 600;
  color: var(--ph-text-secondary);
  text-decoration: none;
  background: var(--ph-surface-primary);
  border: 1px solid var(--ph-border-default);
  cursor: pointer;
  font-family: var(--ph-font-body);
  transition: color var(--ph-duration-fast),
              background var(--ph-duration-fast),
              border-color var(--ph-duration-fast),
              box-shadow var(--ph-duration-fast),
              transform var(--ph-duration-fast);
}
.ph-sidebar-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: var(--ph-radius-sm);
  color: var(--ph-accent);
  background: var(--ph-accent-subtle);
}
.ph-sidebar-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ph-sidebar-label { flex: 1; line-height: 1.3; }
.ph-sidebar-count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 .4rem;
  border-radius: var(--ph-radius-full);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ph-text-muted);
  background: var(--ph-section-alt-bg);
}
.ph-sidebar-nav a:hover,
.ph-sidebar-nav button:hover {
  color: var(--ph-accent);
  background: var(--ph-accent-subtle);
  border-color: color-mix(in srgb, var(--ph-accent) 35%, var(--ph-border-default));
  transform: translateY(-1px);
}
.ph-sidebar-nav a.active,
.ph-sidebar-nav button.active {
  background: var(--ph-accent);
  color: var(--ph-text-on-accent);
  font-weight: 600;
  border-color: var(--ph-accent);
  box-shadow: 0 6px 18px rgba(29, 139, 44, .16);
}
.ph-sidebar-nav a.active .ph-sidebar-icon,
.ph-sidebar-nav button.active .ph-sidebar-icon,
.ph-sidebar-nav a.active .ph-sidebar-count,
.ph-sidebar-nav button.active .ph-sidebar-count {
  color: var(--ph-text-on-accent);
  background: rgba(255, 255, 255, .16);
}
.ph-category-description {
  max-width: 68ch;
  margin: .75rem 0 0;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--ph-text-secondary);
}

/* ── Toolbar ── */
.ph-products-main {
  min-width: 0;
}
.ph-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--ph-divider);
  font-size: .8125rem;
}
.ph-toolbar-count {
  color: var(--ph-text-muted);
  font-weight: 500;
}
.ph-toolbar-sort {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--ph-text-secondary);
}
.ph-toolbar-sort select {
  padding: .35rem .75rem;
  border: 1px solid var(--ph-border-default);
  border-radius: var(--ph-radius-sm);
  font-size: .8125rem;
  font-family: var(--ph-font-body);
  color: var(--ph-text-primary);
  background: var(--ph-surface-primary);
  cursor: pointer;
  transition: border-color var(--ph-duration-fast) var(--ph-ease-out);
  min-height: 44px;
}
.ph-toolbar-sort select:hover,
.ph-toolbar-sort select:focus-visible {
  border-color: var(--ph-accent);
}

/* ── Product Grid: 3 cards/row desktop ── */
.ph-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* ═══════════ PRODUCT CARD: Clean, light, equal height ═══════════ */
.ph-product-card {
  display: flex;
  flex-direction: column;
  background: var(--ph-surface-primary);
  border: 1px solid var(--ph-border-default);
  border-radius: var(--ph-radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(29,139,44,.04);
  transition: transform .35s cubic-bezier(.16,1,.3,1),
              box-shadow .35s cubic-bezier(.16,1,.3,1),
              border-color var(--ph-duration-fast) var(--ph-ease-out);
}
.ph-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(29,139,44,.09), 0 2px 6px rgba(8,51,90,.04);
  border-color: var(--ph-accent);
}

/* Card image: sage bg, NO CSS filters, recessed interior (double-bezel lite) */
.ph-card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--ph-section-alt-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(8,51,90,.04);
}
.ph-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--ph-duration-slow) var(--ph-ease-out);
}
.ph-product-card:hover .ph-card-img-wrap img { transform: scale(1.03); }

/* Card body: flex column, pin CTA to bottom */
.ph-card-body {
  padding: .9rem 1.05rem 1.05rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--ph-border-subtle);
}
.ph-card-badge {
  position: absolute;
  top: .55rem;
  left: .55rem;
  z-index: 1;
  display: inline-flex;
  padding: .15rem .55rem;
  border-radius: 4px;
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ph-card-badge.in-stock {
  background: var(--ph-accent-subtle);
  color: var(--ph-accent);
}
.ph-card-badge.out-of-stock {
  background: var(--ph-surface-primary);
  color: var(--ph-text-muted);
  border: 1px solid var(--ph-border-default);
}

.ph-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
  font-size: .625rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.4;
}
.ph-card-cat {
  color: var(--ph-accent);
  font-weight: 600;
}
.ph-card-models {
  color: var(--ph-text-muted);
  font-weight: 500;
  border-left: 1px solid var(--ph-border-default);
  padding-left: .5rem;
}

.ph-card-body h3 {
  font-family: var(--ph-font-display);
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ph-text-primary);
  margin: 0 0 .25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ph-card-body p {
  font-size: .8125rem;
  color: var(--ph-text-secondary);
  line-height: 1.5;
  margin: 0 0 .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ph-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .55rem;
}
.ph-card-spec {
  font-size: .6875rem;
  padding: .12rem .45rem;
  background: var(--ph-accent-subtle);
  color: var(--ph-text-accent);
  border-radius: 3px;
}
.ph-card-cta {
  margin-top: auto;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ph-accent);
}
.ph-product-card:hover .ph-card-cta { text-decoration: underline; }

/* ── No Results ── */
.ph-no-results {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  grid-column: 1 / -1;
}
.ph-no-results-icon {
  color: var(--ph-text-muted);
  margin-bottom: 1rem;
  opacity: .4;
}
.ph-no-results-msg {
  color: var(--ph-text-secondary);
  font-size: 1rem;
  margin-bottom: .5rem;
}
.ph-no-results-hint { font-size: .875rem; color: var(--ph-text-muted); }
.ph-no-results-hint a { color: var(--ph-accent); }

/* ═══════════ SUPPORT STRIP ═══════════ */
.ph-support-strip {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  background: var(--ph-section-alt-bg);
  border-top: 1px solid var(--ph-divider);
}
.ph-support-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.ph-support-item {
  text-align: center;
  padding: .5rem;
}
.ph-support-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--ph-accent-subtle);
  color: var(--ph-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .65rem;
}
.ph-support-item h3 {
  font-family: var(--ph-font-display);
  font-size: .875rem;
  font-weight: 600;
  color: var(--ph-text-primary);
  margin-bottom: .25rem;
}
.ph-support-item p {
  font-size: .8125rem;
  color: var(--ph-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── FAQ footer ── */
.ph-faq-foot { text-align: center; margin-top: .75rem; }
.ph-faq-foot-text { color: var(--ph-text-muted); font-size: .875rem; margin-bottom: .5rem; }

/* ═══════════ FAQ: match the homepage stacked accordion ═══════════ */
.ph-faq-sec {
  position: relative;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  background: var(--ph-bg-primary);
}
.ph-faq-sec::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--ph-divider) 20%, var(--ph-divider) 80%, transparent 100%);
}
.ph-faq-sec .ph-faq-filters-wrap {
  justify-content: flex-start;
  gap: .5rem;
  margin: clamp(1.25rem, 2.5vw, 2rem) 0 .75rem;
}
.ph-faq-sec .ph-faq-filter-btn {
  height: 36px;
  padding-inline: .875rem;
}
.ph-faq-sec .ph-faq-list-wrap {
  gap: 0;
  border: 1px solid var(--ph-border-subtle);
  border-radius: var(--ph-radius-lg);
  overflow: hidden;
}
.ph-faq-sec .ph-faq-item {
  border: 0;
  border-bottom: 1px solid var(--ph-border-subtle);
  border-radius: 0;
  box-shadow: none;
}
.ph-faq-sec .ph-faq-item:last-child { border-bottom: 0; }
.ph-faq-sec .ph-faq-item.open {
  border-left: 0;
  border-color: var(--ph-border-subtle);
  box-shadow: none;
}
.ph-faq-sec .ph-faq-question {
  gap: var(--ph-space-sm);
  padding: var(--ph-space-md) var(--ph-space-lg);
  color: var(--ph-text-secondary);
  background: var(--ph-surface-primary);
}
.ph-faq-sec .ph-faq-question:hover { background: var(--ph-surface-primary); }
.ph-faq-sec .ph-faq-item.open .ph-faq-question {
  color: var(--ph-text-primary);
  font-weight: 600;
}
.ph-faq-sec .ph-faq-q-icon { display: none; }
.ph-faq-sec .ph-faq-arrow {
  position: relative;
  width: 16px;
  height: 16px;
  color: transparent;
  font-size: 0;
  transform: none;
}
.ph-faq-sec .ph-faq-arrow::before,
.ph-faq-sec .ph-faq-arrow::after {
  content: '';
  position: absolute;
  background: var(--ph-text-muted);
  transition: background 200ms var(--ph-ease-out), transform 250ms var(--ph-ease-out);
}
.ph-faq-sec .ph-faq-arrow::before { top: 7px; left: 3px; width: 10px; height: 1.5px; }
.ph-faq-sec .ph-faq-arrow::after { top: 3px; left: 7px; width: 1.5px; height: 10px; }
.ph-faq-sec .ph-faq-item.open .ph-faq-arrow { transform: rotate(45deg); }
.ph-faq-sec .ph-faq-item.open .ph-faq-arrow::before,
.ph-faq-sec .ph-faq-item.open .ph-faq-arrow::after { background: var(--ph-accent); }
.ph-faq-sec .ph-faq-answer-inner {
  min-height: 0;
  padding: 0;
  color: var(--ph-text-secondary);
}
.ph-faq-sec .ph-faq-answer-inner p {
  max-width: 720px;
  margin: 0;
  padding: 0 var(--ph-space-lg) var(--ph-space-md);
  font: var(--ph-text-body-sm);
  line-height: 1.7;
}
.ph-faq-sec .ph-faq-answer-inner p + p { padding-top: 0; }
.ph-faq-sec .ph-faq-foot {
  text-align: left;
  margin-top: var(--ph-space-md);
}
.ph-faq-sec .ph-faq-foot-text { display: none; }
.ph-faq-sec .ph-faq-foot .bp-btn-magnetic {
  min-height: 0;
  padding: 0;
  color: var(--ph-accent);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font: var(--ph-text-body-sm);
  font-weight: 600;
}
.ph-faq-sec .ph-faq-foot .bp-btn-magnetic:hover {
  color: var(--ph-accent-hover);
  background: transparent;
  box-shadow: none;
  transform: none;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1200px) {
  .ph-sidebar-nav { gap: .625rem; }
  .ph-sidebar-nav a,
  .ph-sidebar-nav button { padding: .75rem; }
}

@media (max-width: 1024px) {
  .ph-sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .ph-support-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

@media (max-width: 767px) {
  .ph-browse-header { padding-top: calc(var(--ph-header-h) + clamp(1.5rem, 4vw, 2rem)); padding-bottom: clamp(1.25rem, 3vw, 2rem); }

  .ph-sidebar-nav a,
  .ph-sidebar-nav button {
    padding: .65rem .7rem;
    font-size: .8125rem;
    min-height: 60px;
  }
  .ph-sidebar-icon { flex-basis: 32px; width: 32px; height: 32px; }
  .ph-sidebar-icon svg { width: 17px; height: 17px; }
  .ph-category-description { font-size: .8125rem; margin-top: .625rem; }

  .ph-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
  .ph-support-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .ph-toolbar { flex-direction: column; gap: .5rem; align-items: flex-start; }
  .ph-faq-sec .ph-faq-filters-wrap {
    justify-content: flex-start;
    margin-top: 1.25rem;
    scrollbar-width: none;
  }
  .ph-faq-sec .ph-faq-filters-wrap::-webkit-scrollbar { display: none; }
  .ph-faq-sec .ph-faq-question { padding: var(--ph-space-sm) var(--ph-space-md); }
  .ph-faq-sec .ph-faq-answer-inner p { padding: 0 var(--ph-space-md) var(--ph-space-sm); }
  .ph-faq-sec .ph-faq-q-text { font-size: .8125rem; }
}

@media (max-width: 479px) {
  .ph-browse-header { padding-top: calc(var(--ph-header-h) + clamp(1.5rem, 4vw, 1.75rem)); }
  .ph-sidebar-nav { gap: .5rem; }
  .ph-sidebar-label { font-size: .78125rem; }
  .ph-sidebar-count { min-width: 24px; height: 24px; padding: 0 .3rem; }
  .ph-product-grid { grid-template-columns: 1fr; gap: .85rem; }
  .ph-support-grid { grid-template-columns: 1fr; gap: .5rem; }
  .ph-card-body { padding: .8rem .9rem .9rem; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .ph-product-card,
  .ph-product-card:hover { transform: none; transition: border-color .15s; }
  .ph-card-img-wrap img,
  .ph-product-card:hover .ph-card-img-wrap img { transition: none; transform: none; }
  .bp-reveal { opacity: 1; transform: none; transition: none; }
  .bp-reveal.revealed { opacity: 1; transform: none; }
}
