:root {
  color-scheme: light;
  --accent: #e44542;
  --accent-dark: #c83230;
  --ink: #111111;
  --muted: #6f6f6f;
  --line: #dfdfdf;
  --soft: #f5f5f4;
  --paper: #ffffff;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 24px 70px rgba(24, 24, 24, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f2f2f0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% 4%, rgba(228, 69, 66, 0.1), transparent 25rem),
    #f2f2f0;
}

button, input, select { font: inherit; }
button, select, input { -webkit-tap-highlight-color: transparent; }

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; }
.brand img { display: block; width: 128px; height: auto; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 650;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(228, 69, 66, 0.11);
}

.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}
.site-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }
.site-cta:focus-visible { outline: 3px solid rgba(228, 69, 66, 0.28); outline-offset: 3px; }
.site-cta-compact { min-height: 44px; padding-inline: 16px; }

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 48px;
  align-items: end;
  padding: 56px 0 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 780px;
  margin-bottom: 16px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.demo-notice {
  display: grid;
  gap: 7px;
  padding: 20px 22px;
  border: 1px solid rgba(228, 69, 66, 0.25);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(12px);
}

.demo-notice strong { color: var(--accent-dark); }
.demo-notice span { color: #676767; font-size: 13px; line-height: 1.5; }
.live-notice { border-color: rgba(34, 133, 75, 0.25); }
.live-notice strong { color: #1d7a43; }

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.8fr);
  align-items: start;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.calculator-form { padding: 42px; }
.form-section { display: grid; gap: 30px; }

.section-heading {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
}

.section-heading > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.section-heading h2 { margin: 0 0 5px; font-size: 22px; letter-spacing: -0.02em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 14px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
}

.field { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field[hidden] { display: none; }
.field-wide { grid-column: 1 / -1; }

.field-label {
  color: #3c3c3c;
  font-size: 13px;
  font-weight: 700;
}

select,
input[type="number"] {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select {
  appearance: none;
  padding: 0 46px 0 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 8 4 4 4-4' stroke='%23111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

input[type="number"] { padding: 0 16px; font-size: 18px; font-weight: 750; }
select:focus, input[type="number"]:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.07); }

.catalog-product-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--soft);
}
.catalog-product-info > div { display: grid; gap: 4px; }
.catalog-product-info span { color: var(--muted); font-size: 12px; }
.catalog-product-info strong { font-size: 17px; }
.catalog-product-info a { color: var(--ink); font-size: 12px; font-weight: 750; text-underline-offset: 3px; }
.catalog-product-info a:hover { color: var(--accent); }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -10px; }
.preset-row button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #5f5f5f;
  cursor: pointer;
}
.preset-row button:hover,
.preset-row button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }

.segment-field { align-content: start; }
.segments {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 4px;
  border-radius: 14px;
  background: var(--soft);
}
.segments-four { grid-template-columns: repeat(4, 1fr); }
.segments-five { grid-template-columns: repeat(5, 1fr); }
.segments label { cursor: pointer; }
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments span {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: 11px;
  color: #646464;
  font-size: 14px;
  font-weight: 700;
}
.segments input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.09); }
.segments input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.form-divider { height: 1px; margin: 38px 0; background: var(--line); }
.form-error { margin: -8px 0 0; color: #b52320; font-size: 13px; }

.result-card {
  position: sticky;
  top: 20px;
  min-height: 100%;
  padding: 32px;
  background: var(--ink);
  color: #fff;
}

.result-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.result-topline p { margin: 0; color: #bdbdbd; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.result-topline span { padding: 7px 10px; border-radius: 999px; background: rgba(228, 69, 66, 0.18); color: #ff7976; font-size: 12px; font-weight: 750; }

.bag-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 144px;
  height: 176px;
  margin: 38px auto 14px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 5px 5px 13px 13px;
  background: linear-gradient(145deg, rgba(255,255,255,0.25), rgba(255,255,255,0.08));
  box-shadow: inset 0 0 24px rgba(255,255,255,0.07), 0 20px 44px rgba(0,0,0,0.24);
  transition: width 180ms ease, border-radius 180ms ease;
}
.bag-preview[data-type="slider"] { width: 154px; border-radius: 7px; }
.bag-preview[data-type="ziplock"] { width: 128px; border-radius: 4px 4px 11px 11px; }
.bag-handle { position: absolute; top: 14px; width: 50px; height: 14px; border: 1px solid rgba(255,255,255,0.75); border-radius: 999px; }
.bag-preview:not([data-type="pvd"]) .bag-handle { display: none; }
.bag-slider { display: none; position: absolute; top: 14px; left: 0; right: 0; height: 5px; background: rgba(255,255,255,0.62); }
.bag-slider i { position: absolute; right: 20px; top: -3px; width: 18px; height: 11px; border-radius: 2px; background: var(--accent); }
.bag-preview[data-type="slider"] .bag-slider,
.bag-preview[data-type="ziplock"] .bag-slider { display: block; }
.bag-preview[data-type="ziplock"] .bag-slider i { display: none; }
.bag-brand { color: #fff; font-size: 13px; font-weight: 900; letter-spacing: 0.08em; line-height: 1.05; text-align: center; }
.preview-caption { display: grid; gap: 4px; margin-bottom: 28px; text-align: center; }
.preview-caption strong { font-size: 14px; }
.preview-caption span { color: #999; font-size: 12px; }

.price-block { display: grid; gap: 7px; padding-bottom: 25px; border-bottom: 1px solid #343434; }
.price-block > span { color: #a8a8a8; font-size: 13px; }
.price-block strong { font-size: clamp(36px, 4vw, 50px); line-height: 1; letter-spacing: -0.045em; }
.price-block small { color: #d0d0d0; font-size: 14px; }
.result-card.is-custom .price-block strong { max-width: 100%; font-size: clamp(30px, 4vw, 42px); }

.breakdown { display: grid; gap: 12px; margin: 22px 0; }
.breakdown div { display: flex; justify-content: space-between; gap: 20px; }
.breakdown dt { color: #9e9e9e; font-size: 13px; }
.breakdown dd { margin: 0; font-size: 13px; font-weight: 700; }
.order-summary { margin: 0 0 12px; color: #ededed; font-size: 13px; line-height: 1.55; }
.size-note { margin: 0 0 14px; padding: 11px 12px; border-radius: 10px; background: rgba(228, 69, 66, 0.14); color: #ff9a97; font-size: 11px; line-height: 1.5; }
.legal-note {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(228, 69, 66, 0.34);
  border-radius: 11px;
  background: rgba(228, 69, 66, 0.13);
  color: #ff8d89;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}
.wholesale-contact[hidden] { display: none; }
.wholesale-contact { margin-top: 12px; }
.wholesale-contact summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  transition: background 160ms ease, transform 160ms ease;
}
.wholesale-contact summary::-webkit-details-marker { display: none; }
.wholesale-contact summary::after { content: "+"; font-size: 22px; font-weight: 500; line-height: 1; }
.wholesale-contact[open] summary::after { content: "−"; }
.wholesale-contact summary:hover { background: #f0524f; }
.wholesale-contact summary:active { transform: translateY(1px); }
.wholesale-contact summary:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.7); outline-offset: 3px; }
.contact-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 9px; }
.contact-options a {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #3b3b3b;
  border-radius: 11px;
  background: #191919;
  color: #fff;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.contact-options a:hover { border-color: #777; background: #222; }
.contact-options a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.contact-options strong { overflow-wrap: anywhere; font-size: 13px; }
.contact-options span { overflow-wrap: anywhere; color: #9d9d9d; font-size: 11px; line-height: 1.35; }
.contact-options .contact-email { grid-column: 1 / -1; }
.reset-button { width: 100%; min-height: 48px; margin-top: 22px; border: 1px solid #414141; border-radius: 13px; background: transparent; color: #d7d7d7; cursor: pointer; }
.reset-button:hover { border-color: #fff; color: #fff; }

.formula-section {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 40px;
  align-items: center;
  padding: 76px 0;
}
.formula-section h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.formula-list { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.formula-list span,
.formula-list a { padding: 11px 14px; border: 1px solid #d8d8d6; border-radius: 999px; background: rgba(255,255,255,0.62); color: var(--ink); font-size: 13px; text-decoration: none; }
.formula-list a:hover { border-color: var(--ink); }
.formula-list b { color: var(--accent); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 34px;
  border-top: 1px solid #d8d8d6;
  color: #747474;
  font-size: 13px;
}
.footer-cta { flex: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 36px; }
  .calculator-shell { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .formula-section { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .header-label { display: none; }
}

@media (max-width: 600px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 76px; }
  .brand img { width: 102px; }
  .site-cta-compact { min-height: 42px; padding-inline: 13px; font-size: 12px; }
  .hero { padding: 35px 2px 24px; }
  h1 { font-size: 44px; }
  .intro { font-size: 16px; }
  .calculator-shell { border-radius: 22px; }
  .calculator-form { padding: 26px 20px 30px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .preset-row { margin-top: -8px; }
  .preset-row button { flex: 1 0 auto; }
  .catalog-product-info { align-items: flex-start; flex-direction: column; }
  .result-card { padding: 28px 22px; }
  .price-block strong { font-size: 42px; }
  .formula-section { padding: 58px 2px; }
  footer { flex-direction: column; }
  .footer-cta { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
