/* ==========================================================================
   PERFECTOO PROTECTOR — FEATURED PRODUCTS  (v2: showcase layout)
   The first product becomes a dark "screen" hero card spanning the full row;
   the rest sit in a clean three-column gallery. Pure CSS: the HTML is the
   same as before, so Jinja and the product-detail JS are untouched.
   Every selector is scoped to .featured-products.
   ========================================================================== */

/* ---------- 1. Tokens (same as other sections; move to :root later) ---------- */
.featured-products {
  --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 ---------- */
.featured-products {
  position: relative; overflow: hidden;
  padding: clamp(56px, 8vw, 120px) clamp(20px, 5vw, 80px);
  background:
    radial-gradient(45% 45% at 0% 0%, var(--accent-soft) 0%, transparent 70%),
    #FFFFFF;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.featured-products *, .featured-products *::before, .featured-products *::after { box-sizing: border-box; }
.featured-products .section-inner { max-width: 1360px; margin: 0 auto; }

/* ---------- 3. Header ---------- */
.featured-products .featured-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .875rem; font-weight: 600; color: var(--accent);
}
.featured-products .featured-eyebrow-dot { width: 22px; height: 2px; border-radius: 2px; background: var(--accent); }
.featured-products .featured-heading-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 5vw, 96px); align-items: end; margin-top: 22px;
}
.featured-products .featured-heading-main h2 {
  margin: 0; max-width: 14ch;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 5.4vw, 4.8rem); line-height: .98; letter-spacing: -.045em;
  text-wrap: balance;
}
.featured-products .featured-heading-main p {
  margin: 22px 0 0; max-width: 52ch;
  font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.7; color: var(--ink-2);
  text-wrap: pretty;
}
.featured-products .featured-heading-aside {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 10px 22px 10px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
}
.featured-products .featured-aside-number {
  display: grid; place-items: center; min-width: 52px; height: 52px; padding: 0 12px; border-radius: 999px;
  background: var(--accent); color: #fff; font: 800 1.2rem/1 var(--font-display);
}
.featured-products .featured-aside-label { font-size: .8125rem; font-weight: 500; line-height: 1.3; color: var(--ink-2); }
.featured-products .featured-header-line { display: none; }

/* ---------- 4. Grid ---------- */
.featured-products .featured-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: clamp(32px, 4.5vw, 64px);
}

/* ---------- 5. Standard card ---------- */
.featured-products .product-card {
  margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden;
  transition: transform .45s var(--ease), border-color .45s var(--ease), box-shadow .45s var(--ease), background-color .45s var(--ease);
}
.featured-products .product-card:hover {
  transform: translateY(-4px); background: var(--surface); border-color: var(--accent);
  box-shadow: 0 40px 60px -40px rgba(6,50,58,.5);
}
.featured-products .product-card-link {
  display: flex; flex-direction: column; flex: 1; padding: 10px;
  color: inherit; text-decoration: none; border-radius: inherit;
}
.featured-products .product-card-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Media */
.featured-products .product-card-media {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 4 / 3.2; border-radius: calc(var(--r-xl) - 10px);
  background:
    radial-gradient(70% 70% at 70% 15%, #fff 0%, transparent 65%),
    linear-gradient(180deg, var(--bg-tint) 0%, #D3E3EC 100%);
}
.featured-products .product-card-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease);
}
.featured-products .product-card:hover .product-card-media img { transform: scale(1.05); }
.featured-products .product-card-media::after { /* glass reflection */
  content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.18) 26%, transparent 26.2%);
}
.featured-products .product-media-topline {
  position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.featured-products .product-media-topline > span:first-child,
.featured-products .product-media-index {
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.7);
  font-size: .75rem; font-weight: 600; color: var(--ink-2);
}
.featured-products .product-media-index { position: absolute; z-index: 2; left: 12px; bottom: 12px; }
.featured-products .product-media-index span { color: var(--accent); }
.featured-products .product-media-arrow,
.featured-products .product-card-open {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--accent); font-size: .95rem;
  transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.featured-products .product-card:hover .product-media-arrow,
.featured-products .product-card:hover .product-card-open {
  background: var(--accent); color: #fff; transform: translate(2px, -2px);
}

/* Placeholder */
.featured-products .media-placeholder {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff;
  background:
    radial-gradient(60% 70% at 70% 20%, rgba(120,220,230,.35) 0%, transparent 60%),
    linear-gradient(160deg, var(--deep-2) 0%, var(--deep) 100%);
}
.featured-products .media-placeholder-mark {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: #fff; color: var(--accent); font: 800 1.1rem/1 var(--font-display);
  box-shadow: 0 0 0 8px rgba(255,255,255,.14);
}
.featured-products .media-placeholder-text { font-size: .8125rem; font-weight: 500; color: rgba(255,255,255,.75); }

/* Body */
.featured-products .product-card-body { display: flex; flex-direction: column; flex: 1; gap: 14px; padding: 20px 14px 14px; }
.featured-products .product-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.featured-products .product-card-heading h3 {
  margin: 0; min-width: 0;
  font: 800 clamp(1.25rem, 1.6vw, 1.45rem)/1.12 var(--font-display); letter-spacing: -.03em;
  color: var(--ink); overflow-wrap: anywhere;
}
.featured-products .product-card-open { background: var(--surface); border: 1px solid var(--line); }
.featured-products .product-card-desc {
  margin: 0; font-size: .9375rem; line-height: 1.65; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.featured-products .product-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.featured-products .tag {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: .75rem; font-weight: 600; color: var(--ink-2);
}
.featured-products .tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tag-color, var(--accent)); }
.featured-products .product-price {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--font-display);
}
.featured-products .price-old { font-size: .9rem; font-weight: 500; color: var(--ink-3); text-decoration: line-through; }
.featured-products .price-new, .featured-products .price-current {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--accent);
}

/* ---------- 6. Hero card: the first product, a dark screen ---------- */
.featured-products .product-card:first-child {
  grid-column: 1 / -1; position: relative; isolation: isolate;
  background:
    radial-gradient(50% 70% at 90% 0%, rgba(120,220,230,.28) 0%, transparent 60%),
    linear-gradient(160deg, var(--deep-2) 0%, var(--deep) 55%, var(--deep-3) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 4px rgba(16,32,44,.05), 0 70px 100px -60px rgba(6,50,58,.8);
}
.featured-products .product-card:first-child::before { /* glass reflection */
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,.07) 42%, transparent 42.2%);
}
.featured-products .product-card:first-child:hover { background:
    radial-gradient(50% 70% at 90% 0%, rgba(120,220,230,.34) 0%, transparent 60%),
    linear-gradient(160deg, var(--deep-2) 0%, var(--deep) 55%, var(--deep-3) 100%);
  border-color: transparent; transform: translateY(-4px);
}
.featured-products .product-card:first-child .product-card-link {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(8px, 2vw, 28px);
}
.featured-products .product-card:first-child .product-card-media { aspect-ratio: auto; min-height: clamp(300px, 34vw, 460px); }
.featured-products .product-card:first-child .product-card-body {
  justify-content: space-between; gap: 22px; padding: clamp(18px, 3vw, 40px) clamp(14px, 3vw, 40px) clamp(14px, 3vw, 36px) 8px;
}
.featured-products .product-card:first-child .product-card-body::before {
  content: "Featured pick"; align-self: flex-start;
  padding: 6px 14px 6px 28px; border-radius: 999px;
  background: radial-gradient(circle at 14px 50%, var(--signal) 0 4px, transparent 5px), rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .8125rem; font-weight: 600; color: rgba(255,255,255,.9);
}
.featured-products .product-card:first-child .product-card-heading { order: 0; }
.featured-products .product-card:first-child .product-card-heading h3 {
  color: #fff; font-size: clamp(1.9rem, 3.6vw, 3.2rem); line-height: 1; letter-spacing: -.04em;
}
.featured-products .product-card:first-child .product-card-open { background: #fff; border-color: transparent; }
.featured-products .product-card:first-child:hover .product-card-open { background: var(--signal); color: var(--deep); }
.featured-products .product-card:first-child .product-card-desc {
  color: rgba(255,255,255,.76); font-size: 1.0625rem; -webkit-line-clamp: 4;
}
.featured-products .product-card:first-child .tag {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.9);
}
.featured-products .product-card:first-child .product-price { border-top-color: rgba(255,255,255,.2); }
.featured-products .product-card:first-child .price-old { color: rgba(255,255,255,.55); }
.featured-products .product-card:first-child .price-new,
.featured-products .product-card:first-child .price-current { color: #fff; font-size: 1.6rem; }

/* ---------- 7. Footer row ---------- */
.featured-products .featured-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px;
  margin-top: clamp(32px, 4.5vw, 56px); padding-top: 22px; border-top: 1px solid var(--line);
}
.featured-products .featured-bottom-note {
  display: inline-flex; align-items: center; gap: 12px; font-size: .9rem; font-weight: 500; color: var(--ink-2);
}
.featured-products .featured-bottom-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.featured-products .section-cta { margin: 0; }
.featured-products .section-cta .btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 54px; padding: 8px 8px 8px 24px; border-radius: 999px;
  background: var(--accent); color: #fff; border: 0;
  font: 600 .9375rem/1 var(--font-body); text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(10,107,120,.7); transition: background-color .25s var(--ease);
}
.featured-products .section-cta .btn:hover { background: var(--accent-hover); }
.featured-products .section-cta .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.featured-products .featured-btn-arrow {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.18); transition: transform .3s var(--ease);
}
.featured-products .section-cta .btn:hover .featured-btn-arrow { transform: translate(2px, -2px); }

/* ---------- 8. Responsive ---------- */
@media (max-width: 1100px) {
  .featured-products .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .featured-products .featured-heading-row { grid-template-columns: 1fr; align-items: start; }
  .featured-products .featured-heading-aside { justify-self: start; }
  .featured-products .product-card:first-child .product-card-link { grid-template-columns: 1fr; }
  .featured-products .product-card:first-child .product-card-media { min-height: 0; aspect-ratio: 4 / 3; }
  .featured-products .product-card:first-child .product-card-body { padding: 20px 14px 14px; }
}
@media (max-width: 620px) {
  .featured-products .featured-grid { grid-template-columns: 1fr; }
  .featured-products .product-card { border-radius: 26px; }
  .featured-products .product-card-media { border-radius: 18px; }
  .featured-products .featured-bottom { flex-direction: column; align-items: stretch; }
  .featured-products .section-cta .btn { width: 100%; }
}

/* ---------- 9. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .featured-products .product-card, .featured-products .product-card-media img,
  .featured-products .product-media-arrow, .featured-products .product-card-open,
  .featured-products .featured-btn-arrow, .featured-products .section-cta .btn { transition: none; }
  .featured-products .product-card:hover, .featured-products .product-card:first-child:hover,
  .featured-products .product-card:hover .product-card-media img,
  .featured-products .product-card:hover .product-media-arrow,
  .featured-products .product-card:hover .product-card-open { transform: none; }
}