/* ==========================================================================
   PERFECTOO PROTECTOR — PRODUCTS PAGE  (page shell, header, search + filters)
   Light and calm, same system as the home sections. The tokens for the whole
   page live here; product_grid.css and product_card.css inherit them because
   they only style things inside .products-page.
   ========================================================================== */

/* ---------- 1. Tokens (same as other sections; move to :root later) ---------- */
.products-page {
  --bg:#F2F6F9; --bg-tint:#E4EEF4; --surface:#FFFFFF;
  --ink:#10202C; --ink-2:#46586A; --ink-3:#7A8B9A; --line:#D5E1EA;
  --accent:#0A6B78; --accent-hover:#085862; --accent-soft:#D8EEF0; --signal:#E8A33D;
  --deep:#06323A; --deep-2:#0A5560; --deep-3:#04222A;
  --font-display:"Bricolage Grotesque","Segoe UI",system-ui,sans-serif;
  --font-body:"Instrument Sans","Segoe UI",system-ui,sans-serif;
  --r-lg:26px; --r-xl:34px;
  --ease:cubic-bezier(.2,.7,.2,1);
}

/* ---------- 2. Shell ---------- */
.products-page {
  position: relative; overflow: hidden;
  padding: clamp(48px, 7vw, 104px) clamp(20px, 5vw, 80px) clamp(64px, 8vw, 128px);
  background:
    radial-gradient(45% 40% at 0% 0%, var(--accent-soft) 0%, transparent 70%),
    #FFFFFF;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.products-page *, .products-page *::before, .products-page *::after { box-sizing: border-box; }
.products-page .section-inner { max-width: 1360px; margin: 0 auto; }

/* ---------- 3. Header ---------- */
.products-page .section-header {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(24px, 5vw, 96px); align-items: end;
}
.products-page .section-header h1 {
  margin: 0; max-width: 10ch;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.8rem, 6.4vw, 5.8rem); line-height: .95; letter-spacing: -.05em;
  text-wrap: balance;
}
.products-page .section-header h1::before { /* teal line, same mark as the eyebrows */
  content: ""; display: block; width: 22px; height: 2px; margin-bottom: 24px;
  border-radius: 2px; background: var(--accent);
}
.products-page .section-header p {
  margin: 0; max-width: 46ch;
  font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.7; color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- 4. Toolbar: search + filters in one bar ---------- */
.products-page .products-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-top: clamp(32px, 4.5vw, 64px); padding: 8px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
}
.products-page .search-form {
  display: flex; align-items: center; flex: 1; min-width: 0; gap: 8px;
  padding: 5px 5px 5px 0; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.products-page .search-form:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.products-page .search-form input[type="search"] {
  flex: 1; min-width: 0; height: 46px; padding: 0 12px 0 50px;
  border: 0; outline: 0; background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2346586A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 20px 50%;
  font: 500 1rem/1 var(--font-body); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.products-page .search-form input[type="search"]::placeholder { color: var(--ink-3); }
.products-page .search-form input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.products-page .search-form .btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff;
  font: 600 .9375rem/1 var(--font-body);
  box-shadow: 0 8px 20px -10px rgba(10,107,120,.8);
  transition: background-color .25s var(--ease);
}
.products-page .search-form .btn:hover { background: var(--accent-hover); }
.products-page .search-form .btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.products-page .filters { display: flex; align-items: center; gap: 10px; flex: none; }
.products-page .filters select {
  height: 56px; min-width: 170px; padding: 0 46px 0 22px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A6B78' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center;
  font: 600 .9375rem/1 var(--font-body); color: var(--ink);
  -webkit-appearance: none; appearance: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.products-page .filters select:hover { border-color: var(--accent); }
.products-page .filters select:focus-visible { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Results area (JS may toggle a loading class while it swaps the grid) */
.products-page #product-grid-container {
  margin-top: clamp(28px, 4vw, 52px);
  transition: opacity .25s var(--ease);
}
.products-page #product-grid-container.is-loading,
.products-page #product-grid-container.loading { opacity: .45; pointer-events: none; }

/* ---------- 5. Responsive ---------- */
@media (max-width: 900px) {
  .products-page .section-header { grid-template-columns: 1fr; align-items: start; }
  .products-page .products-toolbar { flex-direction: column; align-items: stretch; border-radius: var(--r-lg); }
  .products-page .filters { flex-wrap: wrap; }
  .products-page .filters select { flex: 1; min-width: 150px; }
}
@media (max-width: 480px) {
  .products-page .search-form .btn { padding: 0 20px; }
  .products-page .filters select { width: 100%; flex-basis: 100%; }
}

/* ---------- 6. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .products-page .search-form, .products-page .search-form .btn,
  .products-page .filters select, .products-page #product-grid-container { transition: none; }
}