/**
 * Next Phase Core — product cards, catalogs, FAQ, modal
 * Works with Astra child theme design tokens.
 */

.np-products-grid,
.np-catalogs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

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

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

.np-product-card,
.np-catalog-card {
  background: var(--np-white, #fff);
  border: 1px solid var(--np-border, #e6e6e6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.np-product-card:hover,
.np-catalog-card:hover {
  border-color: var(--np-orange, #fe5000);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Product image area: plain white, no decorative grey/orange backdrop behind the filters. */
.np-product-card__media {
  background: #fff;
  border-bottom: 1px solid var(--np-border, #e6e6e6);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

/* Fill the padded box and let object-fit do the containment — percentage max-height does not
   resolve against an aspect-ratio-derived height, which let tall product photos overflow and crop. */
.np-product-card__media img {
  position: absolute;
  inset: 1rem;
  width: calc(100% - 2rem);
  height: calc(100% - 2rem);
  object-fit: contain;
}

.np-product-card__placeholder {
  width: 55%;
  height: 55%;
  background: repeating-linear-gradient(
    -45deg,
    #cfcfcf,
    #cfcfcf 8px,
    #dedede 8px,
    #dedede 16px
  );
}

/* Category landing-page cards use a wider 4:3 image area. */
.np-product-card--category .np-product-card__media {
  aspect-ratio: 4 / 3;
}

.np-product-card--category .np-product-card__placeholder {
  width: 46%;
  height: 62%;
}

/* Category product names are long fitment titles — keep them compact. */
.np-product-card--category .np-product-card__title {
  font-size: 1.15rem;
  line-height: 1.3;
}

.np-product-card__body,
.np-catalog-card__body {
  padding: 1.25rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.np-product-card__title,
.np-catalog-card__title {
  font-family: var(--np-font-display, inherit);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--np-black, #1a1a1a);
}

.np-product-card__excerpt,
.np-catalog-card__desc {
  margin: 0;
  color: var(--np-muted, #555);
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
}

.np-product-card__actions,
.np-catalog-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  font-family: var(--np-font-body, inherit);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.np-btn--primary {
  background: var(--np-orange, #fe5000);
  color: #fff;
  border-color: var(--np-orange, #fe5000);
}

.np-btn--primary:hover,
.np-btn--primary:focus,
.np-btn--primary:focus-visible {
  background: var(--np-orange-dark, #d64300);
  border-color: var(--np-orange-dark, #d64300);
  color: #fff;
  transform: translateY(-1px);
}

.np-btn--outline {
  background: transparent;
  color: var(--np-black, #1a1a1a);
  border-color: var(--np-black, #1a1a1a);
}

.np-btn--outline:hover,
.np-btn--outline:focus,
.np-btn--outline:focus-visible {
  background: var(--np-black, #1a1a1a);
  color: #fff;
}

.np-btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}

.np-btn--ghost:hover,
.np-btn--ghost:focus,
.np-btn--ghost:focus-visible {
  background: #fff;
  color: var(--np-black, #1a1a1a);
}

/* Larger primary call-to-action (e.g. "Shop Exclusively on Amazon") */
.np-btn--lg {
  min-height: 52px;
  padding: 0.9rem 1.7rem;
  font-size: 1rem;
}

/* FAQ accordion */
.np-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 2.75rem; /* between FAQ sections; the questions inside a section are spaced by .np-faq-section__items */
  max-width: 820px;
}

.np-faq-section__items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Section heading: the same short orange rule + reading size as the long-form headings on the About page */
.np-faq-section__title {
  position: relative;
  margin: 0 0 1.1rem;
  padding-top: 1.1rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.25;
}

.np-faq-section__title::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 4px;
  background: var(--np-orange, #fe5000);
}

/* The question button sits inside a heading (accordion semantics): neutralise the heading's own box and type */
.np-faq-item__heading {
  margin: 0;
  padding: 0;
  font-size: inherit;
  letter-spacing: normal;
  line-height: inherit;
}

.np-faq-item {
  border: 1px solid var(--np-border, #e6e6e6);
  background: #fff;
}

.np-faq-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 0;
  cursor: pointer;
  font-family: var(--np-font-display, inherit);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--np-black, #1a1a1a);
}

/* Lock FAQ trigger interaction states so Astra button:hover/focus cannot introduce blue */
.np-faq-item__trigger:hover,
.np-faq-item__trigger:focus,
.np-faq-item__trigger:focus-visible,
.np-faq-item__trigger:active,
.np-faq-item__trigger[aria-expanded="true"] {
  background: #fff;
  background-color: #fff;
  color: var(--np-black, #1a1a1a);
  border: 0;
}

.np-faq-item__trigger:focus,
.np-faq-item__trigger:focus-visible {
  outline: 2px solid var(--np-orange, #fe5000);
  outline-offset: 2px;
}

.np-faq-item__icon {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--np-orange, #fe5000);
  border-bottom: 2px solid var(--np-orange, #fe5000);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.np-faq-item__trigger[aria-expanded="true"] .np-faq-item__icon {
  transform: rotate(-135deg);
}

.np-faq-item__panel[hidden] {
  display: none;
}

.np-faq-item__content {
  padding: 0 1.25rem 1.25rem;
  color: var(--np-muted, #555);
  line-height: 1.65;
}

/* The answer's own paragraph margin would double the panel's bottom padding */
.np-faq-item__content > :last-child {
  margin-bottom: 0;
}

/* Modal — custom JS, no Elementor Pro */
.np-modal[hidden] {
  display: none;
}

.np-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.np-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.72);
}

.np-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

/* Compact dialog (Coming Soon) */
.np-modal__dialog--compact {
  width: min(420px, 100%);
  padding: 2.75rem 1.5rem 2rem;
  text-align: center;
}

.np-modal__dialog--compact .np-modal__title {
  margin-bottom: 1.5rem;
}

.np-modal__close {
  position: absolute;
  z-index: 2; /* above the photo panel, which covers the top-right corner in the single-column layout (<= 768px) */
  top: 0.75rem;
  right: 0.75rem;
  border: 0;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: #333;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.np-modal__close:hover,
.np-modal__close:focus,
.np-modal__close:focus-visible {
  background: transparent;
  color: var(--np-orange, #fe5000);
  outline: 2px solid var(--np-orange, #fe5000);
  outline-offset: 2px;
}

.np-modal__close:active {
  background: transparent;
  color: var(--np-orange-dark, #d64300);
}

.np-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .np-modal__grid {
    grid-template-columns: 1fr;
  }
}

/* Plain light panel — the product photos are cut-outs, so no dark/orange backdrop behind them. */
.np-modal__media {
  background: #f6f6f6;
  border: 1px solid var(--np-border, #e6e6e6);
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.np-modal__media[hidden] {
  display: none;
}

.np-modal__grid--no-media {
  grid-template-columns: 1fr;
}

.np-modal__media img {
  max-width: 80%;
  max-height: 280px;
  object-fit: contain;
}

.np-modal__title {
  margin: 0 0 0.75rem;
  font-family: var(--np-font-display, inherit);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
}

.np-modal__desc {
  color: #555;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.np-modal__specs {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.np-modal__specs li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #333;
}

.np-modal__specs li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.55rem;
  height: 3px;
  background: var(--np-orange, #fe5000);
}

.np-empty,
.np-muted {
  color: #777;
}

body.np-modal-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .np-product-card:hover,
  .np-catalog-card:hover {
    transform: none;
  }
}
