﻿
:root {
    --pink: #ff4f9a;
    --pink-light: #ffd8e9;
    --pink-soft: #fff0f7;
    --blue: #5ca8ff;
    --blue-light: #d9edff;
    --blue-soft: #eff8ff;
    --purple: #6952c8;
    --text: #343070;
    --muted: #8586ad;
    --border: #ecebfa;
}

* {
    box-sizing: border-box;
}

.checkout-page {
    max-width: 1240px;
    margin: auto;
    padding: 24px;
    color: var(--text);
    font-family: "Vazirmatn", sans-serif;
    background: radial-gradient(ellipse at 90% 0%, #d9edff70, transparent 35%), radial-gradient(ellipse at 0% 20%, #ffd8e970, transparent 30%), #fcfbff;
    border-radius: 24px;
}

    .checkout-page button,
    .checkout-page input,
    .checkout-page textarea,
    .checkout-page select {
        font: inherit;
    }

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid #6952c81c;
}

.checkout-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 15px;
    color: white;
    font-size: 27px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--pink), var(--blue));
}

.logo-text {
    color: var(--purple);
    font-size: 24px;
    font-weight: 900;
}

    .logo-text small {
        display: block;
        margin-top: 3px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 400;
    }

.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
}

.step {
    padding: 10px;
    color: #aaa8c3;
    border-radius: 11px;
}

    .step.completed {
        color: var(--purple);
        background: #f0edfa;
    }

    .step.active {
        color: var(--pink);
        background: var(--pink-soft);
        font-weight: bold;
    }

.step-arrow {
    color: #bdb8da;
}

.back-to-cart {
    color: var(--purple);
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
}

.checkout-heading {
    margin: 30px 0 24px;
}

.heading-label {
    color: var(--pink);
    font-size: 12px;
    font-weight: bold;
}

.checkout-heading h1 {
    margin: 8px 0;
    font-size: 34px;
}

    .checkout-heading h1 span {
        color: var(--pink);
    }

.checkout-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 2;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 22px;
}

.checkout-main, .checkout-sidebar {
    min-width: 0;
}

.checkout-main, .checkout-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checkout-card {
    padding: 22px;
    border: 1px solid #6952c81a;
    border-radius: 23px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 35px #47418b08;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.heading-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 15px;
    font-size: 25px;
}

.pink-icon {
    color: var(--pink);
    background: var(--pink-soft);
}

.blue-icon {
    color: var(--blue);
    background: var(--blue-soft);
}

.card-heading h2, .invoice-heading h2 {
    margin: 0 0 6px;
    font-size: 15px;
}

.card-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.checkout-product {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid #f0eef9;
}

    .checkout-product:first-child {
        padding-top: 0;
    }

    .checkout-product:last-child {
        border-bottom: 0;
    }

.checkoutproduct-image {
    display: grid;
    place-items: center;
    width: 70px;
    height: 74px;
    border-radius: 17px;
    font-size: 30px;
}

.product-image-pink {
    background: linear-gradient(140deg, var(--pink-soft), #ffe0ee);
}

.product-image-blue {
    background: linear-gradient(140deg, var(--blue-soft), var(--blue-light));
}

.product-info h3 {
    margin: 0 0 7px;
    font-size: 12px;
}

.product-info p {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 10px;
}

.product-quantity {
    color: var(--muted);
    font-size: 10px;
}

.product-price {
    text-align: left;
    white-space: nowrap;
}

    .product-price strong {
        display: block;
        color: var(--purple);
        font-size: 12px;
    }

    .product-price small {
        color: var(--muted);
        font-size: 9px;
    }

.products-subtotal {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 17px;
    border-top: 1px dashed #e4e0f5;
    font-size: 11px;
}

    .products-subtotal span {
        color: var(--muted);
    }

    .products-subtotal strong {
        color: var(--pink);
    }

.saved-address-panel {
    padding: 15px;
    border: 1px solid #e7e4f7;
    border-radius: 16px;
    background: linear-gradient(110deg, #fbfaff, #f7fbff);
}

    .saved-address-panel label, .checkout-field label {
        display: block;
        margin-bottom: 9px;
        font-size: 11px;
        font-weight: bold;
    }

.checkout-input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 45px;
    padding: 12px;
    border: 1px solid #e8e6f4;
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: white;
    font-size: 12px;
    transition: border-color .2s, box-shadow .2s;
}

    .checkout-input:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 3px #5ca8ff20;
    }

    .checkout-input::placeholder {
        color: #b7b4c9;
    }

textarea.checkout-input {
    min-height: 95px;
    line-height: 1.9;
    resize: vertical;
}

.delete-address {
    margin-top: 10px;
    padding: 0;
    border: 0;
    color: #dc4c7d;
    background: transparent;
    font-size: 10px;
    cursor: pointer;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #a3a0bb;
    font-size: 10px;
}

    .form-divider::before, .form-divider::after {
        content: "";
        height: 1px;
        flex: 1;
        background: #eeebf7;
    }

.checkout-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 14px;
}

.checkout-field {
    min-width: 0;
}

    .checkout-field.full-width {
        grid-column: 1 / -1;
    }

    .checkout-field label b {
        color: var(--pink);
    }

.optional-label {
    color: #aaa7bf;
    font-size: 10px;
    font-weight: normal;
}

.field-error {
    display: block;
    margin-top: 5px;
    color: #dc4778;
    font-size: 10px;
}

.checkout-field.invalid .checkout-input {
    border-color: #f18aaa;
    background: #fffafd;
}

.save-address-option {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid #f5d7e6;
    border-radius: 15px;
    background: linear-gradient(100deg, #fff8fc, #f8fbff);
    cursor: pointer;
}

    .save-address-option input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

.custom-checkbox {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    border: 1px solid #d6cfe9;
    border-radius: 7px;
    color: transparent;
    background: white;
    font-size: 13px;
}

.save-address-option input:checked + .custom-checkbox {
    color: white;
    border-color: var(--pink);
    background: var(--pink);
}

.save-address-option input:focus-visible + .custom-checkbox {
    outline: 3px solid #5ca8ff50;
}

.save-address-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .save-address-text strong {
        font-size: 11px;
    }

    .save-address-text small {
        color: var(--muted);
        font-size: 10px;
        line-height: 1.8;
    }

.save-heart {
    margin-right: auto;
    color: var(--pink);
    font-size: 24px;
}

.continue-checkout, .invoice-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 49px;
    margin-top: 22px;
    padding: 13px 17px;
    border: 0;
    border-radius: 14px;
    color: white;
    background: linear-gradient(105deg, var(--pink), #ff78b3);
    box-shadow: 0 8px 20px #ff4f9a2c;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: transform .2s;
}

    .continue-checkout:hover, .invoice-button:hover {
        transform: translateY(-2px);
    }

.checkout-security {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.9;
}

.invoice-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 23px;
}

    .invoice-heading > span {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 14px;
        color: var(--pink);
        background: var(--pink-soft);
        font-size: 25px;
    }

    .invoice-heading h2 {
        margin: 0;
    }

.invoice-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
    color: var(--muted);
    font-size: 10px;
}

    .invoice-row strong {
        color: var(--text);
        font-size: 10px;
        white-space: nowrap;
    }

    .invoice-row .shipping-value {
        color: var(--purple);
    }

.discount-row strong {
    color: #35a985;
}

.invoice-divider {
    height: 1px;
    margin: 20px 0;
    background: repeating-linear-gradient(to left, #e6e1f5 0, #e6e1f5 5px, transparent 5px, transparent 10px);
}

.invoice-total {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 20px;
}

    .invoice-total span {
        font-size: 12px;
        font-weight: bold;
    }

    .invoice-total strong {
        color: var(--pink);
        font-size: 25px;
        overflow-wrap: anywhere;
    }

.invoice-button {
    margin-top: 0;
}

.invoice-hint {
    margin: 12px 0 0;
    color: #a5a1b8;
    text-align: center;
    font-size: 9px;
    line-height: 1.8;
}

.checkout-promo {
    position: relative;
    min-height: 175px;
    overflow: hidden;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(125deg, #e4dafa, #f8d9ed 55%, #d9edff);
}

.promo-label {
    color: var(--pink);
    font-size: 10px;
    font-weight: bold;
}

.checkout-promo h3 {
    margin: 9px 0;
    font-size: 16px;
    line-height: 1.8;
}

.checkout-promo p {
    max-width: 175px;
    color: #8175ad;
    font-size: 10px;
    line-height: 1.9;
}

.promo-cat {
    position: absolute;
    left: 17px;
    bottom: 20px;
    display: grid;
    place-items: center;
    width: 73px;
    height: 73px;
    border: 4px solid #a99ad8;
    border-radius: 45%;
    color: var(--purple);
    background: #fff0f7;
    font-size: 19px;
    box-shadow: 0 12px 20px #6952c82b;
}

.promo-heart {
    position: absolute;
    right: 16px;
    bottom: 12px;
    color: white;
    font-size: 25px;
}

.checkout-trust {
    padding: 20px;
    border: 1px solid #eeebf8;
    border-radius: 22px;
    background: white;
}

    .checkout-trust h3 {
        margin: 0 0 17px;
        font-size: 13px;
    }

    .checkout-trust p {
        display: flex;
        align-items: center;
        gap: 11px;
        color: var(--pink);
    }

        .checkout-trust p > span {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

    .checkout-trust strong {
        color: var(--text);
        font-size: 11px;
    }

    .checkout-trust small {
        color: var(--muted);
        font-size: 9px;
    }

.checkout-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 25px;
    color: #a5a2ba;
    font-size: 10px;
}

    .checkout-footer strong {
        color: var(--purple);
        font-size: 14px;
    }

        .checkout-footer strong span {
            color: var(--pink);
        }

.checkout-toast {
    position: fixed;
    right: 50%;
    bottom: 24px;
    z-index: 9999;
    max-width: calc(100% - 32px);
    padding: 13px 18px;
    border-radius: 14px;
    color: white;
    background: #39316e;
    box-shadow: 0 12px 30px #2e255d30;
    font-size: 12px;
    line-height: 1.8;
    opacity: 0;
    pointer-events: none;
    transform: translate(50%, 15px);
    transition: .25s;
}

    .checkout-toast.show {
        opacity: 1;
        transform: translate(50%, 0);
    }

@media (max-width: 950px) {
    .checkout-layout {
        grid-template-columns: minmax(0, 1fr) 275px;
        gap: 15px;
    }

    .checkout-card {
        padding: 17px;
    }

    .checkout-steps {
        gap: 2px;
    }
}

@media (max-width: 760px) {
    .checkout-page {
        padding: 16px;
    }

    .checkout-header {
        flex-wrap: wrap;
    }

    .checkout-steps {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-sidebar {
        order: 0;
    }

    .checkout-main {
        order: 1;
    }

    .checkout-promo, .checkout-trust {
        display: none;
    }
}

@media (max-width: 520px) {
    .checkout-page {
        padding: 12px;
        border-radius: 16px;
    }

    .checkout-header {
        gap: 12px;
    }

    .logo-icon {
        width: 37px;
        height: 37px;
    }

    .logo-text {
        font-size: 21px;
    }

    .back-to-cart {
        font-size: 10px;
    }

    .checkout-heading {
        margin: 22px 0 17px;
    }

        .checkout-heading h1 {
            font-size: 27px;
        }

        .checkout-heading p {
            font-size: 11px;
        }

    .checkout-card {
        padding: 15px;
        border-radius: 19px;
    }

    .checkout-form-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .checkout-field.full-width {
        grid-column: auto;
    }

    .checkout-product {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 10px;
    }

    .product-image {
        width: 56px;
        height: 60px;
        font-size: 25px;
    }

    .product-price {
        grid-column: 2;
        text-align: right;
    }

    .invoice-total strong {
        font-size: 22px;
    }

    .checkout-footer {
        justify-content: center;
        text-align: center;
    }
}
