/* =========================================================
   CHECKOUT PAGE
   ========================================================= */

.checkout-page {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1280px;
    margin: 32px auto 56px;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    align-items: flex-start;
    overflow-x: hidden;
}

/* LEFT SIDE = 40% */
.checkout-left {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 0;
}

.checkout-left h2 {
    margin: 0 0 22px;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* RIGHT SIDE = 60% */
.checkout-right {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
    position: sticky;
    top: 20px;
}

.checkout-right h3 {
    margin: 0 0 22px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

/* ===============================
   FORM STYLES
================================ */

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.form-row input {
    width: 100%;
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    background: #fff;
    color: #111827;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

input:focus,
textarea:focus {
    border-color: #27ad34;
    box-shadow: 0 0 0 3px rgba(39, 173, 52, 0.10);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

/* ===============================
   CART ITEM ROWS
================================ */

.checkout-cart-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(0, 1.2fr);
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #eef2f7;
}

.cart-name,
.cart-name-row {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    color: #111827;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

/* Right side of each row */
.cart-meta-row {
    display: grid;
    grid-template-columns: 74px 1fr 1fr 36px;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.cart-meta-item {
    min-width: 0;
}

.cart-meta-label {
    display: block;
    font-size: 11px;
    line-height: 1;
    color: #6b7280;
    margin-bottom: 5px;
    font-weight: 500;
}

.checkout-qty {
    width: 74px;
    max-width: 100%;
    padding: 7px 8px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
    margin-bottom: 0;
}

.checkout-qty:focus {
    border-color: #27ad34;
    box-shadow: 0 0 0 3px rgba(39, 173, 52, 0.10);
}

.cart-price,
.cart-total {
    font-size: 14px;
    white-space: nowrap;
    color: #111827;
    font-weight: 500;
}

/* Remove button */
.remove-item {
    background: #fee2e2;
    border: none;
    color: #b91c1c;
    font-size: 16px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.remove-item:hover {
    background: #fecaca;
    transform: scale(1.05);
}

/* ===============================
   SUMMARY ROWS
================================ */

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 14px;
    color: #111827;
}

.summary-row.total {
    font-weight: 700;
    font-size: 18px;
    margin-top: 16px;
}

.summary-row.total span:last-child {
    font-size: 20px;
}

/* ===============================
   SHIPPING
================================ */

.shipping {
    margin-top: 18px;
    padding-top: 8px;
}

.shipping h4 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.shipping label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    color: #111827;
    line-height: 1.4;
}

.shipping input[type="radio"] {
    width: auto;
    margin: 3px 0 0;
}

/* ===============================
   PAYMENT
================================ */

.payment-methods {
    margin-top: 20px;
}

.payment-option {
    display: block;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 14px 14px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.payment-option input[type="radio"] {
    width: auto;
    margin-right: 10px;
    margin-bottom: 0;
}

.payment-option span {
    font-weight: 500;
    color: #111827;
}

.mpesa-box {
    margin-top: 10px;
    padding-left: 24px;
}

#mpesaPhoneWrapper {
    display: none;
}

/* ===============================
   BUTTON
================================ */

.place-order-btn {
    width: 100%;
    margin-top: 20px;
    background: #27ad34;
    color: #fff;
    border: none;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.place-order-btn:hover {
    background: #1f8e2a;
}

.place-order-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

/* ===============================
   TABLET
================================ */

@media (max-width: 992px) {
    .checkout-page {
        flex-direction: column;
        gap: 24px;
        padding: 0 16px;
    }

    .checkout-left,
    .checkout-right {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
    }

    .checkout-right {
        position: static;
        top: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 768px) {
    .checkout-page {
        margin: 18px auto 36px;
        padding: 0 12px;
    }

    .checkout-left h2,
    .checkout-right h3 {
        font-size: 20px;
    }

    input,
    textarea {
        font-size: 14px;
        padding: 11px 12px;
    }

    .checkout-right {
        padding: 18px 14px;
        border-radius: 14px;
    }

    /* Mobile product card */
    .checkout-cart-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 0;
    }

    .cart-name,
    .cart-name-row {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 15px;
    }

    .cart-meta-row {
        display: grid;
        grid-template-columns: 56px 1fr 1fr 32px;
        gap: 8px;
        align-items: center;
    }

    .cart-meta-label {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .checkout-qty {
        width: 56px;
        padding: 6px 6px;
        font-size: 13px;
    }

    .cart-price,
    .cart-total {
        font-size: 13px;
    }

    .remove-item {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .shipping label {
        font-size: 14px;
    }

    .payment-option {
        padding: 12px;
    }

    .mpesa-box {
        padding-left: 0;
    }

    .summary-row.total {
        font-size: 17px;
    }

    .summary-row.total span:last-child {
        font-size: 18px;
    }

    .place-order-btn {
        width: 100%;
        padding: 14px;
        font-size: 15px;
    }
}

/* ===============================
   SMALL MOBILE
================================ */

@media (max-width: 480px) {
    .checkout-page {
        padding: 0 10px;
    }

    .checkout-right {
        padding: 16px 12px;
    }

    .checkout-left h2,
    .checkout-right h3 {
        font-size: 18px;
    }

    input,
    textarea {
        font-size: 13px;
    }

    .cart-meta-row {
        grid-template-columns: 50px 1fr 1fr 28px;
        gap: 6px;
    }

    .checkout-qty {
        width: 50px;
    }

    .cart-price,
    .cart-total {
        font-size: 12px;
    }

    .remove-item {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}