.bag-dialog {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(82vw, 340px);
    max-width: none;
    height: 100dvh;
    max-height: none;
    flex-direction: column;
    overflow: auto;
    margin: 0;
    border: 0;
    padding: 30px;
    background: #ffffff;
    color: #111111;
    box-shadow: -16px 0 54px rgba(0, 0, 0, .14);
}

.bag-dialog[open] {
    display: flex;
    animation: bag-drawer-in .42s cubic-bezier(.22, 1, .36, 1) both;
}

.bag-dialog::backdrop {
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(2px);
}

.bag-dialog-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    padding-bottom: 20px;
}

.bag-dialog-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
}

.bag-dialog-close {
    position: relative;
    width: 40px;
    height: 40px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #111111;
    cursor: pointer;
}

.bag-dialog-close::before,
.bag-dialog-close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 1px;
    background: currentColor;
    content: "";
}

.bag-dialog-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.bag-dialog-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.bag-dialog-close-form {
    margin: 0;
}

.bag-dialog-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    padding: 36px 0;
}

.bag-dialog-content p {
    margin: 0;
    font-size: 17px;
    font-weight: 400;
}

.bag-dialog-footer {
    padding-top: 20px;
}

.bag-dialog-footer a {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background: #111111;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.3px;
    text-decoration: none;
    transition: background .18s ease;
}

.bag-dialog-footer a:hover {
    background: #333333;
}

.bag-dialog-close:hover {
    color: #777777;
}

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

.checkout-form {
    display: grid;
    gap: 34px;
}

.checkout-section {
    display: grid;
    gap: 20px;
}

.checkout-section h2,
.checkout-summary h2 {
    margin: 0;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.3px;
}

.checkout-field {
    display: grid;
    gap: 8px;
    color: #555555;
    font-size: 9px;
    letter-spacing: 1px;
}

.checkout-field input {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-bottom: 1px solid #c9c9c9;
    border-radius: 0;
    padding: 8px 0;
    background: transparent;
    color: #111111;
    font: inherit;
    font-size: 15px;
    letter-spacing: 0;
}

.checkout-field input:focus {
    border-bottom-color: #111111;
    outline: 0;
}

.checkout-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.checkout-note {
    margin: -8px 0 0;
    color: #686868;
    font-size: 11px;
    line-height: 1.6;
}

.checkout-summary {
    padding-top: 0;
}

.checkout-summary p {
    margin: 32px 0 48px;
    color: #686868;
    font-family: var(--theme-font);
    font-size: 18px;
}

@keyframes bag-drawer-in {
    from { opacity: .7; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 600px) {
    .bag-dialog {
        padding: 24px;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .checkout-summary {
        order: -1;
    }

    .checkout-row {
        gap: 14px;
    }
}

.bag-dialog-content.has-items {
    justify-content: flex-start;
    gap: 22px;
    padding: 12px 0 24px;
}

.bag-item {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 16px;
}

.bag-item-image {
    width: 84px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #f2f2f2;
}

.bag-dialog-content .bag-item p {
    margin: 0;
    font-size: 13px;
}

.bag-dialog-content .bag-item .bag-item-price {
    margin-top: 4px;
    color: #686868;
}

.bag-item-quantity {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    border: 1px solid #d6d6d6;
}

.bag-item-quantity button {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #111111;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}

.bag-item-quantity span {
    min-width: 22px;
    text-align: center;
    font-size: 12px;
}

.bag-item-remove {
    display: block;
    margin-top: 10px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #777777;
    font: inherit;
    font-size: 9px;
    letter-spacing: 1.2px;
    text-decoration: underline;
    cursor: pointer;
}

.bag-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 1000;
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: 14px 20px;
    background: #111111;
    color: #ffffff;
    font-size: 12px;
    letter-spacing: .4px;
    transform: translateX(-50%);
}

.summary-list {
    display: grid;
    gap: 14px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.summary-item,
.summary-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}

.summary-total {
    margin-top: 24px;
    border-top: 1px solid #d6d6d6;
    padding-top: 16px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.3px;
}

.checkout-status {
    min-height: 1.4em;
    margin: 0;
    color: #a12622;
    font-size: 12px;
}

