/* ============================================================
   product.css  — product detail & inner-page bespoke CSS.
   Processed by PostCSS (autoprefixer only; no @import "tailwindcss").
   Loaded on /products/{slug}, /brands/{slug}, /categories/{slug}.
   ============================================================ */

/* ---------- Product detail page ---------- */
.product-detail__layout {
  display: grid;
  gap: clamp(24px, 4vw, 40px);
}

.product-detail__gallery {
  min-width: 0;
}

.product-detail__summary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-detail__brand {
  width: -moz-fit-content;
  width: fit-content;
  color: var(--ih-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.product-detail__title {
  margin: 0;
  color: var(--ih-ink);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.05;
}

.product-detail__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.product-detail__stock-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ECFDF5;
  color: #047857;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.product-detail__description {
  margin: 0;
  color: var(--ih-muted);
  font-size: 15px;
  line-height: 1.65;
}

.product-detail__fallback {
  width: -moz-fit-content;
  width: fit-content;
  color: var(--ih-accent);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

@media (min-width: 768px) {
  .product-detail__layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
    align-items: start;
  }

  .product-detail__gallery {
    position: sticky;
    top: 112px;
  }
}

/* ---------- Product gallery ---------- */
.product-gallery__main {
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  border-radius: 16px;
  background: #F8FAFF;
  border: 1px solid #E4EBF5;
}
.product-gallery--enhanced .product-gallery__main {
  overflow: hidden;
  scroll-snap-type: none;
}
.product-gallery__main-track {
  display: flex;
  touch-action: pan-y;
}
.product-gallery__main-slide {
  flex: 0 0 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  scroll-snap-align: start;
}
.product-gallery__main-slide img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}
.product-gallery__thumbs {
  margin-top: 12px;
  overflow-x: auto;
}
.product-gallery--enhanced .product-gallery__thumbs {
  overflow: hidden;
}
.product-gallery__thumb-track {
  display: flex;
  gap: 8px;
}
.product-gallery__thumb {
  flex: 0 0 72px;
  height: 72px;
  display: block;
  border-radius: 10px;
  border: 2px solid #E4EBF5;
  background: #F8FAFF;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s;
}
.product-gallery__thumb.is-selected,
.product-gallery__thumb[aria-current="true"] {
  border-color: #2563EB;
}
.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  padding: 4px;
}

/* ---------- Product buy box ---------- */
.product-buy-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--ih-line);
  border-radius: 8px;
  background: #fff;
  padding: clamp(18px, 3vw, 24px);
  box-shadow: 0 18px 42px -28px rgba(15, 23, 42, .38);
}

.product-buy-box__price-row {
  display: grid;
  gap: 8px;
}

.product-buy-box__save {
  width: -moz-fit-content;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #ECFDF5;
  color: #047857;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.product-buy-box__microcopy,
.product-buy-box__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  color: var(--ih-muted);
  font-size: 12.5px;
  font-weight: 650;
}

.product-buy-box__microcopy span,
.product-buy-box__trust span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.product-buy-box__actions,
.product-buy-box__cart-form {
  display: grid;
  gap: 10px;
}

.product-buy-box__cart-form {
  grid-template-columns: minmax(74px, 92px) 1fr;
  align-items: end;
}

.product-buy-box__qty-label {
  grid-column: 1;
  color: var(--ih-muted);
  font-size: 12px;
  font-weight: 800;
}

.product-buy-box__qty {
  grid-column: 1;
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--ih-line);
  border-radius: 8px;
  color: var(--ih-ink);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.product-buy-box__add {
  grid-row: 1 / span 2;
  grid-column: 2;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--ih-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.product-buy-box__whatsapp,
.product-buy-box__secondary {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.product-buy-box__whatsapp {
  background: #15904F;
  color: #fff;
}

.product-buy-box__secondary {
  border: 1px solid var(--ih-line);
  color: var(--ih-ink);
}

.product-buy-box__email {
  color: var(--ih-accent);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.product-buy-box__trust {
  border-top: 1px solid var(--ih-line);
  padding-top: 14px;
}

/* ---------- Specification table ---------- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spec-table tr {
  border-bottom: 1px solid #E4EBF5;
  transition: background .12s;
}
.spec-table tr:last-child { border-bottom: none; }
.spec-table tr:hover { background: #F8FAFF; }
.spec-table td {
  padding: 12px 16px;
  vertical-align: top;
  line-height: 1.5;
}
.spec-table td:first-child {
  font-weight: 600;
  color: #334155;
  width: 40%;
  white-space: nowrap;
}
.spec-table td:last-child {
  color: #0F172A;
}
/* Collapsed state: hide rows beyond maxRows (controlled by Alpine specTable) */
.spec-table.is-collapsed tr.spec-row-hidden {
  display: none;
}

.product-specs__toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 12px 0 0 -8px;
  border: 0;
  background: transparent;
  color: var(--ih-accent);
  padding: 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- FAQ accordion ---------- */
.faq-item {
  border-bottom: 1px solid #E4EBF5;
}
.faq-item:last-child { border-bottom: none; }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 0;
  font-weight: 600;
  font-size: 15px;
  color: #0F172A;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  gap: 16px;
  line-height: 1.4;
  transition: color .15s;
}
.faq-question:hover { color: #2563EB; }
.faq-question.is-open { color: #2563EB; }

.faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #E4EBF5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
}
.faq-question.is-open .faq-icon {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
  transform: rotate(45deg);
}

.faq-answer {
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.22,.7,.2,1), opacity .25s ease;
}
.faq-answer-inner {
  padding: 0 0 20px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
}

/* ---------- Trust mini-grid ---------- */
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: 14px;
  background: #F8FAFF;
  border: 1px solid #E4EBF5;
}
.trust-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #EEF4FE;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563EB;
}
.trust-item__label {
  font-weight: 700;
  font-size: 13px;
  color: #0F172A;
  line-height: 1.3;
}
.trust-item__sub {
  font-size: 12px;
  color: #64748B;
}

/* ---------- Related products row ---------- */
.related-products {
  margin-top: clamp(72px, 9vw, 112px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.related-products .ih-section-heading {
  margin-bottom: clamp(24px, 3vw, 36px);
}

.related-products__rail {
  display: flex;
  gap: clamp(20px, 2.5vw, 30px);
  overflow-x: auto;
  padding: 6px 4px 28px;
  scroll-padding-inline: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.related-products__rail > .product-listing-card {
  flex: 0 0 clamp(252px, 25vw, 304px);
  scroll-snap-align: start;
}

/* ---------- Listing pages ---------- */
.listing-page {
  min-width: 0;
}

.listing-page__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.listing-page__title {
  margin: 0;
  color: var(--ih-ink);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 850;
  line-height: 1.08;
}

.listing-page__meta {
  color: var(--ih-muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.listing-toolbar {
  display: grid;
  gap: 14px;
  margin: 0 0 24px;
  padding: 14px;
  border: 1px solid var(--ih-line);
  border-radius: 8px;
  background: #fff;
}

.listing-toolbar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.listing-toolbar__count {
  color: var(--ih-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.listing-toolbar__forms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.listing-toolbar__search,
.listing-toolbar__sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.listing-toolbar__search {
  position: relative;
}

.listing-toolbar__search-input {
  width: min(60vw, 280px);
  min-height: 44px;
  border: 1.5px solid var(--ih-line);
  border-radius: 8px;
  padding: 0 48px 0 12px;
  color: var(--ih-ink);
  font-size: 14px;
  outline: none;
}

.listing-toolbar__search-button {
  position: absolute;
  right: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ih-muted);
  cursor: pointer;
}

.listing-toolbar__search-button:hover {
  color: var(--ih-accent);
  background: #EEF4FE;
}

.listing-toolbar__sort-label {
  color: var(--ih-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.listing-toolbar__select {
  min-height: 44px;
  border: 1.5px solid var(--ih-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ih-ink);
  padding: 0 10px;
  font-size: 14px;
  cursor: pointer;
}

.listing-toolbar__filters,
.listing-toolbar__filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.listing-toolbar__chip,
.listing-toolbar__reset {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.listing-toolbar__chip {
  border: 1px solid var(--ih-line);
  background: #fff;
  color: var(--ih-ink);
}

.listing-toolbar__chip:hover,
.listing-toolbar__chip--active {
  border-color: rgba(37, 99, 235, .25);
  background: #EEF4FE;
  color: var(--ih-accent);
}

.listing-toolbar__reset {
  color: var(--ih-muted);
}

.listing-toolbar__reset:hover {
  color: var(--ih-accent);
}

.listing-empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 220px;
  border: 1px dashed var(--ih-line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  padding: 32px 16px;
}

.listing-empty-state__title {
  margin: 0;
  color: var(--ih-muted);
  font-size: 15px;
  font-weight: 650;
}

.listing-empty-state__link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: var(--ih-accent);
  color: #fff;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 640px) {
  .listing-page__header,
  .listing-toolbar__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .listing-toolbar__forms,
  .listing-toolbar__search,
  .listing-toolbar__sort,
  .listing-toolbar__search-input,
  .listing-toolbar__select {
    width: 100%;
  }

  .listing-toolbar__forms {
    justify-content: stretch;
  }
}
