:root {
    --navy: #17234c;
    --navy-deep: #0c1434;
    --blue: #1675b9;
    --cyan: #65b8d0;
    --ink: #15213b;
    --muted: #64718a;
    --line: #dfe6ed;
    --soft: #f3f6f9;
    --white: #fff;
    --green: #157a68;
    --red: #b53d50;
    --shadow: 0 22px 60px rgba(18, 31, 65, .12);
    --radius: 22px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f7f9fb;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 80% -10%, #dceff5 0, transparent 30%), #f7f9fb; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }

.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(3px); pointer-events: none; }
.ambient-one { width: 24rem; height: 24rem; right: -13rem; top: 18%; background: rgba(103, 188, 210, .12); }
.ambient-two { width: 18rem; height: 18rem; left: -11rem; bottom: -5rem; background: rgba(28, 79, 155, .09); }

.site-header { height: 76px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgba(23,35,76,.08); background: rgba(247,249,251,.88); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; text-decoration: none; gap: 15px; }
.brand img { width: 128px; height: auto; }
.brand-divider { width: 1px; height: 28px; background: var(--line); }
.brand > span:last-child { display: grid; line-height: 1; letter-spacing: .16em; }
.brand strong { font-size: 13px; }
.brand small { margin-top: 5px; font-size: 8px; color: var(--muted); letter-spacing: .19em; }
.header-meta { display: flex; align-items: center; gap: 16px; }
.deadline-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.deadline-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(101,184,208,.14); }
.basket-button { border: 0; background: var(--navy); color: white; height: 42px; border-radius: 999px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 15px; cursor: pointer; transition: transform .2s, background .2s; }
.basket-button:hover { transform: translateY(-1px); background: #223361; }
.basket-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.basket-button span { font-size: 12px; font-weight: 700; }
.basket-button b { min-width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); background: white; font-size: 11px; }

.app-shell { min-height: calc(100vh - 76px); max-width: 1500px; margin: auto; padding: clamp(22px, 3.4vh, 46px) clamp(20px, 4vw, 64px) 30px; }
.loading-state { min-height: 60vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loader { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.home-view { height: calc(100vh - 130px); min-height: 590px; display: grid; grid-template-rows: auto 1fr auto; gap: clamp(18px, 3vh, 34px); }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px; }
.eyebrow { margin: 0 0 9px; color: var(--blue); font-weight: 800; letter-spacing: .16em; font-size: 10px; text-transform: uppercase; }
.hero h1, .product-info h1 { margin: 0; color: var(--navy); letter-spacing: -.045em; font-size: clamp(34px, 4.3vw, 68px); line-height: .95; max-width: 900px; }
.hero h1 span { color: var(--blue); }
.hero-copy { max-width: 410px; color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 4px; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.4vw, 22px); min-height: 0; }
.product-card { position: relative; border: 1px solid rgba(23,35,76,.08); border-radius: var(--radius); background: #fff; overflow: hidden; text-decoration: none; display: grid; grid-template-rows: 1fr auto; min-width: 0; box-shadow: 0 12px 40px rgba(31,48,80,.04); transition: transform .28s, box-shadow .28s, border-color .28s; }
.product-card:hover, .product-card:focus-visible { transform: translateY(-7px); box-shadow: var(--shadow); border-color: rgba(22,117,185,.2); outline: none; }
.product-card::before { display: none; }
.product-card-image { min-height: 0; position: relative; display: grid; place-items: center; padding: 8px 18px 0; background: #fff; }
.product-card-image img { width: 100%; height: 100%; max-height: 34vh; object-fit: contain; transition: opacity .18s ease, transform .3s; }
.product-card-image img.is-switching { opacity: .25; }
.product-card:hover img { transform: scale(1.035); }
.card-colour-pills { position: absolute; z-index: 2; left: 50%; bottom: 12px; transform: translate(-50%, 8px); display: flex; align-items: center; gap: 5px; padding: 6px; border: 1px solid rgba(23,35,76,.1); border-radius: 999px; background: rgba(255,255,255,.95); box-shadow: 0 8px 24px rgba(23,35,76,.12); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility .2s, transform .2s; white-space: nowrap; }
.card-colour-pills span { display: flex; align-items: center; gap: 4px; color: var(--navy); font-size: 8px; font-weight: 800; }
.card-colour-pills .swatch { width: 12px; height: 12px; }
.product-card:hover .card-colour-pills, .product-card:focus-visible .card-colour-pills { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.product-card-body { padding: 18px 20px 19px; border-top: 1px solid rgba(23,35,76,.06); }
.product-card-body small { color: var(--blue); text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: 9px; }
.product-card-body h2 { font-size: clamp(15px, 1.35vw, 20px); margin: 7px 0 9px; color: var(--navy); }
.card-price { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.card-price strong { color: var(--navy); font-size: 14px; }
.card-arrow { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 16px; }
.home-footer { display: flex; justify-content: space-between; gap: 20px; font-size: 11px; color: var(--muted); }
.home-footer strong { color: var(--navy); }

.product-view { min-height: calc(100vh - 130px); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr); gap: clamp(24px, 4vw, 66px); }
.visual-column { min-height: 0; display: grid; grid-template-rows: auto 1fr; gap: 14px; }
.back-link { align-self: start; display: inline-flex; align-items: center; gap: 8px; width: max-content; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.back-link:hover { color: var(--navy); }
.product-stage { min-height: 520px; position: relative; border-radius: 28px; background: #fff; border: 1px solid rgba(23,35,76,.07); overflow: hidden; box-shadow: 0 20px 65px rgba(30,47,80,.07); display: grid; place-items: center; }
.stage-tabs { position: absolute; z-index: 3; left: 18px; top: 18px; padding: 4px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 999px; display: flex; gap: 2px; }
.stage-tabs button { border: 0; background: transparent; border-radius: 999px; padding: 8px 13px; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--muted); cursor: pointer; }
.stage-tabs button.active { background: var(--navy); color: white; }
.product-image-wrap { width: 100%; height: 100%; min-height: 520px; position: relative; display: grid; place-items: center; padding: 30px; background: #fff; }
.product-image-wrap img { width: 100%; height: 100%; max-height: calc(100vh - 180px); object-fit: contain; }
.team-overlay { position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%); width: 37%; text-align: center; white-space: nowrap; overflow: hidden; color: white; font-size: var(--team-font-desktop, 18px); font-weight: 900; letter-spacing: .08em; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.2); mix-blend-mode: normal; }
.preview-note { position: absolute; bottom: 14px; right: 16px; color: var(--muted); background: rgba(255,255,255,.82); border-radius: 99px; padding: 6px 10px; font-size: 9px; }

.product-info { padding: 30px 0 8px; display: flex; flex-direction: column; min-width: 0; }
.product-info h1 { font-size: clamp(32px, 3.4vw, 54px); }
.product-description { color: var(--muted); font-size: 13px; line-height: 1.55; max-width: 560px; margin: 13px 0 16px; }
.spec-list { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.spec-list span { font-size: 9px; letter-spacing: .04em; color: #516079; background: #edf2f5; border-radius: 99px; padding: 6px 9px; }
.config-section { border-top: 1px solid var(--line); padding: 16px 0; }
.config-section:first-of-type { border-top: 0; }
.section-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.section-label strong { color: var(--navy); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.section-label small { color: var(--muted); font-size: 10px; }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-button { border: 1px solid var(--line); background: white; border-radius: 12px; min-height: 42px; padding: 7px 13px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 11px; font-weight: 700; }
.choice-button small { display: block; color: var(--muted); font-weight: 500; font-size: 9px; }
.choice-button.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22,117,185,.11); color: var(--navy); }
.swatch { width: 17px; height: 17px; border-radius: 50%; background: var(--swatch); border: 1px solid rgba(0,0,0,.13); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.team-input-wrap { display: flex; gap: 8px; }
.team-input-wrap input { width: 100%; border: 1px solid var(--line); border-radius: 12px; height: 44px; padding: 0 13px; text-transform: uppercase; font-weight: 800; letter-spacing: .06em; color: var(--navy); background: white; }
.team-input-wrap input:focus, .field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,117,185,.11); outline: none; }
.input-count { min-width: 56px; display: grid; place-items: center; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 10px; }
.field-error { color: var(--red); font-size: 10px; margin: 7px 0 0; min-height: 12px; }
.size-guide { margin: 0 0 9px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; overflow: hidden; }
.size-guide summary { min-height: 34px; padding: 8px 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; color: var(--navy); font-size: 10px; font-weight: 800; list-style: none; }
.size-guide summary::-webkit-details-marker { display: none; }
.size-guide summary::after { content: '+'; color: var(--blue); font-size: 15px; line-height: 1; }
.size-guide[open] summary::after { content: '−'; }
.size-guide summary span { margin-left: auto; color: var(--muted); font-size: 9px; font-weight: 500; }
.size-guide-grid { display: grid; grid-template-columns: repeat(8, minmax(42px, 1fr)); border-top: 1px solid var(--line); }
.size-guide-cell { padding: 7px 3px 8px; display: grid; gap: 2px; text-align: center; border-right: 1px solid var(--line); }
.size-guide-cell:last-child { border-right: 0; }
.size-guide-cell strong { color: var(--navy); font-size: 9px; }
.size-guide-cell span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.size-grid { display: grid; grid-template-columns: repeat(8, minmax(42px, 1fr)); gap: 6px; }
.size-cell { border: 1px solid var(--line); border-radius: 10px; background: white; overflow: hidden; text-align: center; }
.size-cell label { display: block; color: var(--muted); background: var(--soft); font-size: 9px; font-weight: 800; padding: 5px 2px; }
.size-cell input { width: 100%; height: 31px; border: 0; text-align: center; color: var(--navy); font-weight: 800; font-size: 11px; outline: none; }
.product-actions { margin-top: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding-top: 16px; }
.price-preview small { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.price-preview strong { color: var(--navy); font-size: 23px; letter-spacing: -.03em; }
.price-preview span { color: var(--muted); font-size: 10px; }
.primary-button, .secondary-button, .text-button { border: 0; cursor: pointer; font-weight: 800; }
.primary-button { min-height: 46px; padding: 0 22px; border-radius: 13px; background: var(--navy); color: white; display: inline-flex; gap: 10px; align-items: center; justify-content: center; font-size: 12px; box-shadow: 0 9px 24px rgba(23,35,76,.18); }
.primary-button:hover { background: #253763; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.secondary-button { min-height: 43px; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 0 16px; font-size: 11px; }
.text-button { background: none; color: var(--red); font-size: 10px; padding: 4px; }

dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(8,16,42,.46); backdrop-filter: blur(5px); }
.side-dialog { margin: 0 0 0 auto; width: min(480px, 100vw); max-width: none; height: 100vh; max-height: 100vh; background: white; box-shadow: -20px 0 70px rgba(11,24,52,.2); }
.dialog-panel { min-height: 100%; display: flex; flex-direction: column; }
.dialog-header { padding: 24px 26px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; color: var(--navy); font-size: 22px; }
.icon-button { width: 35px; height: 35px; border-radius: 50%; border: 1px solid var(--line); background: white; cursor: pointer; font-size: 18px; }
.basket-list { padding: 12px 26px; overflow-y: auto; flex: 1; }
.basket-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.basket-item img { width: 58px; height: 68px; object-fit: contain; border-radius: 10px; background: var(--soft); }
.basket-item h3 { margin: 1px 0 4px; color: var(--navy); font-size: 13px; }
.basket-item p { margin: 0 0 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.basket-item strong { color: var(--navy); font-size: 12px; }
.basket-footer { padding: 20px 26px 25px; border-top: 1px solid var(--line); background: #fbfcfd; }
.total-row { display: flex; justify-content: space-between; margin: 7px 0; color: var(--muted); font-size: 11px; }
.total-row.total { color: var(--navy); font-size: 16px; font-weight: 900; padding-top: 7px; border-top: 1px solid var(--line); }
.basket-footer .primary-button { width: 100%; margin-top: 13px; }
.empty-state { padding: 70px 30px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--navy); }

.checkout-dialog { width: min(920px, calc(100vw - 30px)); max-width: none; max-height: calc(100vh - 28px); border-radius: 24px; box-shadow: var(--shadow); overflow: auto; }
.checkout-shell { background: white; min-height: 600px; display: grid; grid-template-rows: auto 1fr auto; }
.checkout-top { display: flex; align-items: center; justify-content: space-between; padding: 23px 28px; border-bottom: 1px solid var(--line); }
.checkout-top h2 { margin: 0; color: var(--navy); font-size: 21px; }
.steps { display: flex; gap: 8px; }
.step-dot { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 10px; font-weight: 800; }
.step-dot.active { background: var(--navy); color: white; }
.checkout-body { padding: 25px 28px; overflow-y: auto; }
.checkout-body h3 { margin: 0 0 5px; color: var(--navy); font-size: 20px; }
.checkout-intro { margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 10px; color: var(--navy); font-weight: 800; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: white; min-height: 42px; padding: 10px 12px; color: var(--ink); }
.field textarea { min-height: 68px; resize: vertical; }
.field small { color: var(--muted); font-size: 9px; }
.generated-number-note { min-height: 67px; padding: 10px 12px; border: 1px dashed rgba(22,117,185,.35); border-radius: 11px; background: #f4f9fc; display: grid; align-content: center; gap: 2px; }
.generated-number-note small { color: var(--blue); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.generated-number-note strong { color: var(--navy); font-size: 11px; }
.generated-number-note span { color: var(--muted); font-size: 9px; }
.terms-box { background: var(--soft); padding: 14px; border-radius: 12px; margin-top: 16px; display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.review-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 22px; }
.review-card { border: 1px solid var(--line); border-radius: 15px; padding: 16px; }
.review-card h4 { color: var(--navy); margin: 0 0 12px; }
.review-line { padding: 10px 0; border-top: 1px solid var(--line); font-size: 11px; }
.review-line:first-of-type { border: 0; }
.review-line strong { color: var(--navy); }
.review-line small { color: var(--muted); display: block; margin-top: 4px; }
.checkout-actions { padding: 18px 28px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.confirmation { text-align: center; display: grid; place-items: center; align-content: center; min-height: 420px; padding: 30px; }
.confirmation-icon { width: 62px; height: 62px; border-radius: 50%; background: #e5f4f1; color: var(--green); display: grid; place-items: center; font-size: 30px; }
.confirmation h3 { margin-top: 18px; font-size: 27px; }
.reference { display: inline-block; background: var(--navy); color: white; border-radius: 10px; padding: 10px 16px; letter-spacing: .08em; font-weight: 900; margin: 12px 0; }
.warning { background: #fff5e9; color: #7b521e; border-radius: 10px; padding: 10px 12px; font-size: 10px; max-width: 580px; }
.api-errors { color: var(--red); font-size: 10px; background: #fff1f3; border-radius: 11px; padding: 10px 13px; margin-bottom: 13px; }
.api-errors ul { margin: 5px 0 0; padding-left: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy); color: white; border-radius: 999px; padding: 11px 17px; font-size: 11px; opacity: 0; visibility: hidden; transition: .25s; z-index: 100; box-shadow: var(--shadow); }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
    .home-view { height: auto; }
    .hero { grid-template-columns: 1fr; gap: 12px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .product-card-image img { max-height: 30vh; }
    .product-view { grid-template-columns: 1fr; }
    .product-stage { min-height: 560px; }
    .product-info { padding-top: 0; }
}

@media (max-width: 650px) {
    .site-header { height: 64px; padding: 0 15px; }
    .brand img { width: 93px; }
    .brand-divider, .brand > span:last-child, .deadline-pill { display: none; }
    .basket-button { height: 38px; }
    .app-shell { min-height: calc(100vh - 64px); padding: 22px 15px 26px; }
    .home-view { min-height: 0; }
    .hero h1 { font-size: 39px; }
    .hero-copy { font-size: 12px; }
    .product-grid { grid-template-columns: 1fr; }
    .product-card { min-height: 420px; }
    .product-card-image img { max-height: 300px; }
    .home-footer { flex-direction: column; }
    .product-view { gap: 19px; }
    .product-stage, .product-image-wrap { min-height: 420px; }
    .product-image-wrap { padding: 40px 6px 20px; }
    .stage-tabs { top: 10px; left: 10px; }
    .team-overlay { top: 28%; width: 48%; font-size: var(--team-font-mobile, 10px); letter-spacing: .035em; }
    .product-info h1 { font-size: 37px; }
    .size-grid { grid-template-columns: repeat(4, 1fr); }
    .size-guide-grid { grid-template-columns: repeat(4, 1fr); }
    .size-guide-cell:nth-child(4) { border-right: 0; }
    .size-guide-cell:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
    .product-actions { position: static; background: rgba(255,255,255,.82); padding: 12px; margin: 0 -8px; border-radius: 15px; box-shadow: 0 8px 30px rgba(23,35,76,.08); }
    .checkout-dialog { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
    .checkout-shell { min-height: 100vh; }
    .checkout-top, .checkout-body, .checkout-actions { padding-left: 17px; padding-right: 17px; }
    .steps { display: none; }
    .form-grid, .review-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
