:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #141d32;
  --muted: #758198;
  --blue: #1677f2;
  --red: #e32f38;
  --line: #e8edf5;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
.retry-button { display: block; margin-top: 10px; padding: 8px 12px; border: 1px solid currentColor; border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.retry-button:disabled { opacity: .6; cursor: wait; }

html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); }
body { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #83b8ff; outline-offset: 2px; }

.app-shell { min-height: 100dvh; max-width: 760px; margin: 0 auto; padding-bottom: calc(92px + var(--safe-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.logo-mark { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-family: Georgia, serif; font-weight: 700; letter-spacing: -3px; padding-right: 3px; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 17px; }
.brand-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.cart-button { margin-left: auto; width: 42px; height: 42px; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 20px; box-shadow: 0 4px 18px #1d35550b; }

.hero { position: relative; overflow: hidden; margin: 8px 16px 18px; padding: 24px 22px; min-height: 220px; border-radius: 24px; background: linear-gradient(135deg, #15203a, #263858 72%, #334b70); color: #fff; }
.hero::after { content: "МК"; position: absolute; right: 22px; bottom: -42px; width: 158px; height: 158px; display: grid; place-items: center; border: 2px solid #f04450; border-radius: 50%; color: #f04450; font: 700 62px Georgia, serif; letter-spacing: -11px; padding-right: 10px; transform: rotate(-8deg); opacity: .92; }
.eyebrow { color: #b9c9e3; font-size: 12px; letter-spacing: .11em; text-transform: uppercase; }
.hero h1 { max-width: 390px; margin: 9px 0; font-size: clamp(27px, 6vw, 38px); line-height: 1.04; letter-spacing: -.035em; }
.hero p { max-width: 310px; margin: 0; color: #d8e1f0; font-size: 14px; line-height: 1.45; }
.button-primary { min-height: 48px; border: 0; border-radius: 14px; background: var(--blue); color: white; font-weight: 700; padding: 0 18px; }
.hero .button-primary { position: relative; z-index: 1; margin-top: 18px; background: #fff; color: #155fc5; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 18px 12px; }
.section-head h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.section-head button { border: 0; background: transparent; color: var(--blue); font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 3px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .bottom-nav::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 14px; color: #34425d; font-size: 13px; }
.chip.active { border-color: var(--blue); background: var(--blue); color: #fff; }

.product-grid { display: grid; gap: 12px; padding: 14px 16px 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-card { overflow: hidden; border: 1px solid #edf0f6; border-radius: 19px; background: var(--surface); box-shadow: 0 8px 24px #2035560a; }
.product-art { min-height: 156px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, #44516a, #1e2739 72%); }
.mini-shirt { position: relative; width: 112px; height: 122px; display: grid; place-items: center; border-radius: 18px 18px 10px 10px; background: linear-gradient(115deg,#191b21,#282b32 52%,#111318); color: var(--red); box-shadow: 0 14px 22px #080b12a8; transform: perspective(400px) rotateY(-8deg) rotateZ(-2deg); }
.mini-shirt::before, .mini-shirt::after { content: ""; position: absolute; top: 11px; width: 38px; height: 48px; background: #1b1d23; }
.mini-shirt::before { left: -25px; transform: rotate(24deg); border-radius: 8px 0 7px 12px; }
.mini-shirt::after { right: -25px; transform: rotate(-24deg); border-radius: 0 8px 12px 7px; }
.mini-shirt .logo-mark { position: relative; z-index: 1; width: 56px; height: 56px; font-size: 23px; border-width: 2px; }
.product-info { padding: 12px; }
.product-info h3 { margin: 0; font-size: 14px; line-height: 1.25; }
.product-info p { min-height: 30px; margin: 6px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.product-price { font-weight: 750; font-size: 16px; }
.product-info .button-primary { width: 100%; margin-top: 10px; min-height: 42px; font-size: 13px; }

.empty-state { margin: 14px 16px 24px; padding: 22px; border: 1px dashed #cfd8e8; border-radius: 20px; background: #fff; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 17px; background: #edf5ff; color: var(--blue); font-size: 26px; }
.empty-state h3 { margin: 0 0 6px; font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.page-content { padding: 8px 16px 20px; }
.page-card { padding: 20px; border-radius: 20px; background: #fff; border: 1px solid #edf0f6; }
.page-card h1 { margin: 0 0 9px; font-size: 24px; }
.page-card p { color: var(--muted); line-height: 1.5; }
.page-card .button-primary { width: 100%; margin-top: 12px; }
.orders-heading { padding: 14px 4px 8px; }
.orders-heading .eyebrow { color: var(--blue); }
.orders-heading h1 { margin: 6px 0; font-size: 25px; }
.orders-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.order-list { display: grid; gap: 10px; padding: 12px 0 20px; }
.order-card { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 5px 18px #20355608; }
.order-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-card-head strong, .order-card-head span { display: block; }
.order-card-head > div span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.order-status { padding: 5px 8px; border-radius: 999px; background: #edf5ff; color: #2365b4; font-size: 10px; white-space: nowrap; }
.order-items { margin: 12px 0 8px; font-size: 14px; font-weight: 650; }
.order-details { margin: 5px 0; color: #657189; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.order-details strong { color: var(--ink); }
.order-total { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 750; }
.order-open, .text-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 12px; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--blue); font-size: 13px; font-weight: 650; text-align: left; }
.text-button { justify-content: flex-start; width: auto; margin: 4px 0 12px; padding: 4px 0; border: 0; }
.detail-card { padding: 17px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.detail-card .order-card-head h1 { margin: 3px 0 0; font-size: 22px; }
.detail-card .order-card-head > div > span { color: var(--muted); font-size: 12px; }
.detail-section { margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); }
.detail-section h2 { margin: 0 0 10px; font-size: 15px; }
.detail-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 12px; line-height: 1.4; }
.detail-row span { color: var(--muted); }
.detail-row strong { text-align: right; overflow-wrap: anywhere; }
.detail-row small { display: block; margin-top: 3px; color: var(--muted); }
.detail-grand-total { margin-top: 5px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.detail-items { margin: 0; padding-left: 19px; }
.detail-items li { padding: 5px 0; font-size: 13px; }
.detail-items li span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-history { display: grid; gap: 12px; }
.history-row { display: flex; gap: 9px; font-size: 12px; }
.history-dot { width: 9px; height: 9px; margin-top: 3px; flex: 0 0 auto; border: 2px solid var(--blue); border-radius: 50%; }
.history-row p { margin: 4px 0; color: #56637a; }
.history-row small { color: var(--muted); }
.cost-breakdown { max-height: 260px; overflow: auto; padding: 10px; border-radius: 10px; background: #f6f8fc; color: #56637a; font-size: 10px; }
.notice { margin: 10px 16px; padding: 12px 14px; border-radius: 13px; background: #fff4e7; color: #76501c; font-size: 12px; }
.error-message { margin: 12px 16px; padding: 12px 14px; border-radius: 13px; background: #fff0f1; color: #9c2933; font-size: 13px; }

.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; width: min(100%, 760px); display: flex; justify-content: space-around; gap: 2px; padding: 8px 8px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--line); background: #ffffffed; backdrop-filter: blur(16px); transform: translateX(-50%); }
.nav-item { min-width: 58px; border: 0; background: transparent; color: #7b879b; font-size: 10px; display: grid; justify-items: center; gap: 3px; padding: 4px 5px; }
.nav-item .icon { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--blue); font-weight: 700; }
.loading-shell { min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.loading-shell .logo-mark { width: 38px; height: 38px; }
.preview-note { margin: 8px 16px; color: var(--muted); font-size: 11px; text-align: center; }

.product-detail-page { padding-top: 2px; }
.detail-intro { padding: 4px 4px 14px; }
.detail-intro .eyebrow { color: var(--blue); font-size: 11px; font-weight: 700; }
.detail-intro h1 { margin: 5px 0; font-size: 23px; }
.detail-intro p, .muted-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.placement-panel, .selection-card, .cart-summary { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 8px 24px #2035560a; }
.view-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 7px; background: #f0f2f6; scrollbar-width: none; }
.view-tab { flex: 1 0 auto; min-height: 38px; border: 0; border-radius: 11px; background: transparent; color: #45516a; padding: 0 11px; font-size: 12px; font-weight: 650; }
.view-tab.active { background: var(--blue); color: #fff; box-shadow: 0 4px 10px #1677f233; }
.shirt-stage { position: relative; min-height: 330px; margin: 0; display: grid; place-items: center; overflow: hidden; background: radial-gradient(ellipse at 50% 47%, #f8f9fb 0, #edf0f5 72%, #e7ebf1 100%); }
.shirt-shape { position: relative; width: min(60%, 210px); height: 250px; border-radius: 28px 28px 17px 17px; background: linear-gradient(105deg, #111318 0%, #252831 45%, #17191f 78%, #0e1014 100%); box-shadow: 0 18px 28px #171d2a36, inset 9px 0 15px #ffffff0b, inset -9px 0 15px #00000024; clip-path: polygon(25% 0, 38% 5%, 62% 5%, 75% 0, 100% 18%, 86% 41%, 78% 36%, 78% 100%, 22% 100%, 22% 36%, 14% 41%, 0 18%); }
.shirt-shape::before, .shirt-shape::after { content: ""; position: absolute; z-index: 1; top: 8px; width: 25%; height: 32%; border-radius: 12px; background: linear-gradient(110deg, #17191f, #262a33 65%, #13151a); }
.shirt-shape::before { left: 0; transform: rotate(13deg); }
.shirt-shape::after { right: 0; transform: rotate(-13deg); }
.shirt-neck { position: absolute; z-index: 2; top: 0; left: 50%; width: 30%; height: 25px; border: 5px solid #0a0b0e; border-top: 0; border-radius: 0 0 50% 50%; transform: translateX(-50%); }
.shirt-mark { position: absolute; z-index: 2; top: 43%; left: 50%; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #ed343b; border-radius: 50%; color: #ed343b; font-family: Georgia, serif; font-size: 18px; transform: translate(-50%, -50%); }
.view-back .shirt-shape { background: linear-gradient(105deg, #111318 0%, #252831 45%, #17191f 78%, #0e1014 100%); }
.view-back .shirt-mark { display: none; }
.view-left_side .shirt-shape { width: min(49%, 165px); height: 238px; transform: perspective(450px) rotateY(-34deg) rotateZ(-1deg); }
.view-right_side .shirt-shape { width: min(49%, 165px); height: 238px; transform: perspective(450px) rotateY(34deg) rotateZ(1deg); }
.view-left_side .shirt-mark, .view-right_side .shirt-mark { top: 46%; width: 40px; height: 40px; font-size: 15px; }
.view-top .shirt-shape { width: min(72%, 250px); height: 195px; border-radius: 40% 40% 22% 22%; clip-path: polygon(26% 0, 42% 7%, 58% 7%, 74% 0, 100% 25%, 82% 48%, 72% 39%, 75% 100%, 25% 100%, 28% 39%, 18% 48%, 0 25%); transform: perspective(450px) rotateX(26deg); }
.view-top .shirt-neck { height: 29px; }
.view-top .shirt-mark { top: 45%; }
.placement-dot { position: absolute; z-index: 3; width: 21px; height: 21px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #1f293a44; box-shadow: 0 1px 6px #10182780; transform: translate(-50%, -50%); }
.placement-dot.selected { width: 27px; height: 27px; border: 3px solid #fff; background: var(--blue); box-shadow: 0 0 0 4px #1478f866, 0 3px 10px #10182766; }
.no-zones { position: absolute; inset: auto 18px 18px; padding: 9px 12px; border-radius: 12px; background: #ffffffdd; color: var(--muted); font-size: 11px; text-align: center; }
.zone-strip { padding: 13px 12px 12px; border-top: 1px solid var(--line); }
.zone-strip-title { margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.zone-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.zone-card { flex: 0 0 175px; min-height: 58px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; }
.zone-card.selected { border-color: var(--blue); background: #eef6ff; box-shadow: inset 0 0 0 1px var(--blue); }
.zone-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 10px; background: #f1f4f8; color: var(--blue); font-size: 16px; }
.zone-card strong, .zone-card small { display: block; }
.zone-card strong { font-size: 11px; }
.zone-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.selection-card { margin-top: 12px; padding: 16px; }
.selection-card h2 { margin: 0 0 10px; font-size: 16px; }
.variant-list { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.variant-option { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-align: left; }
.variant-option.selected { border-color: var(--blue); background: #eef6ff; box-shadow: inset 0 0 0 1px var(--blue); }
.variant-option:disabled { opacity: .5; }
.variant-option span { font-size: 12px; font-weight: 700; }
.variant-option small { color: var(--muted); font-size: 10px; }
.selected-zone, .selection-total { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.selected-zone span, .selection-total span { color: var(--muted); }
.selected-zone strong, .selection-total strong { text-align: right; }
.selection-total { align-items: center; font-size: 14px; }
.selection-total strong { font-size: 18px; }
.selection-card > .button-primary { width: 100%; margin-top: 15px; }
.button-primary:disabled { background: #aab4c3; }
.inline-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.cart-list { display: grid; gap: 9px; padding: 12px 0; }
.cart-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cart-shirt { width: 58px; height: 68px; flex: 0 0 auto; border-radius: 12px; }
.cart-shirt::before, .cart-shirt::after { width: 23px; height: 28px; top: 8px; }
.cart-shirt::before { left: -14px; }
.cart-shirt::after { right: -14px; }
.cart-shirt .logo-mark { width: 31px; height: 31px; border-width: 1px; font-size: 13px; }
.cart-row-copy { min-width: 0; display: grid; gap: 3px; padding-right: 20px; }
.cart-row-copy strong { font-size: 12px; }
.cart-row-copy span { color: var(--muted); font-size: 10px; }
.cart-row-copy b { margin-top: 4px; font-size: 13px; }
.remove-cart-item { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 9px; background: #f1f3f7; color: #68758a; font-size: 19px; }
.cart-summary { padding: 14px; }
.cart-count { position: absolute; top: -4px; right: -6px; min-width: 17px; height: 17px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #e33d45; color: #fff; font-size: 9px; font-weight: 700; }

@media (min-width: 600px) {
  .hero { min-height: 250px; padding: 32px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-art { min-height: 200px; }
}
