/* ==========================================================================
   TechWings — product list (products.html) and product details (product.html)
   Loaded after styles.css and pages.css.
   ========================================================================== */

/* ---------- Catalogue hero ---------- */
.page-hero--catalog .container { padding-bottom: 28px; }
.hero-search {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 46rem; margin-top: 24px; padding: 6px;
  border-radius: var(--r-lg); background: #fff; box-shadow: 0 10px 30px -10px rgb(0 0 0 / .35);
}
.hero-search__icon { display: grid; place-items: center; padding-left: 10px; color: var(--muted); }
.hero-search input { min-width: 0; flex: 1; height: 46px; border: 0; background: transparent; font-size: 16px; color: var(--ink); outline: none; }
.hero-search input::placeholder { color: rgb(91 103 133 / .8); }
.hero-search .btn { height: 46px; }
.quick-cats { display: flex; gap: 8px; margin: 22px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.quick-cats::-webkit-scrollbar { display: none; }
.quick-cats li { flex-shrink: 0; }
.quick-cats button {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16); font-size: 13.5px; font-weight: 600; color: rgb(255 255 255 / .85);
  transition: background .2s, color .2s;
}
.quick-cats button:hover { background: rgb(255 255 255 / .16); color: #fff; }
.quick-cats button.is-active { background: #fff; color: var(--ink); box-shadow: none; }
.quick-cats button.is-active .icon { color: var(--brand); }
@media (min-width: 1024px) { .quick-cats { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; } }

/* ---------- Layout ---------- */
.catalog { background: var(--canvas); padding: 28px 0 80px; }
.catalog__grid { display: grid; gap: 28px; }
.catalog__grid > * { min-width: 0; }
@media (min-width: 1024px) { .catalog__grid { grid-template-columns: 270px 1fr; gap: 32px; align-items: start; } }

/* ---------- Filters (sidebar ≥1024px, drawer below) ---------- */
.filters { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; outline: none; }
.filters__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.filters__head h2 { font-size: 16px; font-weight: 800; }
.filters__body { padding: 4px 18px 8px; }
.filters__foot { display: none; }
.fgroup { margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); }
.fgroup:last-of-type { border-bottom: 0; }
.fgroup legend { float: left; width: 100%; margin-bottom: 10px; padding: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fgroup ul { clear: both; display: grid; gap: 2px; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.fopt:hover { background: var(--canvas); }
.fopt input { width: 17px; height: 17px; flex-shrink: 0; margin: 0; accent-color: var(--brand); cursor: pointer; }
.fopt span { flex: 1; min-width: 0; }
.fopt em { min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--canvas); text-align: center; font-size: 12px; font-style: normal; font-weight: 600; color: var(--muted); }
.fopt input:checked ~ span { font-weight: 700; color: var(--ink); }
.fopt input:checked ~ em { background: var(--brand-50); color: var(--brand); }
.fopt.is-empty { opacity: .45; }
.fhint { display: flex; gap: 8px; margin: 4px 0 12px; padding: 12px; border-radius: var(--r); background: var(--brand-50); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.fhint .icon { flex-shrink: 0; margin-top: 2px; color: var(--brand); }
@media (min-width: 1024px) {
  .filters { position: sticky; top: 20px; max-height: calc(100vh - 40px); }
  .filters__head .icon-btn { display: none; }
  .filters__body { overflow-y: auto; }
  .filters-overlay { display: none; }
}
@media (max-width: 1023px) {
  .filters-wrap { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
  .filters-wrap.is-open { pointer-events: auto; }
  .filters-overlay { position: absolute; inset: 0; background: rgb(11 22 48 / .5); opacity: 0; transition: opacity .3s; }
  .filters-wrap.is-open .filters-overlay { opacity: 1; }
  .filters {
    position: absolute; inset: 0 auto 0 0; width: 88%; max-width: 380px; border: 0; border-radius: 0;
    transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lift);
  }
  .filters-wrap.is-open .filters { transform: none; }
  .filters__body { flex: 1; overflow-y: auto; }
  .filters__foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; }
}

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar__count { font-size: 14px; color: var(--muted); }
.toolbar__count b { color: var(--ink); }
.toolbar__controls { display: flex; align-items: center; gap: 8px; }
.toolbar__filter-btn { gap: 6px; background: #fff; }
.toolbar__badge { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }
.toolbar__badge[hidden] { display: none; }
@media (min-width: 1024px) { .toolbar__filter-btn { display: none; } }
.sort select {
  height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6785' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.view-toggle { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.view-toggle button { display: grid; place-items: center; width: 36px; height: 34px; color: var(--muted); }
.view-toggle button + button { border-left: 1px solid var(--line); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
@media (max-width: 479px) {
  .toolbar__controls { width: 100%; }
  .sort { flex: 1; }
  .sort select { width: 100%; }
}

/* ---------- Active filter chips ---------- */
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.active-chips:empty { display: none; }
.achip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--brand-50); box-shadow: inset 0 0 0 1px rgb(21 87 255 / .2); font-size: 13px; font-weight: 600; color: var(--brand); }
.achip:hover { background: var(--brand); color: #fff; }
.achip--clear { background: transparent; box-shadow: none; color: var(--muted); text-decoration: underline; }
.achip--clear:hover { background: transparent; color: #dc2626; }

#results .product-grid { margin-top: 18px; }

/* ---------- List view ---------- */
.product-grid--list { grid-template-columns: 1fr !important; }
.product-grid--list .pcard { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) {
  .product-grid--list .pcard { grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
  .product-grid--list .pcard__media { aspect-ratio: 4 / 3; height: 100%; }
  .product-grid--list .pcard__body { padding: 4px 4px 4px 0; }
  .product-grid--list .pcard__actions { max-width: 380px; }
  .product-grid--list .pcard__details { justify-content: flex-start; }
}
@media (min-width: 1280px) { .product-grid--list .pcard { grid-template-columns: 260px 1fr; } }

/* ---------- Load more ---------- */
.load-more { display: grid; justify-items: center; gap: 10px; margin-top: 32px; text-align: center; }
.load-more[hidden] { display: none; }
.load-more p { font-size: 13.5px; color: var(--muted); }
.load-more__bar { width: 220px; height: 4px; overflow: hidden; border-radius: 4px; background: var(--line); }
.load-more__bar span { display: block; height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s; }
.load-more .btn[hidden] { display: none; }

/* ---------- Help banner ---------- */
.help-banner { display: grid; gap: 16px; margin-top: 40px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.help-banner__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r); background: var(--brand-50); color: var(--brand); }
.help-banner h2 { font-size: 17px; font-weight: 800; }
.help-banner p { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.help-banner__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 768px) {
  .help-banner { grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 24px 28px; }
  .help-banner__actions { display: flex; }
}

/* ==========================================================================
   Product details
   ========================================================================== */
.pdp-skeleton { display: grid; gap: 24px; margin-top: 40px; }
.pdp-skeleton span { display: block; height: 320px; border-radius: var(--r-xl); background: linear-gradient(90deg, var(--canvas), #eef1f6, var(--canvas)); }
@media (min-width: 1024px) { .pdp-skeleton { grid-template-columns: 1fr 1fr; } }

/* Gallery */
.gallery { display: grid; gap: 12px; }
@media (min-width: 1024px) { .gallery { position: sticky; top: 20px; align-self: start; } }
.gallery__main { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-xl); background: var(--canvas); cursor: zoom-in; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery__main:hover img { transform: scale(1.03); }
.gallery__main .tag-sample { position: absolute; left: 16px; top: 16px; padding: 4px 10px; font-size: 12px; }
.gallery__zoom { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: rgb(255 255 255 / .92); color: var(--ink); box-shadow: var(--shadow-card); }
.gallery__thumbs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.gallery__thumbs button { width: 84px; height: 64px; flex-shrink: 0; overflow: hidden; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); opacity: .7; transition: opacity .2s, box-shadow .2s; }
.gallery__thumbs button[aria-current] { opacity: 1; box-shadow: 0 0 0 2px var(--brand); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* Info column */
.pinfo .pdp__brand { display: inline-block; }
.pinfo .pdp__brand:hover { text-decoration: underline; }
.pdp__meta a { color: var(--brand); }
.pdp__meta dd { display: inline-flex; align-items: center; gap: 6px; }
.copy-btn { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--muted); }
.copy-btn:hover { background: var(--canvas); color: var(--brand); }
.highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.highlights li { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.highlights small { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.highlights b { display: block; margin-top: 2px; font-size: 14px; }
.add-panel__top span { display: inline-flex; align-items: center; gap: 5px; }
.add-panel__alt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.add-panel__alt .add-panel__wa { margin-top: 0; }
.add-panel__alt button.add-panel__wa .icon { color: var(--brand); }
.add-panel__alt button.add-panel__wa:hover { border-color: var(--brand); color: var(--brand); }
.trust { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 640px) { .trust { grid-template-columns: repeat(3, 1fr); } }
.trust li { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.trust .icon { flex-shrink: 0; color: var(--brand); }
.trust b { display: block; font-size: 13px; color: var(--ink); }

/* Tabs extras */
.ptabs__list { overflow-x: auto; scrollbar-width: none; }
.ptabs__list::-webkit-scrollbar { display: none; }
.ptab { flex-shrink: 0; white-space: nowrap; }
.ptabs__h { font-size: 20px; font-weight: 800; }

/* Custom raw HTML in product description */
.desc__custom-html { margin-top: 24px; line-height: 1.7; color: var(--ink); }
.desc__custom-html > *:first-child { margin-top: 0; }
.desc__custom-html p { margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.desc__custom-html h3 { margin-top: 28px; margin-bottom: 12px; font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.desc__custom-html h4 { margin-top: 20px; margin-bottom: 8px; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.desc__custom-html ul, .desc__custom-html ol { margin-top: 12px; padding-left: 24px; color: var(--muted); }
.desc__custom-html li { margin-bottom: 6px; font-size: 14.5px; }
.desc__custom-html table { width: 100%; margin-top: 20px; border-collapse: collapse; border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.desc__custom-html th, .desc__custom-html td { padding: 12px 16px; border: 1px solid var(--line); text-align: left; }
.desc__custom-html th { background: var(--canvas); font-weight: 700; color: var(--ink); }
.desc__custom-html blockquote { margin-top: 20px; padding: 16px 20px; border-left: 4px solid var(--brand); background: var(--canvas); border-radius: 0 var(--r) var(--r) 0; font-style: italic; color: var(--muted); }
.desc__custom-html img { max-width: 100%; height: auto; border-radius: var(--r-lg); margin-top: 16px; }
.qsteps { display: grid; gap: 12px; margin-top: 18px; counter-reset: q; }
.qsteps li { position: relative; display: grid; gap: 2px; padding: 14px 16px 14px 58px; border: 1px solid var(--line); border-radius: var(--r); }
.qsteps li::before { counter-increment: q; content: counter(q); position: absolute; left: 16px; top: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; }
.qsteps b { font-size: 15px; }
.qsteps span { font-size: 14px; line-height: 1.6; color: var(--muted); }
.qinfo { display: grid; gap: 12px; margin-top: 20px; }
@media (min-width: 768px) { .qinfo { grid-template-columns: repeat(3, 1fr); } }
.qinfo div { display: flex; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--canvas); }
.qinfo .icon { flex-shrink: 0; color: var(--brand); }
.qinfo p { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.qinfo b { display: block; font-size: 14px; color: var(--ink); }
.pdp__note a { color: var(--brand); text-decoration: underline; }

/* Related / recent */
.related__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.related[hidden] { display: none; }

/* Sticky add bar (phones/tablets only) */
.sticky-add {
  position: fixed; inset: auto 0 0; z-index: 45; display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgb(255 255 255 / .97); box-shadow: 0 -8px 24px rgb(11 22 48 / .08); backdrop-filter: blur(6px);
  transform: translateY(110%); transition: transform .3s var(--ease);
}
.sticky-add.is-visible { transform: none; }
.sticky-add__info { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.sticky-add__info img { width: 44px; height: 40px; flex-shrink: 0; border-radius: 8px; object-fit: cover; }
.sticky-add__info span { min-width: 0; }
.sticky-add__info b, .sticky-add__info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-add__info b { font-size: 13.5px; }
.sticky-add__info small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 420px) { .sticky-add__info img { display: none; } }
@media (min-width: 1024px) { .sticky-add { display: none; } }
@media (max-width: 1023px) {
  body.has-sticky-add .assist-launch { bottom: 84px; }
  body.has-sticky-add .toast { bottom: 150px; }
}

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgb(6 12 28 / .9); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1200px, 100%); max-height: 88vh; border-radius: var(--r); object-fit: contain; }
.lightbox__close { position: absolute; right: 16px; top: 16px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: rgb(255 255 255 / .12); color: #fff; }
.lightbox__close:hover { background: rgb(255 255 255 / .22); }

@media (max-width: 639px) {
  .catalog { padding-top: 20px; }
  .hero-search { margin-top: 18px; }
  .hero-search .btn { padding: 0 16px; }
  .highlights li { padding: 10px 12px; }
  .gallery__main { border-radius: var(--r-lg); }
  .related__head .link-arrow { font-size: 13px; }
}
