/* 1. Variables */
:root {
  --primary: #5B5FEF;
  --secondary: #7B61FF;
  --blue: #4F63F5;
  --dark: #17213D;
  --muted: #6F7892;
  --orange: #FF7A3D;
  --lavender: #F1F0FF;
  --pink: #F3A6C7;
  --bg: #FAFAFF;
  --white: #FFFFFF;
  --border: #E8E8F5;
  --gutter: clamp(16px, 3vw, 48px);
}

/* 2. Reset */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* 3. Global */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.container { max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 8px; }

/* 4. Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); }
.nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-block: 22px; padding-inline: calc(var(--gutter) + clamp(0px, 2.8vw, 44px));
}
.logo {
  justify-self: start; font-size: 26px; font-weight: 800; letter-spacing: -.04em;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 5. Navigation */
.nav-links { display: flex; gap: 36px; }
.nav-links a { position: relative; font-size: 14px; font-weight: 500; padding-block: 4px; transition: color .25s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.nav-actions { justify-self: end; display: flex; align-items: center; gap: 18px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; transition: all .25s ease; }
.icon-btn--soft { background: var(--lavender); border: 1px solid var(--border); }
.icon-btn:hover { color: var(--primary); }
.badge {
  position: absolute; top: -2px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 9px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 600;
}
.btn-quote {
  padding: 11px 24px; border-radius: 999px; color: #fff; font-size: 14px; font-weight: 600;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 6px 16px rgba(91,95,239,.25); transition: all .25s ease;
}
.btn-quote:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(91,95,239,.35); }
.nav-toggle { display: none; justify-self: end; width: 40px; height: 40px; place-items: center; border-radius: 12px; }

/* 6. Hero */
.category-hero {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  min-height: 300px; padding: 0 clamp(24px, 4.5vw, 68px); overflow: hidden;
  border-radius: 24px; border: 1px solid #F0EFFB;
  background: linear-gradient(100deg, #FBFBFF 0%, #F6F6FF 45%, #EEF0FF 100%);
}
.hero-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--orange); margin-bottom: 6px; }
.category-hero h1 { font-size: clamp(44px, 4.4vw, 60px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.back-to-products {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 42px;
  padding: 11px 22px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(241, 240, 255, .9);
  font-size: 16px;
  font-weight: 600;
  transition: transform .25s ease, background-color .25s ease;
}
.back-to-products svg { width: 20px; height: 20px; }
.back-to-products:hover { transform: translateX(-3px); background: #e8e6ff; }
.hero-art { position: relative; justify-self: end; width: min(560px, 100%); height: 300px; }
.hero-art img { position: absolute; z-index: 2; left: 50%; top: 50%; width: 470px; height: auto; max-width: none; transform: translate(-46%, -50%); filter: drop-shadow(0 18px 20px rgba(91,95,239,.18)); }
.blob { position: absolute; }
.blob--lavender { left: 0; top: 34%; width: 240px; height: 190px; border-radius: 48% 52% 55% 45%; background: linear-gradient(135deg, rgba(123,97,255,.14), rgba(91,95,239,.08)); }
.blob--pink { right: 6%; top: 8%; width: 130px; height: 190px; border-radius: 55% 45% 50% 50%; background: linear-gradient(160deg, rgba(243,166,199,.55), rgba(243,166,199,.25)); }

/* 7. Product grid */
.products-section { padding-block: 32px 56px; }
.products-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }

/* 8. Product cards */
.product-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(91,95,239,.04); transition: all .25s ease;
}
.product-card a { display: block; }
.product-media { display: grid; place-items: center; aspect-ratio: 5 / 4; padding: 6%; background: #F4F4FF; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.product-title { padding: 20px 22px 24px; font-size: 17px; font-weight: 700; color: var(--dark); }

/* 9. Hover states */
.product-card:hover, .product-card:focus-within { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(91,95,239,.12); }
.product-card:hover img { transform: scale(1.03); }
.catalog-card--clickable { cursor: pointer; }

/* 10. Responsive */
@media (max-width: 1200px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 960px)  { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .nav { grid-template-columns: 1fr auto; padding-block: 14px; padding-inline: var(--gutter); }
  .nav-toggle { display: grid; grid-column: 2; grid-row: 1; }
  .nav-actions { grid-column: 1 / -1; grid-row: 3; justify-self: start; padding-block: 12px 4px; display: none; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; display: none; flex-direction: column; gap: 6px; padding-top: 10px; }
  .nav-links a { display: inline-block; padding-block: 8px; font-size: 16px; }
  .nav.open .nav-links, .nav.open .nav-actions { display: flex; }
  .category-hero { grid-template-columns: 1fr; min-height: auto; padding: 40px 24px 0; }
  .hero-art { justify-self: center; width: 100%; height: 260px; }
  .hero-art img { width: min(420px, 110%); }
  .blob--lavender { left: 4%; width: 44%; }
}
@media (max-width: 680px) {
  .back-to-products { margin-bottom: 28px; font-size: 14px; }
}
@media (max-width: 680px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-title { padding: 14px 16px 18px; font-size: 15px; }
}
@media (max-width: 420px) { .products-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Caps catalog uses five cards per row on desktop. */
.products-section .products-grid { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 680px) {
  .products-section .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .products-section .products-grid { grid-template-columns: 1fr; }
}
