:root {
    --ink: #202326;
    --muted: #687078;
    --line: #d9dee2;
    --soft: #eef1f2;
    --paper: #ffffff;
    --accent: #e95133;
    --accent-dark: #bd3219;
    --green: #237a52;
    --green-soft: #e9f5ee;
    --warning: #a43e22;
    --warning-soft: #fff0eb;
    --focus: #136b9b;
    --shadow: 0 12px 34px rgba(24, 30, 34, 0.14);
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(19, 107, 155, 0.3);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow,
.group-kicker {
    margin: 0;
    color: var(--accent-dark);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
    border: 0;
    cursor: pointer;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.7rem 1.1rem;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 750;
}

.primary-button:hover {
    background: var(--accent-dark);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.68;
}

.secondary-button {
    min-height: 42px;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--ink);
    border-radius: 5px;
    background: var(--paper);
    font-weight: 700;
}

.text-button {
    padding: 0.45rem 0;
    background: transparent;
    color: var(--accent-dark);
    font-weight: 750;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    font-size: 1.45rem;
}

/* Login */
.login-page {
    min-height: 100vh;
    background: #e9edef;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, 560px) minmax(360px, 1fr);
    min-height: 100vh;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 7vw, 6rem);
    background: var(--paper);
}

.login-logo {
    width: auto;
    max-width: 100%;
    height: 200px;
    align-self: center;
    object-fit: contain;
    object-position: center;
    margin-bottom: 2.5rem;
}

.login-heading {
    margin-bottom: 2rem;
}

.login-heading h1 {
    max-width: 440px;
    margin: 0.35rem 0 0.7rem;
    font-size: clamp(2rem, 5vh, 3.3rem);
    line-height: 1.04;
}

.login-heading p:last-child {
    max-width: 430px;
    margin: 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 0.55rem;
    max-width: 430px;
}

.auth-form > label:not(.check-row) {
    margin-top: 0.7rem;
    font-size: 0.88rem;
    font-weight: 750;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    width: 100%;
    height: 50px;
    padding: 0 0.9rem;
    border: 1px solid #aeb6bc;
    border-radius: 5px;
    background: #fff;
}

.auth-switch {
    width: fit-content;
    max-width: 430px;
    margin-top: 1rem;
    color: var(--focus);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-switch:hover {
    text-decoration: underline;
}

.password-requirements,
.field-hint {
    color: var(--muted);
    font-size: 0.8rem;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3.2rem !important;
}

.password-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
}

.check-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin: 0.8rem 0;
    color: #42494f;
    cursor: pointer;
}

.check-row input,
.brand-options input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.form-message {
    padding: 0.75rem 0.9rem;
    border-left: 4px solid var(--warning);
    background: var(--warning-soft);
    color: #722511;
    font-size: 0.9rem;
}

.form-message.is-success {
    border-left-color: var(--green);
    background: var(--green-soft);
    color: #165f3e;
}

.login-button {
    width: 100%;
    margin-top: 0.25rem;
}

.login-button.is-loading span:first-child::after {
    content: " ...";
}

.login-context {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: clamp(2rem, 6vw, 6rem);
    background: var(--ink);
    color: #fff;
}

.login-context::before {
    content: "";
    display: block;
    width: 92px;
    height: 8px;
    margin-bottom: auto;
    background: var(--accent);
}

.login-context > div {
    margin: auto 0;
}

.login-context .eyebrow {
    color: #ff9d87;
}

.login-context h2 {
    max-width: 650px;
    margin: 0.55rem 0;
    font-size: clamp(2.4rem, 6vw, 5.8rem);
    line-height: 0.98;
}

.login-context > p {
    color: #b7bec3;
}

/* Shop shell */
.shop-page {
    min-height: 100vh;
    padding-bottom: 110px;
    background: var(--soft);
}

.shop-header {
    position: sticky;
    z-index: 40;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.header-inner,
.catalog-tools,
.global-search-inner,
.group-nav-inner,
.catalog,
.catalog-status,
.catalog-error {
    width: min(1440px, calc(100% - 40px));
    margin-inline: auto;
}

.header-inner {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand-link img {
    width: 48px;
    height: 46px;
    object-fit: contain;
}

.brand-link span {
    border-left: 1px solid var(--line);
    padding-left: 0.9rem;
}

.customer-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.customer-name {
    max-width: min(38vw, 420px);
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-menu form {
    margin: 0;
}

.catalog-tools {
    padding-block: clamp(2rem, 5vw, 4.5rem) 1.25rem;
    background: var(--soft);
}

.catalog-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.75rem;
}

.catalog-intro h1 {
    margin: 0.2rem 0 0;
    font-size: clamp(2.1rem, 5vw, 3rem);
    line-height: 1;
}

.catalog-intro > p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
}

.search-field {
    position: relative;
    display: flex;
    min-height: 48px;
    align-items: center;
    border: 1px solid #aab2b8;
    border-radius: 6px;
    background: var(--paper);
}

.global-search {
    min-height: 58px;
}

.global-search-sticky {
    position: sticky;
    z-index: 35;
    top: 72px;
    padding-block: 12px;
    background: var(--soft);
}

.search-field:focus-within {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(19, 107, 155, 0.13);
}

.search-field input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0.75rem 3rem 0.75rem 3rem;
    border: 0;
    outline: 0;
    background: transparent;
}

.search-icon {
    position: absolute;
    left: 1rem;
    filter: grayscale(1);
    font-size: 0.95rem;
}

.clear-search {
    position: absolute;
    right: 0.35rem;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    font-size: 1.35rem;
}

.group-nav {
    position: sticky;
    z-index: 30;
    top: 154px;
    overflow: hidden;
    border-block: 1px solid var(--line);
    background: #fff;
}

.group-nav-inner {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
}

.group-nav a {
    flex: 0 0 auto;
    padding: 0.9rem 1rem 0.75rem;
    border-bottom: 3px solid transparent;
    color: #4d555b;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.group-nav a:first-child {
    padding-left: 0;
}

.group-nav a.is-active {
    border-bottom-color: var(--accent);
    color: var(--ink);
}

.catalog-status,
.catalog-error {
    display: flex;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--muted);
}

.catalog-error {
    flex-direction: column;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #c7cdd1;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

.catalog {
    padding-block: 2rem 4rem;
}

.product-group {
    scroll-margin-top: 216px;
    margin-bottom: 1.5rem;
    border: 1px solid #cbd1d5;
    border-radius: 8px;
    background: var(--paper);
    overflow: clip;
}

.group-heading {
    background: #f8f9f9;
}

.group-toggle {
    display: flex;
    width: 100%;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.3rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.group-name {
    display: block;
    margin-top: 0.1rem;
    font-size: 1.35rem;
}

.group-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.toggle-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 1.25rem;
}

.group-content {
    border-top: 1px solid var(--line);
}

.group-filters {
    display: grid;
    grid-template-columns: minmax(250px, 0.7fr) minmax(280px, 1.3fr) auto;
    gap: 1.5rem;
    align-items: end;
    padding: 1.2rem 1.3rem;
    background: #fff;
}

.brand-filters,
.availability-filter {
    min-width: 0;
    padding: 0;
    border: 0;
}

.brand-filters legend,
.availability-filter legend {
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
}

.brand-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
}

.brand-options label,
.availability-filter label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
}

.product-card {
    display: flex;
    min-width: 0;
    min-height: 300px;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.3rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.product-card.visible-third {
    border-right: 0;
}

.product-card.has-quantity {
    box-shadow: inset 4px 0 0 var(--green);
}

.product-card.over-stock {
    box-shadow: inset 4px 0 0 var(--warning);
}

.product-topline {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.product-brand {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.stock-status {
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 750;
    text-align: right;
}

.stock-status.is-empty {
    color: var(--warning);
}

.product-name {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.12rem;
    line-height: 1.3;
}

.product-description {
    display: -webkit-box;
    margin: 0.75rem 0 0;
    overflow: hidden;
    color: #525a60;
    font-size: 0.88rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.set-contents {
    margin-top: 1rem;
    padding: 0.8rem 0.9rem;
    border-left: 3px solid var(--focus);
    background: #eef6fa;
}

.set-contents > strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #174f6c;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.set-contents ul {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.set-contents li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem;
    color: #39464d;
    font-size: 0.82rem;
}

.set-contents li strong {
    color: #174f6c;
    white-space: nowrap;
}

.set-contents li span {
    overflow-wrap: anywhere;
}

.product-buy {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.product-price strong,
.product-price span,
.product-price small {
    display: block;
}

.product-price-values {
    display: flex;
    min-height: 1.9rem;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
}

.product-price-values del {
    color: var(--muted);
    font-size: 0.86rem;
}

.product-price-values.has-price-change .current-price {
    color: var(--green);
}

.product-price strong {
    font-size: 1.25rem;
}

.product-price span,
.product-price small {
    color: var(--muted);
    font-size: 0.72rem;
}

.product-price small {
    min-height: 1.1em;
    color: var(--green);
}

.tier-prices {
    position: relative;
    margin-top: 0.25rem;
}

.tier-trigger {
    padding: 0;
    border: 0;
    border-bottom: 1px dotted currentColor;
    background: transparent;
    color: var(--focus);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 750;
}

.tier-tooltip {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 8px);
    left: 0;
    width: max-content;
    min-width: 220px;
    padding: 0.55rem;
    border: 1px solid #aab4ba;
    border-radius: 5px;
    background: #fff;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.tier-prices:hover .tier-tooltip,
.tier-prices:focus-within .tier-tooltip,
.tier-prices.is-open .tier-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tier-tooltip table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.tier-tooltip th,
.tier-tooltip td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.tier-tooltip th:last-child,
.tier-tooltip td:last-child {
    text-align: right;
}

.tier-tooltip tbody tr:last-child td {
    border-bottom: 0;
}

.tier-tooltip tbody tr.is-active td {
    background: var(--green-soft);
    color: #165f3e;
    font-weight: 800;
}

.quantity-control {
    display: grid;
    grid-template-columns: 38px 54px 38px;
    width: 130px;
    height: 42px;
    flex: 0 0 130px;
    border: 1px solid #aab2b8;
    border-radius: 5px;
    overflow: hidden;
}

.quantity-control button,
.quantity-control input {
    min-width: 0;
    border: 0;
    background: #fff;
    text-align: center;
}

.quantity-control button {
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 800;
}

.quantity-control button:hover {
    background: #edf0f1;
}

.quantity-control input {
    width: 100%;
    border-inline: 1px solid var(--line);
    appearance: textfield;
    font-weight: 750;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.stock-warning {
    margin: -0.55rem 0 0;
    padding: 0.55rem 0.7rem;
    border-left: 3px solid var(--warning);
    background: var(--warning-soft);
    color: #722511;
    font-size: 0.78rem;
}

.group-empty {
    margin: 0;
    padding: 2.5rem 1.3rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

/* Cart */
.cart {
    position: fixed;
    z-index: 60;
    right: max(20px, calc((100vw - 1440px) / 2));
    bottom: 18px;
    width: min(660px, calc(100% - 40px));
}

.cart-bar {
    display: flex;
    width: 100%;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.1rem;
    border: 0;
    border-radius: 7px;
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.cart-bar-label,
.cart-bar-total {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-bar-label {
    font-weight: 800;
}

.cart-count-badge {
    display: grid;
    min-width: 34px;
    height: 34px;
    padding-inline: 0.35rem;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
}

.cart-bar-total small {
    color: #bfc5c9;
}

.cart-bar-total del {
    color: #bfc5c9;
    font-size: 0.76rem;
}

.cart-chevron {
    width: 18px;
    color: #bfc5c9;
    text-align: center;
}

.cart-sheet {
    max-height: min(68vh, 640px);
    margin-bottom: 0.6rem;
    overflow: auto;
    border: 1px solid #bcc3c8;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.cart.is-open .cart-sheet {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cart:not(.is-open) .cart-sheet {
    position: absolute;
    right: 0;
    bottom: 70px;
    left: 0;
    visibility: hidden;
}

.cart-sheet-header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.cart-sheet-header h2 {
    margin: 0.1rem 0 0;
    font-size: 1.3rem;
}

.cart-lines {
    padding-inline: 1.2rem;
}

.cart-group-heading {
    margin: 0 -1.2rem;
    padding: 0.65rem 1.2rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #f4f6f6;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
}

.cart-group-heading:first-child {
    border-top: 0;
}

.payment-methods,
.checkout-options {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 1rem 1.2rem 1.2rem;
    border: 0;
    border-top: 1px solid var(--line);
}

.payment-methods legend,
.checkout-options legend {
    width: auto;
    margin-bottom: 0.65rem;
    margin-inline: auto;
    padding-inline: 0.75rem;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

.payment-option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    min-height: 48px;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 5px;
    cursor: pointer;
}

.payment-option:has(> input:checked) {
    border-color: var(--focus);
    background: #eef6fa;
}

.payment-option > input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--focus);
}

.payment-option span,
.payment-option strong,
.payment-option small {
    display: block;
}

.payment-option small {
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.payment-option.is-disabled {
    background: #f1f2f3;
    color: #8a9196;
    cursor: not-allowed;
}

.payment-option.is-disabled small {
    color: #8a9196;
}

.delivery-address-fields {
    margin-top: 0.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.delivery-address-fields > strong,
.delivery-address-fields > small {
    display: block;
}

.delivery-address-fields > strong {
    margin-bottom: 0.7rem;
    font-size: 0.86rem;
}

.delivery-address-fields > small {
    margin-top: 0.55rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.delivery-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.delivery-field {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 700;
}

.delivery-field-wide {
    grid-column: 1 / -1;
}

.delivery-field input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0.45rem 0.55rem;
    border: 1px solid #aeb6bc;
    border-radius: 4px;
    background: #fff;
    color: var(--text);
}

.delivery-field input:focus {
    border-color: var(--focus);
    outline: 2px solid rgba(13, 111, 158, 0.18);
}

.desired-date-input {
    width: min(calc(100% - 48px), 230px);
    min-height: 38px;
    margin: -0.15rem 0 0.1rem 48px;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.desired-date-input:focus {
    border-color: var(--focus);
    outline: 2px solid rgba(13, 111, 158, 0.18);
}

.desired-date-input:disabled {
    background: #e5e7e8;
    color: #8a9196;
}

.payment-message {
    margin: 0.15rem 0 0;
    color: var(--warning);
    font-size: 0.78rem;
}

.cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
}

.cart-line.over-stock {
    border-left: 3px solid var(--warning);
    padding-left: 0.8rem;
}

.cart-line-copy strong,
.cart-line-copy span,
.cart-line-copy small {
    display: block;
}

.cart-line-copy strong {
    overflow-wrap: anywhere;
}

.cart-line-copy > span {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.cart-line-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: baseline;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.cart-line-meta del,
.cart-line-old-sum {
    color: var(--muted);
}

.cart-line-meta strong,
.cart-line-sum {
    color: var(--green);
}

.cart-line-old-sum {
    font-size: 0.78rem;
}

.cart-line-sums,
.cart-total-values {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.45rem;
    white-space: nowrap;
}

.cart-line-copy small {
    margin-top: 0.35rem;
    color: var(--warning);
    font-weight: 700;
}

.cart-line-actions {
    display: grid;
    justify-items: end;
    gap: 0.4rem;
}

.quantity-control-small {
    grid-template-columns: 34px 48px 34px;
    width: 116px;
    height: 36px;
    flex-basis: 116px;
}

.remove-line {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--warning);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 750;
}

.empty-cart {
    margin: 0;
    padding: 2.5rem 0;
    color: var(--muted);
    text-align: center;
}

.cart-totals {
    padding: 0.65rem 1.2rem;
    border-top: 1px solid var(--line);
    background: #f7f8f8;
}

.cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 30px;
}

.cart-total-row-gross {
    min-height: 38px;
}

.cart-total-row-gross > :last-child {
    color: var(--green);
}

.checkout-action {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.55rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}

.checkout-action .primary-button {
    width: 100%;
}

.checkout-message {
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
}

.checkout-message.is-success {
    border-color: #83aa91;
    color: var(--green);
}

.checkout-message.is-error {
    border-color: #d7a493;
    color: var(--warning);
}

.cart-total-values del {
    color: var(--muted);
    font-size: 0.8rem;
}

.cart-total-values strong {
    color: var(--green);
}

@media (min-width: 1100px) {
    .cart {
        width: min(825px, calc(100% - 40px));
    }
}

@media (max-width: 1050px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-card.visible-third {
        border-right: 1px solid var(--line);
    }

    .product-card.visible-second {
        border-right: 0;
    }
}

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-panel {
        min-height: 100vh;
        padding: 2rem max(1.25rem, 7vw);
    }

    .login-logo {
        margin-bottom: 1.5rem;
    }

    .login-context {
        display: none;
    }

    .header-inner,
    .catalog-tools,
    .global-search-inner,
    .group-nav-inner,
    .catalog,
    .catalog-status,
    .catalog-error {
        width: min(100% - 28px, 1440px);
    }

    .catalog-intro {
        display: block;
    }

    .catalog-intro > p {
        margin-top: 1rem;
    }

    .group-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cart {
        right: 14px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 28px);
    }

    .cart.is-open {
        top: max(10px, env(safe-area-inset-top));
        display: flex;
        flex-direction: column;
        max-height: none;
        overflow: hidden;
    }

    .cart.is-open .cart-sheet {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .cart.is-open .cart-bar {
        flex: 0 0 auto;
    }
}

@media (max-width: 620px) {
    .shop-page {
        padding-bottom: 96px;
    }

    .header-inner {
        min-height: 64px;
    }

    .brand-link img {
        width: 42px;
        height: 40px;
    }

    .brand-link span,
    .customer-name {
        display: none;
    }

    .group-nav {
        top: 140px;
    }

    .product-group {
        scroll-margin-top: 202px;
    }

    .global-search-sticky {
        top: 64px;
    }

    .catalog-tools {
        padding-top: 1.8rem;
    }

    .catalog-intro h1 {
        font-size: 2.2rem;
    }

    .global-search {
        min-height: 52px;
    }

    .group-toggle {
        min-height: 70px;
        padding: 0.85rem 1rem;
    }

    .group-count {
        display: none;
    }

    .group-filters {
        padding: 1rem;
    }

    .brand-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand-options label {
        min-width: 0;
        white-space: normal;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .delivery-address-grid {
        grid-template-columns: 1fr;
    }

    .delivery-field-wide {
        grid-column: auto;
    }

    .product-card,
    .product-card.visible-second,
    .product-card.visible-third {
        min-height: 0;
        border-right: 0;
    }

    .product-buy {
        align-items: center;
    }

    .cart-bar {
        min-height: 60px;
        padding: 0.65rem 0.85rem;
    }

    .cart-line {
        grid-template-columns: 1fr;
    }

    .cart-line-actions {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        justify-items: start;
    }

    .cart-line-sums {
        justify-self: start;
    }

    .remove-line {
        grid-column: 2;
        justify-self: center;
    }
}

@media (max-width: 390px) {
    .product-buy {
        display: grid;
        grid-template-columns: 1fr;
    }

    .product-card .quantity-control {
        width: 100%;
        grid-template-columns: 44px minmax(50px, 1fr) 44px;
    }

    .cart-bar-total small {
        display: none;
    }
}

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