:root {
  --navy: #071b3f;
  --navy-2: #102b58;
  --orange: #ff7417;
  --cyan: #41d3dd;
  --cream: #f5f2e9;
  --paper: #fff;
  --ink: #0a1b3c;
  --muted: #68748a;
  --line: #dde3eb;
  --green: #138a63;
  --shadow: 0 16px 42px rgba(7,27,63,.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.app-shell { min-height: 100dvh; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 30; min-height: 76px; padding: 12px 18px; display: flex; align-items: center; gap: 10px; background: rgba(7,27,63,.97); color: white; box-shadow: 0 8px 28px rgba(7,27,63,.22); }
.brand { display: flex; align-items: center; gap: 10px; color: white; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 43px; height: 43px; object-fit: contain; border-radius: 9px; }
.brand span { display: grid; min-width: 0; }
.brand strong { font-size: .98rem; letter-spacing: .01em; white-space: nowrap; }
.brand small { color: var(--cyan); font-size: .62rem; letter-spacing: .18em; font-weight: 800; margin-top: 3px; white-space: nowrap; }
.icon-button { border: 1px solid rgba(255,255,255,.25); color: white; background: rgba(255,255,255,.08); border-radius: 999px; height: 38px; min-width: 38px; padding: 0 12px; font-size: .75rem; font-weight: 800; }
.account-button { width: 40px; padding: 0; background: linear-gradient(135deg, var(--orange), #ff9c2d); border: 0; }
main { width: min(100%, 1180px); margin: 0 auto; }
.screen { display: none; padding: 26px 18px 34px; }
.screen.is-active { display: block; animation: enter .26s ease both; }
@keyframes enter { from { opacity: .25; transform: translateY(7px); } }
.welcome-row, .section-heading, .screen-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.welcome-row h1, .screen-title h1 { margin: 4px 0 0; font-size: clamp(1.7rem, 7vw, 2.55rem); line-height: 1.03; letter-spacing: -.045em; max-width: 650px; }
.screen-title { margin-bottom: 20px; }
.screen-title p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.eyebrow { margin: 0; color: #708096; font-size: .68rem; letter-spacing: .16em; font-weight: 900; }
.trade-badge { flex: none; color: var(--navy); border: 1px solid #b8d9df; background: #e6f9fa; padding: 8px 10px; border-radius: 999px; font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.search-bar { margin: 22px 0 14px; height: 58px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 17px; padding: 7px 8px 7px 18px; box-shadow: 0 10px 28px rgba(7,27,63,.07); }
.search-bar > span { color: var(--navy); font-size: 1.35rem; transform: rotate(-18deg); }
.search-bar input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.search-bar input::placeholder { color: #94a0b2; }
.search-bar button { border: 0; border-radius: 12px; background: var(--orange); color: var(--navy); font-weight: 900; height: 44px; padding: 0 18px; }
.account-setup { width: 100%; border: 1px solid #cfe5e8; background: linear-gradient(135deg, #effbfb, #fff); border-radius: 16px; padding: 13px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; color: var(--ink); }
.account-setup-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--green); font-weight: 900; }
.account-setup strong, .account-setup small { display: block; }
.account-setup strong { font-size: .9rem; }
.account-setup small { color: var(--muted); margin-top: 3px; font-size: .73rem; line-height: 1.35; }
.section-heading { align-items: end; margin: 27px 0 13px; }
.section-heading h2 { margin: 4px 0 0; font-size: 1.22rem; letter-spacing: -.025em; }
.section-heading button { border: 0; background: transparent; color: var(--navy-2); font-weight: 800; font-size: .82rem; }
.category-strip, .filter-row { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 7px; }
.category-strip::-webkit-scrollbar, .filter-row::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; border: 1px solid var(--line); background: white; color: var(--ink); padding: 10px 13px; border-radius: 999px; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.category-chip.is-active { background: var(--navy); border-color: var(--navy); color: white; }
.reorder-card { margin: 19px 0 4px; padding: 23px; border-radius: 22px; color: white; overflow: hidden; background: radial-gradient(circle at 92% 8%, rgba(65,211,221,.38), transparent 30%), linear-gradient(135deg, var(--navy), #16386b); box-shadow: var(--shadow); }
.reorder-card .eyebrow { color: var(--cyan); }
.reorder-card h2 { margin: 6px 0 8px; font-size: 1.45rem; max-width: 420px; }
.reorder-card p:not(.eyebrow) { margin: 0; color: #cbd8ed; font-size: .84rem; line-height: 1.45; max-width: 480px; }
.reorder-card button { margin-top: 18px; border: 0; border-radius: 12px; padding: 11px 14px; background: white; color: var(--navy); font-weight: 900; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 8px 24px rgba(7,27,63,.055); display: flex; flex-direction: column; }
.product-image { aspect-ratio: 1 / 1; padding: 9px; display: grid; place-items: center; background: #f8fafc; cursor: pointer; }
.product-image img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.product-info { padding: 12px; display: flex; flex: 1; flex-direction: column; }
.product-category { margin: 0 0 5px; color: #758298; font-size: .63rem; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; font-weight: 900; }
.product-info h3 { margin: 0; font-size: .9rem; line-height: 1.22; letter-spacing: -.015em; }
.product-pack { margin: 6px 0 12px; color: var(--muted); font-size: .76rem; }
.product-actions { margin-top: auto; display: grid; grid-template-columns: 38px 1fr; gap: 7px; }
.product-actions button { height: 37px; border-radius: 10px; font-weight: 900; }
.detail-button { border: 1px solid var(--line); background: white; color: var(--navy); font-size: 1rem; }
.add-button { border: 0; background: #e8f8f8; color: var(--navy); font-size: .74rem; }
.add-button.is-added { background: var(--green); color: white; }
.sticky-search { position: sticky; top: 84px; z-index: 15; margin-top: 0; }
.sticky-search button { color: var(--navy); background: #eef1f5; width: 42px; padding: 0; font-size: 1.15rem; }
.filter-row { margin-bottom: 15px; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 1.2rem; }
.empty-state p { margin: 7px 0 0; }
.segmented { background: #e6e8ed; border-radius: 13px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; }
.segmented button { border: 0; background: transparent; color: var(--muted); border-radius: 10px; padding: 10px; font-weight: 850; }
.segmented button.is-active { background: white; color: var(--navy); box-shadow: 0 3px 10px rgba(7,27,63,.08); }
.empty-panel { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 46px 24px; text-align: center; }
.empty-panel > span { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 18px; background: #e8f8f8; color: var(--navy); font-size: 1.5rem; }
.empty-panel h2 { margin: 0; font-size: 1.25rem; }
.empty-panel p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.empty-panel button { border: 0; border-radius: 12px; background: var(--navy); color: white; padding: 12px 16px; font-weight: 850; }
.profile-form { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: grid; gap: 15px; }
.profile-form label { display: grid; gap: 7px; font-size: .78rem; color: #526178; font-weight: 800; }
.profile-form label span { font-weight: 500; }
.profile-form input, .profile-form select, .profile-form textarea { width: 100%; border: 1px solid #d4dbe5; border-radius: 12px; background: #fbfcfd; color: var(--ink); padding: 12px; outline: none; font-size: .94rem; }
.profile-form input:focus, .profile-form select:focus, .profile-form textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(65,211,221,.16); }
.primary-action { border: 0; border-radius: 13px; background: var(--navy); color: white; padding: 14px; font-weight: 900; }
.form-status { margin: 0; min-height: 1em; color: var(--green); font-size: .8rem; text-align: center; }
.support-card { margin-top: 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border: 1px solid #bee7d8; background: #edfbf5; border-radius: 16px; padding: 14px; color: var(--ink); text-decoration: none; }
.support-card > span:first-child { width: 37px; height: 37px; display: grid; place-items: center; background: var(--green); color: white; border-radius: 11px; font-weight: 900; font-size: .69rem; }
.support-card strong, .support-card small { display: block; }
.support-card small { margin-top: 3px; color: var(--muted); }
.bottom-nav { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; height: calc(68px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.96); border-top: 1px solid #dbe1e9; box-shadow: 0 -8px 26px rgba(7,27,63,.09); backdrop-filter: blur(15px); }
.bottom-nav button { position: relative; border: 0; background: transparent; color: #758298; font-size: .66rem; font-weight: 800; display: grid; place-items: center; align-content: center; gap: 3px; }
.bottom-nav button > span { font-size: 1.25rem; line-height: 1; }
.bottom-nav button.is-active { color: var(--navy); }
.bottom-nav button.is-active::after { content: ""; position: absolute; top: -7px; width: 25px; height: 3px; border-radius: 0 0 4px 4px; background: var(--orange); }
.cart-nav i { position: absolute; top: 0; right: calc(50% - 21px); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: var(--navy); font-size: .6rem; font-style: normal; font-weight: 900; }
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(4,17,38,.72); backdrop-filter: blur(4px); }
body.modal-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.product-dialog { --detail-card-width: calc(100vw - 34px); --detail-gap: 10px; --detail-side: 17px; width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: 0; overflow: hidden; overscroll-behavior: none; background: transparent; box-shadow: none; touch-action: pan-x pan-y; }
.product-dialog::backdrop { background: transparent; backdrop-filter: none; }
#product-dialog-content,.detail-carousel { width: 100%; height: 100%; overflow: hidden; }
.detail-carousel { position: relative; padding-block: max(7px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-bottom)); background: #292929; transition: background .18s ease; }
.product-dialog.is-closing .detail-carousel { background: transparent; }
.detail-carousel::before { content: ""; position: absolute; z-index: 0; inset: 0; background: white; opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.detail-carousel-track { position: relative; z-index: 1; width: 100%; height: 100%; display: flex; align-items: stretch; gap: var(--detail-gap); padding-inline: var(--detail-side); overflow-x: auto; overflow-y: hidden; overflow-anchor: none; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--detail-side); scrollbar-width: none; -webkit-overflow-scrolling: touch; transform: translate3d(0,var(--detail-dismiss-y,0px),0); transition: transform .2s cubic-bezier(.22,.72,.3,1); }
.detail-carousel-track::-webkit-scrollbar { display: none; }
.product-dialog.is-dismissing .detail-carousel-track { transition: none; }
.detail-card { position: relative; flex: 0 0 var(--detail-card-width); height: 100%; min-width: 0; overflow: hidden; border-radius: 24px; color: var(--navy); background: white; box-shadow: 0 18px 48px rgba(0,0,0,.3); contain: paint; scroll-snap-align: center; scroll-snap-stop: always; transition: border-radius .16s ease,box-shadow .16s ease,opacity .16s ease; }
.detail-card-scroll { width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; background: white; }
.detail-card:not(.is-current) .detail-card-scroll { overflow: hidden; pointer-events: none; }
.detail-dismiss { position: absolute; z-index: 6; top: max(12px,env(safe-area-inset-top)); left: 14px; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--navy); background: rgba(255,255,255,.94); box-shadow: 0 5px 20px rgba(7,27,63,.16); font-size: 1.55rem; font-weight: 900; }
.product-dialog.is-detail-expanded .detail-carousel::before { opacity: 1; }
.product-dialog.is-detail-expanded .detail-card:not(.is-current) { opacity: 0; }
.product-dialog.is-detail-expanded .detail-card.is-current { border-radius: 0; box-shadow: none; }
.detail-hero { aspect-ratio: 1/1; background: #f6f8fa; padding: 18px; display: grid; place-items: center; }
.detail-hero img { width: 100%; height: 100%; object-fit: contain; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(0); }
.detail-body { padding: 22px 18px 12px; }
.detail-body h2 { margin: 5px 0 6px; font-size: 1.7rem; line-height: 1.04; letter-spacing: -.035em; }
.detail-pack { display: inline-block; margin: 6px 0 18px; padding: 7px 10px; border-radius: 999px; color: var(--navy); background: #e8f8f8; font-size: .8rem; font-weight: 850; }
.detail-note { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.detail-cta { width: 100%; border: 0; border-radius: 12px; background: var(--green); color: white; padding: 14px; font-weight: 900; }
@media (min-width: 720px) { .product-dialog { --detail-card-width: min(88vw,560px); --detail-side: calc((100vw - var(--detail-card-width))/2); } .product-dialog.is-detail-expanded .detail-card.is-current { border-radius: 24px; box-shadow: 0 18px 48px rgba(0,0,0,.3); } }
.cart-dialog { width: min(100%, 520px); height: min(92dvh, 820px); max-height: 92dvh; margin: auto auto 0; border: 0; border-radius: 25px 25px 0 0; padding: 0; overflow: hidden; }
.cart-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 4px 0 0; }
.cart-head button { border: 0; background: #eef1f5; border-radius: 50%; width: 38px; height: 38px; font-size: 1.2rem; }
.cart-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#cart-items { padding: 0 18px; }
.cart-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 58px; height: 58px; object-fit: contain; background: #f6f8fa; border-radius: 10px; }
.cart-item strong, .cart-item small { display: block; }
.cart-item strong { font-size: .82rem; }
.cart-item small { margin-top: 4px; color: var(--muted); font-size: .7rem; }
.qty-control { display: grid; grid-template-columns: 28px 25px 28px; align-items: center; text-align: center; background: #eef2f5; border-radius: 10px; overflow: hidden; }
.qty-control button { border: 0; background: transparent; height: 32px; color: var(--navy); font-weight: 900; }
.qty-control span { font-size: .8rem; font-weight: 850; }
.cart-empty { text-align: center; padding: 48px 25px; }
.cart-empty > span { font-size: 2rem; color: var(--muted); }
.cart-empty .empty-cart-icon { width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 22px; color: var(--navy); background: linear-gradient(145deg,#fff6cd,#ffe390); box-shadow: 0 10px 24px rgba(139,96,0,.14); animation: empty-cart-float 2.2s ease-in-out infinite; }
.cart-empty .empty-cart-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-empty .empty-cart-icon svg path { stroke-dasharray: 50; animation: empty-cart-draw 1.8s ease-in-out infinite alternate; }
@keyframes empty-cart-float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes empty-cart-draw { from { stroke-dashoffset: 18; opacity: .65; } to { stroke-dashoffset: 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cart-empty .empty-cart-icon,.cart-empty .empty-cart-icon svg path { animation: none; } }
.cart-empty h3 { margin: 12px 0 6px; }
.cart-empty p { color: var(--muted); font-size: .84rem; }
.cart-footer { padding: 16px 18px 20px; }
.cart-footer p { margin: 0 0 10px; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.cart-footer .order-submit-status:not(:empty) { margin: 8px 0; padding: 10px 12px; border-radius: 10px; color: #8b1e1e; background: #fff0f0; font-weight: 800; }
.cart-footer a { display: block; text-align: center; text-decoration: none; border-radius: 13px; background: var(--green); color: white; padding: 14px; font-weight: 900; }
.cart-submit-bar { position: relative; z-index: 2; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: white; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(7,27,63,.12); }
.toast { position: fixed; z-index: 100; bottom: calc(82px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 18px); max-width: 86vw; background: var(--navy); color: white; border-radius: 999px; padding: 10px 15px; font-size: .78rem; font-weight: 800; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 720px) {
  .app-header { padding-inline: max(24px, calc((100vw - 1180px)/2)); }
  .screen { padding: 36px 26px 50px; }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
  .home-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reorder-card { display: flex; align-items: end; justify-content: space-between; padding: 28px 32px; }
  .bottom-nav { left: 50%; right: auto; width: min(620px, 80vw); transform: translateX(-50%); bottom: 14px; height: 68px; padding: 7px; border: 1px solid #dbe1e9; border-radius: 22px; box-shadow: 0 15px 42px rgba(7,27,63,.2); }
  .app-shell { padding-bottom: 105px; }
  .profile-form { grid-template-columns: 1fr 1fr; padding: 24px; }
  .profile-form label:nth-of-type(6), .primary-action, .form-status { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .home-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
