:root {
    color-scheme: light;
    --bg: #f7f8fb;
    --surface: #fff;
    --surface-2: #eef2f7;
    --text: #172033;
    --muted: #677188;
    --border: #dbe1ea;
    --primary: #1769e0;
    --primary-hover: #0f55bb;
    --danger: #c62828;
    --success: #18794e;
    --shadow: 0 10px 30px rgba(20,35,70,.09)
}

    :root[data-theme="dark"] {
        color-scheme: dark;
        --bg: #0f1724;
        --surface: #172132;
        --surface-2: #202c40;
        --text: #edf2f8;
        --muted: #a8b2c5;
        --border: #334155;
        --primary: #65a4ff;
        --primary-hover: #8bbaff;
        --danger: #ff8585;
        --success: #61d6a3;
        --shadow: 0 12px 36px rgba(0,0,0,.32)
    }

* {
    box-sizing: border-box
}

html {
    background: var(--bg);
    color: var(--text);
    font-family: Inter,Segoe UI,Arial,sans-serif
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text)
}

a {
    color: var(--primary);
    text-decoration: none
}

button,
input,
select {
    font: inherit
}

/* SELECT DARK/LIGHT TEMA DÜZELTMESİ */
select {
    /* appearance:none olsa bile Chromium/Edge, color-scheme: dark kalıtımı yüzünden seçim/odak
       anında native koyu vurgulama çizebiliyor; bunu tamamen kendi CSS'imizle yönettiğimiz için kapatıyoruz */
    color-scheme: light;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2 4l5 5 5-5' fill='none' stroke='%23677188' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    background-size: 14px;
    padding-right: 2.4rem;
    color: var(--text);
}

    select:focus,
    select:focus-visible {
        outline: none;
        border-color: var(--primary);
    }

    select option {
        background-color: var(--bg);
        color: var(--text);
    }

    select optgroup {
        background-color: var(--bg);
        color: var(--text);
    }

:root[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2 4l5 5 5-5' fill='none' stroke='%23a8b2c5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] select,
:root[data-theme="dark"] select option,
:root[data-theme="dark"] select optgroup {
    background-color: var(--bg);
    color: var(--text);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 64px;
    padding: max(.55rem,env(safe-area-inset-top)) max(1rem,env(safe-area-inset-right)) .55rem max(1rem,env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 1rem;
    background: color-mix(in srgb,var(--surface) 94%,transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px)
}

.brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--text);
    font-weight: 800
}

    .brand img {
        width: 38px;
        height: 38px;
        object-fit: contain
    }

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem
}

    .main-nav a {
        color: var(--text);
        font-weight: 600;
        white-space: nowrap
    }

.header-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: .65rem
}

.language-form {
    display: flex;
    align-items: center;
    gap: .3rem
}

    .language-form select {
        max-width: 125px;
        border: 0;
        background-color: var(--surface);
        color: var(--text)
    }

        .language-form select option {
            background-color: var(--surface);
            color: var(--text)
        }

.icon-button,
.link-button {
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px
}

.customer-bar {
    display: none
}

@media(max-width:760px) {
    .topbar {
        flex-wrap: wrap;
        row-gap: .25rem
    }

    .topbar:has(.customer-bar) .customer-switch {
        display: none !important
    }

    .customer-bar {
        order: 99;
        flex-basis: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        padding-top: .3rem;
        border-top: 1px solid var(--border)
    }

    .customer-bar-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 600
    }

    .customer-bar .link-button {
        flex-shrink: 0;
        min-height: 36px;
        color: var(--primary)
    }
}

a.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap
}

.menu-toggle {
    display: none
}

.page-shell {
    width: min(1200px,100%);
    margin: auto;
    padding: 1.25rem max(1rem,env(safe-area-inset-right)) 3rem max(1rem,env(safe-area-inset-left))
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .7rem 1.1rem;
    border: 0;
    border-radius: .65rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer
}

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

    .button.small {
        min-height: 38px;
        padding: .45rem .8rem
    }

    .button.secondary {
        background: var(--surface-2);
        color: var(--text);
        border: 1px solid var(--border)
    }

.card,
.state-card,
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow)
}

.state-card,
.form-card {
    max-width: 560px;
    margin: 8vh auto;
    padding: clamp(1.25rem,4vw,2.5rem)
}

.field {
    display: grid;
    gap: .35rem;
    margin-bottom: 1rem
}

    .field input,
    .field select {
        width: 100%;
        min-height: 46px;
        padding: .7rem .8rem;
        border: 1px solid var(--border);
        border-radius: .6rem;
        background: var(--bg);
        color: var(--text)
    }

.validation-summary-errors,
.error {
    color: var(--danger)
}

.state-card.error-detail-card {
    max-width: min(1100px, calc(100vw - 2rem));
    margin-top: 3vh
}

.error-meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .4rem 1rem;
    margin: 1.25rem 0
}

.error-meta dt {
    font-weight: 700
}

.error-meta dd {
    margin: 0;
    overflow-wrap: anywhere
}

.error-details {
    margin: 1rem 0 1.5rem
}

.error-details summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: .75rem
}

.error-details pre {
    max-height: 55vh;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: .65rem;
    background: var(--bg);
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere
}

.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
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem
}

.muted {
    color: var(--muted)
}

@media(max-width:760px) {
    .topbar {
        gap: .35rem
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center
    }

    .main-nav {
        display: none;
        position: absolute;
        inset-inline: 0;
        top: 100%;
        padding: 1rem;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        flex-direction: column
    }

        .main-nav.open {
            display: flex
        }

    .brand span,
    .user-name {
        display: none
    }

    .header-actions {
        gap: .15rem
    }

    .language-form select {
        width: 48px;
        max-width: 48px
    }

    .page-shell {
        padding-top: 1rem
    }

    .page-head {
        align-items: start;
        flex-direction: column
    }
}

@media(prefers-reduced-motion:reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important
    }
}

.button.full {
    width: 100%
}

.login-logo {
    text-align: center
}

    .login-logo img {
        width: min(180px,60%);
        max-height: 100px;
        object-fit: contain
    }

.search-form {
    display: flex;
    gap: .5rem
}

.search-input-wrap {
    position: relative;
    min-width: min(330px,60vw)
}

    .search-form input {
        width: 100%;
        min-height: 44px;
        padding: .6rem 2.4rem .6rem .8rem;
        border: 1px solid var(--border);
        border-radius: .65rem;
        background: var(--surface);
        color: var(--text)
    }

.search-clear {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer
}

    .search-clear:hover {
        background: var(--surface-2);
        color: var(--text)
    }

    .search-clear[hidden] {
        display: none
    }

.category-strip {
    display: flex;
    gap: .65rem;
    overflow-x: auto;
    padding: .25rem 0 1rem;
    scrollbar-width: thin
}

.category-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text)
}

    .category-chip.active {
        border-color: var(--primary);
        color: var(--primary)
    }

    .category-chip img {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover
    }

.product-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 1rem
}

.product-card {
    overflow: hidden
}

    .product-card a {
        display: block;
        color: var(--text)
    }

    .product-card a.button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff
    }

.product-image {
    aspect-ratio: 1/1;
    background: var(--surface-2)
}

    .product-image img,
    .detail-image img {
        width: 100%;
        height: 100%;
        object-fit: contain
    }

.product-body {
    padding: 1rem
}

    .product-body h2 {
        font-size: 1rem;
        line-height: 1.35;
        margin: .3rem 0;
        min-height: 2.7em
    }

.barcode {
    font-size: .8rem
}

.price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    margin-top: .8rem
}

    .price del {
        color: var(--muted)
    }

    .price strong {
        color: var(--primary);
        font-size: 1.15rem
    }

    .price.large strong {
        font-size: 1.7rem
    }

.pager {
    display: flex;
    justify-content: center;
    gap: .7rem;
    margin-top: 1.25rem
}

.detail-card {
    display: grid;
    grid-template-columns: minmax(280px,1fr) minmax(280px,1fr);
    overflow: hidden
}

.detail-image {
    min-height: 420px;
    background: var(--surface-2)
}

.detail-content {
    padding: clamp(1.2rem,4vw,3rem)
}

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

@media(max-width:760px) {
    .search-form {
        width: 100%
    }

        .search-input-wrap {
            min-width: 0;
            flex: 1
        }

    .product-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: .65rem
    }

    .product-body {
        padding: .75rem
    }

    .detail-card {
        grid-template-columns: 1fr
    }

    .detail-image {
        min-height: 0;
        aspect-ratio: 1/1
    }
}

@media(max-width:359px) {
    .product-grid {
        grid-template-columns: 1fr
    }
}

.account-heading {
    align-items: stretch
}

.balance-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: grid;
    gap: .3rem;
    min-width: 230px
}

    .balance-card strong {
        font-size: 1.55rem
    }

    .balance-card .button {
        margin-top: .5rem
    }

.filter-bar {
    display: flex;
    gap: .75rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1rem
}

    .filter-bar label {
        display: grid;
        gap: .3rem
    }

    .filter-bar input,
    .form-card input,
    .form-card textarea {
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text);
        padding: .75rem
    }

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface)
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px
}

    .data-table th,
    .data-table td {
        padding: .85rem 1rem;
        border-bottom: 1px solid var(--border);
        text-align: left
    }

    .data-table th {
        background: var(--surface-2);
        font-size: .85rem
    }

    .data-table .number {
        text-align: right
    }

    .data-table tr:last-child td {
        border-bottom: 0
    }

.form-card {
    max-width: 520px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius)
}

    .form-card form,
    .form-card label {
        display: grid;
        gap: .45rem
    }

    .form-card form {
        gap: .75rem
    }

.payment-amount {
    display: grid;
    gap: .55rem;
    padding: 1rem;
    background: var(--surface-2);
    border-radius: 12px;
    margin: 1rem 0
}

    .payment-amount label {
        display: grid;
        gap: .45rem
    }

    .payment-amount-input {
        display: flex;
        align-items: center;
        gap: .65rem
    }

    .payment-amount-input input {
        width: 100%;
        min-width: 0;
        font-size: 1.35rem;
        font-weight: 700
    }

    .payment-amount-input strong {
        font-size: 1.25rem
    }

.validation,
.field-validation-error {
    color: #c83232
}

.payment-frame iframe {
    display: block;
    width: 100%;
    min-height: 650px;
    border: 0;
    touch-action: auto
}

.result-card {
    text-align: center;
    max-width: 560px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius)
}

.result-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 2rem;
    margin: auto
}

@media(max-width:700px) {
    .account-heading {
        display: grid
    }

    .balance-card {
        min-width: 0
    }

    .filter-bar > * {
        flex: 1 1 140px
    }

    .filter-bar .button {
        flex-basis: 100%
    }

    .data-table th,
    .data-table td {
        padding: .7rem
    }

    .form-card {
        margin: .75rem 0;
        padding: 1rem
    }

    .payment-frame iframe {
        min-height: 720px
    }
}

.catalog-page-head {
    margin-bottom: 1.25rem
}

.catalog-workspace {
    display: grid;
    grid-template-columns: 240px minmax(0,1fr);
    gap: 1.15rem;
    align-items: start
}

.category-sidebar {
    position: sticky;
    top: 82px;
    overflow: hidden;
    max-height: calc(100vh - 100px);
    box-shadow: none
}

.category-sidebar-title {
    display: grid;
    gap: .25rem;
    padding: 1rem 1rem .8rem;
    border-bottom: 1px solid var(--border)
}

    .category-sidebar-title strong {
        text-transform: uppercase;
        letter-spacing: .08em;
        font-size: .78rem;
        color: var(--primary)
    }

    .category-sidebar-title span {
        font-size: .78rem
    }

.category-list {
    padding: .55rem;
    overflow-y: auto;
    max-height: calc(100vh - 175px)
}

.category-list-item {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    align-items: center;
    gap: .7rem;
    min-height: 54px;
    padding: .4rem .55rem;
    border-radius: .75rem;
    color: var(--text);
    font-weight: 650;
    line-height: 1.2
}

    .category-list-item:hover {
        background: var(--surface-2)
    }

    .category-list-item.active {
        background: color-mix(in srgb,var(--primary) 14%,var(--surface));
        color: var(--primary)
    }

    .category-list-item img,
    .category-all-icon {
        width: 42px;
        height: 42px;
        border-radius: .65rem;
        object-fit: cover;
        background: var(--surface-2)
    }

.category-all-icon {
    display: grid;
    place-items: center;
    font-size: 1.25rem
}

.category-arrow {
    font-size: 1.35rem;
    color: var(--muted)
}

.catalog-content {
    min-width: 0
}

.catalog-content-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: .1rem 0 .8rem
}

    .catalog-content-head h2 {
        margin: .25rem 0 0;
        font-size: clamp(1.35rem,2vw,1.8rem)
    }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800
}

.subcategory-strip {
    display: flex;
    gap: .7rem;
    overflow-x: auto;
    padding: .1rem .1rem 1rem;
    scrollbar-width: thin
}

.subcategory-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 60px;
    max-width: 190px;
    padding: .5rem .8rem;
    border: 1px solid var(--border);
    border-radius: .8rem;
    background: var(--surface);
    color: var(--text);
    font-weight: 700
}

    .subcategory-card:hover,
    .subcategory-card.active {
        border-color: var(--primary);
        color: var(--primary);
        background: color-mix(in srgb,var(--primary) 8%,var(--surface))
    }

    .subcategory-card img {
        width: 44px;
        height: 44px;
        border-radius: .6rem;
        object-fit: cover
    }

.catalog-empty {
    max-width: none;
    margin: 0;
    padding: 2rem;
    text-align: center
}

.catalog-content .product-grid {
    grid-template-columns: repeat(4,minmax(0,1fr))
}

@media(max-width:1100px) {
    .catalog-workspace {
        grid-template-columns: 210px minmax(0,1fr)
    }

    .catalog-content .product-grid {
        grid-template-columns: repeat(3,minmax(0,1fr))
    }
}

@media(max-width:760px) {
    .catalog-page-head {
        margin-bottom: .75rem
    }

    .catalog-workspace {
        display: flex;
        flex-direction: column;
        gap: .75rem
    }

    .category-sidebar {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none
    }

    .category-sidebar-title {
        display: none
    }

    .category-list {
        display: flex;
        gap: .55rem;
        width: 100%;
        max-height: none;
        padding: .1rem 0 .25rem;
        overflow-x: auto
    }

    .category-list-item {
        flex: 0 0 auto;
        display: flex;
        min-height: 48px;
        padding: .35rem .65rem;
        border: 1px solid var(--border);
        background: var(--surface)
    }

        .category-list-item img,
        .category-all-icon {
            width: 34px;
            height: 34px
        }

    .category-arrow {
        display: none
    }

    .catalog-content {
        width: 100%
    }

    .catalog-content-head {
        margin-top: .2rem
    }

    .subcategory-strip {
        padding-bottom: .75rem
    }

    .subcategory-card {
        min-height: 50px
    }

        .subcategory-card img {
            width: 36px;
            height: 36px
        }

    .catalog-content .product-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }
}

@media(max-width:359px) {
    .catalog-content .product-grid {
        grid-template-columns: 1fr
    }
}

.subcategory-levels {
    display: grid;
    gap: .15rem;
    margin-bottom: .35rem
}

    .subcategory-levels .subcategory-strip {
        position: relative;
        margin: 0
    }

        .subcategory-levels .subcategory-strip + .subcategory-strip {
            padding-inline-start: 1rem;
            border-inline-start: 3px solid color-mix(in srgb,var(--primary) 32%,var(--border))
        }

            .subcategory-levels .subcategory-strip + .subcategory-strip::before {
                content: '↳';
                flex: 0 0 auto;
                align-self: center;
                color: var(--primary);
                font-size: 1.1rem
            }

@media(max-width:760px) {
    .subcategory-levels .subcategory-strip + .subcategory-strip {
        padding-inline-start: .6rem
    }
}

.cart-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--text);
    border-radius: 50%
}

    .cart-button:hover {
        background: var(--surface-2)
    }

    .cart-button svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round
    }

.cart-badge {
    position: absolute;
    top: 1px;
    right: 0;
    display: grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid var(--surface);
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 800
}

.product-card {
    display: flex;
    flex-direction: column
}

.product-main-link {
    flex: 1
}

.product-add-form {
    padding: 0 .75rem .75rem
}

.checkout-line-mix {
    display: block;
    font-size: .8rem
}

.product-add-quantity {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .5rem
}

    .product-add-quantity .quantity-stepper {
        flex: 0 0 auto
    }

        .product-add-quantity .quantity-stepper input[type=number] {
            width: 48px;
            background-color: var(--bg);
            color: var(--text)
        }

    .product-add-quantity .button {
        flex: 1 1 110px;
        white-space: nowrap
    }

.detail-add-form {
    display: flex;
    align-items: end;
    gap: .75rem;
    margin: 1.25rem 0
}

    .detail-add-form label {
        display: grid;
        gap: .35rem
    }

    .detail-add-form input,
    .cart-quantity input,
    .checkout-payment input,
    .checkout-payment textarea,
    .checkout-payment select {
        min-height: 44px;
        padding: .65rem .75rem;
        border: 1px solid var(--border);
        border-radius: .65rem;
        background-color: var(--bg);
        color: var(--text)
    }

    .checkout-payment select {
        padding-right: 2.4rem
    }

    .detail-add-form input {
        width: 110px
    }

.notice {
    padding: .85rem 1rem;
    border-radius: .75rem;
    margin-bottom: 1rem
}

    .notice.success {
        background: color-mix(in srgb,var(--success) 14%,var(--surface));
        color: var(--success)
    }

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 300px;
    gap: 1rem;
    align-items: start
}

.cart-lines {
    display: grid;
    gap: .75rem
}

.cart-line {
    display: grid;
    grid-template-columns: 92px minmax(0,1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: .75rem;
    box-shadow: none
}

.cart-line-image {
    width: 92px;
    height: 92px;
    border-radius: .75rem;
    overflow: hidden;
    background: var(--surface-2)
}

    .cart-line-image img {
        width: 100%;
        height: 100%;
        object-fit: contain
    }

.cart-line-info {
    display: grid;
    gap: .3rem
}

    .cart-line-info a {
        color: var(--text)
    }

.cart-quantity {
    display: flex;
    gap: .4rem
}

    .cart-quantity input {
        width: 100px
    }

.cart-line-total {
    min-width: 110px;
    text-align: right
}

.cart-summary {
    position: sticky;
    top: 82px;
    display: grid;
    gap: .85rem;
    padding: 1.25rem;
    box-shadow: none
}

    .cart-summary > strong {
        font-size: 1.65rem
    }

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(340px,480px);
    gap: 1rem;
    align-items: start
}

.checkout-products,
.checkout-payment {
    padding: 1.25rem;
    box-shadow: none
}

    .checkout-products h2,
    .checkout-payment h2 {
        margin-top: 0
    }

.checkout-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--border)
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    font-size: 1.2rem
}

    .checkout-total strong {
        font-size: 1.45rem
    }

.checkout-payment form,
.card-contact-fields {
    display: grid;
    gap: .7rem
}

    .card-contact-fields label {
        display: grid;
        gap: .3rem
    }

.checkout-order-extra {
    grid-template-columns: repeat(3,minmax(0,1fr))
}

    .checkout-field {
        display: flex;
        flex-direction: column;
        gap: .3rem
    }

        .checkout-field label {
            display: flex;
            flex-direction: column;
            gap: .3rem;
            flex: 1
        }

        .checkout-field textarea,
        .checkout-field input,
        .checkout-field select {
            flex: 1
        }

@media(max-width:700px) {
    .checkout-order-extra {
        grid-template-columns: 1fr
    }
}

.checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
    margin-top: .6rem
}

.checkout-choice {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 92px;
    padding: .9rem;
    border: 1px solid var(--border);
    border-radius: .85rem;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    cursor: pointer
}

    .checkout-choice:hover {
        border-color: var(--primary);
        background: color-mix(in srgb,var(--primary) 8%,var(--surface))
    }

    .checkout-choice > span:last-child {
        display: grid;
        gap: .25rem
    }

    .checkout-choice small {
        color: var(--muted);
        line-height: 1.3
    }

.choice-icon {
    font-size: 1.65rem;
    color: var(--primary)
}

@media(max-width:850px) {
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr
    }

    .cart-summary {
        position: static
    }

    .cart-line {
        grid-template-columns: 72px minmax(0,1fr) auto
    }

    .cart-line-image {
        width: 72px;
        height: 72px
    }

    .cart-line-total {
        grid-column: 2/4;
        text-align: left
    }

    .checkout-payment {
        order: -1
    }
}

@media(max-width:560px) {
    .product-add-form {
        padding: 0 .55rem .55rem
    }

        .product-add-form .button {
            font-size: .82rem;
            padding: .55rem
        }

    .product-add-quantity .quantity-stepper {
        flex-basis: 100%
    }

        .product-add-quantity .quantity-stepper input[type=number] {
            flex: 1;
            width: auto
        }

    .detail-add-form {
        align-items: stretch;
        flex-direction: column
    }

        .detail-add-form input {
            width: 100%
        }

        .detail-add-form .quantity-stepper {
            display: flex
        }

            .detail-add-form .quantity-stepper button {
                flex: 0 0 48px
            }

            .detail-add-form .quantity-stepper input[type=number] {
                flex: 1;
                width: auto;
                border: 0;
                border-radius: 0
            }

    .cart-line {
        grid-template-columns: 64px minmax(0,1fr);
        gap: .7rem
    }

    .cart-line-image {
        width: 64px;
        height: 64px
    }

    .cart-quantity {
        grid-column: 1/3
    }

        .cart-quantity label {
            flex: 1
        }

        .cart-quantity input {
            width: 100%
        }

    .cart-line-total {
        grid-column: 1/3
    }

    .checkout-actions {
        grid-template-columns: 1fr
    }
}

.notice.error {
    background: color-mix(in srgb,var(--danger) 12%,var(--surface));
    color: var(--danger)
}
