body.cart-open {
    overflow: hidden;
}

.nav__cart {
    position: relative;
}

.nav__cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff;
    color: var(--orange);
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-products .nav__cart-count {
    background: var(--orange);
    color: #fff;
}

.nav__cart-count[hidden] {
    display: none !important;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(40, 28, 18, 0.48);
    display: none;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.cart-overlay.is-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.cart-overlay[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.cart-drawer {
    width: min(420px, 100vw);
    height: 100%;
    background: #fff;
    color: #111;
    display: flex;
    flex-direction: column;
    transform: translateX(24px);
    transition: transform 0.22s ease;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
}

.cart-overlay.is-open .cart-drawer {
    transform: none;
}

.cart-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.35rem 1.35rem 0.9rem;
}

.cart-drawer__head h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.cart-drawer__close {
    border: 0;
    background: transparent;
    color: #111;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}

.cart-drawer__items {
    flex: 1;
    overflow-y: auto;
    padding: 0.2rem 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.cart-drawer__empty {
    margin: 1.5rem 0.4rem;
    color: #777;
}

.cart-item {
    --card: #EE7D04;
    display: grid;
    grid-template-columns: 78px 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    row-gap: 0.55rem;
    border: 1.5px solid var(--card);
    border-radius: 16px;
    padding: 0.7rem;
    align-items: start;
}

.cart-item[data-color="purple"] { --card: #6d3fa3; }
.cart-item[data-color="brown"] { --card: #6d4333; }
.cart-item[data-color="red"] { --card: #e23a3a; }

.cart-item__thumb {
    grid-row: 1 / 3;
    width: 78px;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f3f3;
}

.cart-item[data-color="orange"] .cart-item__thumb {
    background: #EE7D04;
    object-fit: contain;
    padding: 4px;
}

.cart-item__copy h3 {
    margin: 0;
    color: var(--card);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.cart-item__copy p {
    margin: 0.1rem 0 0;
    font-size: 0.78rem;
    color: #444;
}

.cart-item__remove {
    border: 0;
    background: transparent;
    color: var(--card);
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
}

.cart-item__bottom {
    grid-column: 2 / 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.cart-item__qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--card);
    border-radius: 8px;
    overflow: hidden;
    min-height: 34px;
}

.cart-item__qty button {
    width: 32px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--card);
    font-size: 1.1rem;
    cursor: pointer;
}

.cart-item__qty span {
    min-width: 22px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-item__price {
    font-size: 1.05rem;
    font-weight: 700;
}

.cart-drawer__foot {
    padding: 0.4rem 1.35rem 1.25rem;
}

.cart-drawer__note {
    margin: 0 0 0.65rem;
    color: #b0b0b0;
    font-size: 0.92rem;
}

.cart-drawer__subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.cart-drawer__checkout {
    width: 100%;
    border: 0;
    background: var(--orange);
    color: #fff;
    font-family: inherit;
    font-size: 1.45rem;
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.cart-drawer__checkout:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cart-drawer__continue {
    display: block;
    width: 100%;
    margin-top: 0.7rem;
    border: 0;
    background: transparent;
    color: #c8c8c8;
    font-family: inherit;
    font-size: 0.92rem;
    cursor: pointer;
}

@media (max-width: 560px) {
    .cart-drawer {
        width: 100vw;
    }

    .cart-drawer__head h2 {
        font-size: 1.7rem;
    }
}

body.pay-notice-open,
body.billing-open {
    overflow: hidden;
}

.cart-pay-notice {
    --notice: #2db84e;
    --notice-soft: #e9f8ee;
    position: fixed;
    inset: 0;
    z-index: 220;
    display: none;
    place-items: center;
    padding: 1.2rem;
    background: rgba(28, 22, 32, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

.cart-pay-notice[data-variant="pending"],
.cart-pay-notice[data-variant="error"] {
    --notice: #ee5a32;
    --notice-soft: #fff1ec;
}

.cart-pay-notice.is-open {
    display: grid;
    pointer-events: auto;
}

.cart-pay-notice[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.cart-pay-notice__box {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 22px;
    padding: 2rem 1.7rem 1.45rem;
    text-align: center;
    box-shadow:
        0 0 0 1.5px color-mix(in srgb, var(--notice) 55%, transparent),
        0 28px 70px rgba(20, 12, 28, 0.26);
    animation: billingModalIn 0.32s ease;
}

.cart-pay-notice__icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--notice-soft);
    color: var(--notice);
}

.cart-pay-notice__box h3 {
    margin: 0 0 0.55rem;
    color: var(--notice);
    font-size: clamp(1.35rem, 3.4vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.cart-pay-notice__box p {
    margin: 0 auto 1.35rem;
    max-width: 34ch;
    color: #5a5a5a;
    font-size: 0.98rem;
    line-height: 1.5;
}

.cart-pay-notice__btn {
    width: 100%;
    border: 0;
    background: var(--notice);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.85rem 1.3rem;
    border-radius: 12px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.cart-pay-notice__btn:hover {
    filter: brightness(0.96);
}

.billing-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: center;
    padding: 1.2rem;
    background: rgba(28, 22, 32, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

.billing-modal.is-open {
    display: grid;
    pointer-events: auto;
}

.billing-modal[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.billing-modal__dialog {
    position: relative;
    width: min(520px, 100%);
    background: #fff;
    border-radius: 28px;
    padding: 1.7rem 1.7rem 1.45rem;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--orange) 16%, transparent),
        0 28px 70px rgba(20, 12, 28, 0.26);
    animation: billingModalIn 0.32s ease;
}

@keyframes billingModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.billing-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #fff6ee;
    color: var(--orange);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.billing-modal__close:hover {
    background: #ffecd8;
    transform: scale(1.04);
}

.billing-modal__head {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin: 0 2.2rem 1.35rem 0;
}

.billing-modal__mark {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #fff4e8;
    color: var(--orange);
}

.billing-modal__dialog h2 {
    margin: 0;
    color: #1c1c1c;
    font-size: clamp(1.45rem, 3.4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.billing-modal__lead {
    margin: 0.28rem 0 0;
    color: #6b6b6b;
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.4;
}

.billing-modal__form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 0.9rem;
}

.billing-modal__field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.billing-modal__field--full {
    grid-column: 1 / -1;
}

.billing-modal__field label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a8a8a;
}

.billing-modal__form input,
.billing-modal__form select {
    width: 100%;
    border: 1px solid #ece7e2;
    border-radius: 12px;
    background: #faf8f6;
    font-family: inherit;
    font-size: 0.95rem;
    color: #222;
    padding: 0.72rem 0.85rem;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.billing-modal__form select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 16px;
}

.billing-modal__form input::placeholder {
    color: #b3aaa3;
    font-weight: 400;
}

.billing-modal__form select:invalid,
.billing-modal__form select[value=""] {
    color: #b3aaa3;
}

.billing-modal__form input:hover,
.billing-modal__form select:hover:not(:disabled) {
    border-color: #e0d8d0;
}

.billing-modal__form input:focus,
.billing-modal__form select:focus {
    border-color: var(--orange);
    background-color: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 16%, transparent);
}

.billing-modal__form select:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.billing-modal__error {
    grid-column: 1 / -1;
    margin: 0;
    color: #c0392b;
    font-size: 0.86rem;
}

.billing-modal__submit {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
    width: 100%;
    border: 0;
    background: var(--orange);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.billing-modal__submit:hover {
    filter: brightness(0.96);
}

.billing-modal__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.billing-modal__note {
    grid-column: 1 / -1;
    margin: 0;
    text-align: center;
    color: #9a9a9a;
    font-size: 0.75rem;
    line-height: 1.4;
}

@media (max-width: 560px) {
    .billing-modal__dialog {
        padding: 1.25rem 1.1rem 1.15rem;
        border-radius: 22px;
    }

    .billing-modal__form {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .cart-pay-notice__box {
        padding: 1.55rem 1.15rem 1.2rem;
        border-radius: 18px;
    }
}
