@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/max/assets/inter-400.ttf") format("truetype");
}
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/max/assets/inter-600.ttf") format("truetype");
}
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/max/assets/inter-700.ttf") format("truetype");
}

:root {
    color-scheme: light;
    --app-nav-inset: min(env(safe-area-inset-bottom, 0px), 24px);
    --app-nav-height: calc(60px + var(--app-nav-inset));
    --glass: linear-gradient(131deg, rgba(255, 255, 255, .8) 11%, rgba(243, 246, 255, .48) 85%);
    --card-shadow: 0 6px 18px rgb(80 107 185 / 14%);
    --button-gradient: linear-gradient(164deg, #438fff 11%, #2451ff 85%);
    --ink: #0c1844;
    --muted: #64739a;
    --surface: rgba(255, 255, 255, .58);
    --background: #d6ddff;
    --line: #dce5e7;
    --primary: #2463ff;
    --primary-dark: #2463ff;
    --soft: #dce9ff;
    --danger: #d52d43;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--ink);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding-bottom: var(--app-nav-height);
}
.hero {
    display: flex;
    height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 20px 0;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    font-size: 16px;
}
.host-icon {
    display: flex;
}
.hero strong {
    font-weight: 600;
}
h1, h2 {
    margin: 0;
}
.page-title {
    padding: 18px 20px;
    font-size: 24px;
    line-height: 1.45;
}
#catalog {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 20px 24px;
    min-height: 630px;
}
#auth-state, .orders-section {
    margin-right: 20px;
    margin-left: 20px;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.eyebrow {
    color: var(--primary);
    font-size: 12px;
}
button:focus-visible, select:focus-visible, input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
.catalog-pickup {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    border-color: rgba(255, 255, 255, .8);
    background: var(--glass);
    box-shadow: var(--card-shadow);
}
.pickup-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.45;
}
.pickup-heading img {
    flex-shrink: 0;
}
.catalog-pickup .medicine-meta {
    white-space: pre-line;
}
.text-button {
    align-self: flex-start;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: var(--surface);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}
.compact-pickup {
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}
.search-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 0;
}
.search-hint h2 {
    width: 100%;
    font-size: 20px;
    line-height: 1.45;
    font-weight: 600;
}
.search-hint p {
    width: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}
.catalog-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    background: var(--soft);
    font-size: 14px;
    line-height: 1.45;
}
.catalog-message strong {
    color: var(--primary);
    font-weight: 600;
}
.catalog-message p {
    margin: 0;
}
.pickup-dialog {
    width: min(calc(100% - 40px), 520px);
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
}
.pickup-dialog::backdrop {
    background: rgb(32 52 56 / 48%);
}
.pickup-dialog label {
    display: block;
    margin-bottom: 8px;
}
.pickup-dialog select + label {
    margin-top: 16px;
}
.pickup-dialog select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}
.pickup-dialog p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.notice {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--muted);
    line-height: 1.45;
}

.notice.error {
    border-color: #efc9c5;
    background: #fff6f5;
    color: var(--danger);
}

.app-nav {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: min(100%, 760px);
    height: var(--app-nav-height);
    margin: 0 auto;
    padding: 6px 16px calc(6px + var(--app-nav-inset));
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 22px 22px 0 0;
    backdrop-filter: blur(20px);
    background: var(--surface);
}
.app-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 64px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
}
.app-nav button[aria-current="page"] {
    color: var(--primary);
    font-weight: 600;
}
#catalog-tab:not([aria-current="page"]) img {
    opacity: 1;
}
#cart-button {
    position: relative;
}
.cart-count {
    position: absolute;
    top: -3px;
    right: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    color: #ef4444;
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
}

.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 2px solid var(--line);
    border-top-color: var(--primary);
    border-radius: 50%;
    vertical-align: -2px;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
    transform: rotate(360deg);
}
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}
.search-form:focus-within {
    border-color: var(--primary);
}
.search-form input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}
.search-form input::placeholder {
    color: var(--muted);
    opacity: 1;
}
.search-form input::-webkit-search-cancel-button {
    display: none;
}
.search-form button {
    display: flex;
    padding: 0;
    border: 0;
    background: transparent;
}

.primary-button {
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-weight: 800;
}

.primary-button:disabled {
    cursor: default;
    opacity: .55;
}

.search-status {
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}
.results {
    display: grid;
    gap: 16px;
}
.results:empty {
    display: none;
}
.load-more {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.load-more button {
    border: 0;
    background: none;
    color: var(--primary);
    font-weight: 600;
}
.medicine-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    border-color: rgba(255, 255, 255, .8);
    background: var(--glass);
    box-shadow: var(--card-shadow);
}
.medicine-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}
.medicine-symbol {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--soft);
}
.medicine-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.medicine-meta {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.medicine-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
}
.medicine-price {
    font-size: 20px;
    line-height: 1.45;
}
.add-button {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 16px;
    background: var(--button-gradient);
    box-shadow: 0 4px 10px rgb(40 97 232 / 22%);
    color: white;
    font-size: 14px;
    font-weight: 600;
}
.medicine-quantity {
    display: flex;
    height: 38px;
    padding: 0 12px;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.medicine-quantity button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 22px;
}
.medicine-quantity strong {
    font-size: 15px;
    font-weight: 600;
}

.cart-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cart-title h1 {
    font-size: inherit;
    line-height: inherit;
}
.cart-title button {
    display: flex;
    padding: 0;
    border: 0;
    background: transparent;
}
.cart-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 630px;
    padding: 0 20px 24px;
}
.cart-content .medicine-meta {
    white-space: pre-line;
}
.cart-content > .text-button {
    width: 100%;
}
.pickup-confirm {
    width: min(calc(100% - 40px), 350px);
    padding: 24px;
    border: 0;
    border-radius: 16px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 12px 16px rgb(0 0 0 / 15%);
}
.pickup-confirm::backdrop {
    background: rgb(32 52 56 / 70%);
}
.confirmation-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.45;
}
.confirmation-message h2 {
    font-size: 18px;
}
.confirmation-message p {
    margin: 0;
    font-size: 14px;
}
.confirmation-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
    min-height: 48px;
    margin-top: 24px;
}
.confirmation-actions button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}
.confirmation-actions .danger-button {
    min-height: 38px;
    border-color: transparent;
    background: #b44545;
    color: white;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--background);
    color: var(--ink);
    font-size: 27px;
    line-height: 1;
}

.cart-items {
    display: grid;
    gap: 16px;
}
.cart-item h2 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}
.cart-item-action {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cart-item-action > strong {
    font-size: 16px;
    font-weight: 600;
}
.cart-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 16px;
}
.cart-summary strong {
    max-width: 100%;
    font-size: 26px;
}
#order-button:disabled {
    cursor: default;
    opacity: .55;
}
.order-status:empty {
    display: none;
}

.primary-button {
    width: 100%;
    min-height: 54px;
}

.order-status {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--danger);
    text-align: center;
    font-size: 13px;
}

[hidden] {
    display: none !important;
}

.orders-section {
    min-height: 630px;
    padding: 0 20px 24px;
    margin: 0;
}
#orders-list, #order-detail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}
#orders-status {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}
#orders-status:empty {
    display: none;
}
.order-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    border-color: rgba(255, 255, 255, .8);
    background: var(--glass);
    box-shadow: var(--card-shadow);
}
.order-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    font-size: 14px;
    line-height: 1.45;
}
.order-card-heading h2 {
    min-width: 0;
    font-size: 18px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.order-card-heading strong {
    flex-shrink: 0;
    font-weight: 600;
}
.order-date {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}
.order-badge {
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}
.order-badge-placed {
    background: #eaf2fa;
    color: #376c9b;
}
.order-badge-ready {
    background: var(--soft);
    color: var(--primary);
}
.order-badge-failed {
    background: #fceeee;
    color: #b44545;
}
.order-badge-neutral {
    background: var(--background);
    color: var(--muted);
}
.orders-hint {
    margin-top: 16px;
}
.order-item-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    line-height: 1.45;
}
.order-item-total strong {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: normal;
}
#order-detail .medicine-meta {
    white-space: pre-line;
}

.pickup-section {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.pickup-section h3 {
    margin: 0 0 12px;
}
.pickup-section label {
    display: block;
    margin-bottom: 8px;
}
.pickup-section select {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}
.pickup-section p {
    font-size: 14px;
    overflow-wrap: anywhere;
}
.pickup-section button {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--primary-dark);
    font: inherit;
}

.toast {
    position: fixed;
    z-index: 30;
    top: calc(16px + env(safe-area-inset-top));
    right: 16px;
    left: 16px;
    max-width: 560px;
    margin: auto;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--button-gradient);
    box-shadow: 0 4px 10px rgb(40 97 232 / 22%);
    color: white;
    text-align: center;
    font-size: 14px;
}

#customer-pickup-map {height: 300px; width: 100%; border-radius: 16px; margin-top: 16px;}
.basket-map-pin {background: #fff; color: #153d2a; border: 2px solid #31865c; border-radius: 20px; padding: 8px 12px; font-weight: 700; cursor: pointer;}
.map-point-card {padding: 12px; border: 1px solid #dbe5df; border-radius: 12px; margin: 10px 0;}
.map-point-card.selected {border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary);}
.basket-map-pin[aria-pressed="true"] {background: var(--primary); color: #fff;}
.map-point-card p {font-size: 14px;}
.offer-choices {display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;}
.offer-choice {display: grid; gap: 5px; flex: 1; min-width: 90px; padding: 12px; border: 1px solid #cbd9d1; border-radius: 12px; background: #fff; color: #273b30; cursor: pointer;}
.offer-choice.selected {border: 2px solid #28724a; background: #f2f8f4;}
.offer-choice .better {color: #167743;}
.offer-choice .worse {color: #bd3338;}
.offer-choice small {font-size: 10px;}
.offers-title {font-size: 13px; font-weight: 500; margin-bottom: 0;}
.delivery-date {font-weight: 600; color: #285d40;}

/* Customer v2 uses the same glass surfaces throughout catalogue, checkout and orders. */
body {
    background: linear-gradient(102.43deg, #d3edff 11%, #d6ddff 46%, #bfc8ff 85%) fixed;
}
.hero, .app-nav { background: var(--glass); }
.hero { border-bottom: 1px solid rgb(255 255 255 / 65%); }
.host-icon img, .pickup-heading img, .app-nav img, .map-locality img { flex: 0 0 auto; }
.text-button { background: var(--surface); }
.add-button, .primary-button { background: var(--button-gradient); border-radius: 16px; box-shadow: 0 4px 10px rgb(40 97 232 / 22%); }
button:disabled { cursor: default; opacity: .55; }
.city-card { gap: 12px; }
.city-list { display: grid; gap: 12px; margin: 16px 0; }
.city-option { padding: 16px; border: 1px solid transparent; border-radius: 18px; background: var(--glass); color: var(--ink); text-align: left; }
.city-option[aria-pressed="true"] { border-color: var(--primary); background: var(--soft); }
.city-dialog > .add-button { width: 100%; }
.map-locality { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.map-locality .text-button { flex-shrink: 0; }
.empty-cart-symbol { display: grid; place-items: center; height: 60px; }
.empty-cart h2 { font-size: 18px; line-height: 1.45; }
.empty-cart .medicine-meta { font-size: 14px; }
.empty-cart .add-button { width: 100%; }
#cart-checkout { display: flex; flex-direction: column; gap: 16px; }
#cart-checkout > .add-button { width: 100%; }
.delivery-date { margin: 0; padding: 12px; border: 1px solid rgb(255 255 255 / 80%); border-radius: 18px; background: var(--glass); color: var(--muted); font-size: 13px; line-height: 1.45; }
.delivery-date:empty { display: none; }
.offer-choices { flex-direction: column; margin-top: 0; }
.offer-choice { grid-template-columns: 1fr auto; gap: 8px; width: 100%; min-width: 0; border-color: var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; text-align: left; }
.offer-choice small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.offer-choice.selected { border: 1px solid var(--primary); background: rgb(232 239 255 / 40%); }
.offer-choice .better { color: #168363; }
.offer-choice .worse { color: var(--danger); }
.offers-title { font-weight: 600; margin: 0; }
.basket-map-pin { border: 0; border-radius: 6px; background: var(--primary); color: white; font-size: 12px; }
.basket-map-pin[aria-pressed="true"] { box-shadow: 0 0 0 3px white; }
.map-point-card { padding: 16px; border: 1px solid rgb(255 255 255 / 80%); border-radius: 18px; background: var(--glass); box-shadow: var(--card-shadow); }
.map-point-card h3 { margin: 0 0 12px; }
.map-point-card > .add-button { width: 100%; }
.order-badge-placed, .order-badge-ready { background: var(--soft); color: var(--primary); }
.order-badge-failed { color: var(--danger); }
.pickup-dialog { background: linear-gradient(102.43deg, #d3edff 11%, #d6ddff 46%, #bfc8ff 85%); border: 1px solid rgb(255 255 255 / 85%); border-radius: 30px; max-height: calc(100dvh - 32px); }
.sheet-header h2 { font-size: 24px; line-height: 1.45; }
.catalog-card { position: relative; gap: 12px; }
.catalog-card .medicine-heading { align-items: flex-start; padding-right: 85px; }
.catalog-card .medicine-action { flex-wrap: wrap; }
.catalog-card .medicine-price { position: absolute; top: 16px; right: 16px; max-width: 85px; font-size: 16px; text-align: right; }
.catalog-card .medicine-price small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.catalog-card .medicine-control, .catalog-card .add-button { width: 100%; }
.catalog-card .medicine-quantity { width: fit-content; }
.catalog-card .medicine-meta { padding-right: 70px; }
.cart-remove { width: 100%; }
@media (min-width: 600px) {
    body { max-width: 760px; margin: 20px auto; border: 1.5px solid rgb(255 255 255 / 85%); border-radius: 30px; box-shadow: 0 6px 24px rgb(80 107 185 / 14%); }
    .hero { border-radius: 30px 30px 0 0; }
}

.city-dialog > .search-form { margin-bottom: 16px; }
.city-dialog > .catalog-message { margin: 16px 0; }
#city-cancel { width: 100%; margin-top: 16px; border: 1px solid var(--line); }
.dialog-host { display: none; }
.customer-legal-footer .legal-links a, .legal-checkout a { color: var(--primary); }
.legal-checkout { color: var(--muted); }
@media (max-width: 599px) {
    .pickup-dialog { width: 100%; height: calc(100dvh - var(--app-nav-height)); max-height: none; margin: 0 auto; padding: 0 20px 24px; border: 0; border-radius: 0; }
    .pickup-dialog::backdrop { background: transparent; }
    .dialog-host { display: flex; margin: 0 -20px 18px; border-radius: 0; }
    .sheet-header { gap: 8px; }
    .sheet-header h2 { min-width: 0; }
    .sheet-header .icon-button { flex-shrink: 0; }
}

.map-locality > div .text-button { display: block; padding: 0; min-height: 24px; background: transparent; text-align: left; }
@media (max-width: 599px) { .pickup-dialog { max-width: 100%; } }
