﻿/* ==================================================
   GLOBAL RESET
================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #000;
    color: #fff;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.checkout {
    max-width: 1250px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ==================================================
   MAIN LAYOUT (ORDER SUMMARY RIGHT)
================================================== */
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 32px;
    align-items: start;
}

.order-details {
    grid-column: 1;
    width: 100%;
}

.payment-summary {
    grid-column: 2;
    position: sticky;
    top: 96px;
    height: fit-content;
}

/* ==================================================
   CARDS
================================================== */
.order-details,
.payment-summary {
    background: linear-gradient(180deg, #1b1b1b, #111);
    border-radius: 18px;
    padding: 26px;
}

/* ==================================================
   ORDER ITEMS
================================================== */
.checkout-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    background: #161616;
    border-radius: 14px;
    margin-bottom: 14px;
}

.checkout-thumb {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
}

.checkout-info {
    flex: 1;
}

.checkout-price {
    font-weight: 800;
    font-size: 18px;
    white-space: nowrap;
}

/* ==================================================
   QUANTITY CONTROLS
================================================== */
.checkout-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

    .checkout-controls button {
        width: 34px;
        height: 34px;
        border-radius: 999px;
        border: 1px solid #444;
        background: transparent;
        color: #fff;
        font-size: 18px;
        font-weight: 700;
        cursor: pointer;
    }

        .checkout-controls button:hover {
            background: rgba(255,255,255,0.08);
        }

/* ==================================================
   UPSELL SECTION
================================================== */
.upsell-section {
    margin-top: 28px;
}

    .upsell-section h3 {
        font-size: 20px;
        margin-bottom: 18px;
    }

.upsell-item {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #161616;
    border-radius: 14px;
    margin-bottom: 14px;
}

    .upsell-item img {
        width: 70px;
        height: 70px;
        border-radius: 10px;
        object-fit: cover;
    }

    .upsell-item strong {
        font-size: 16px;
    }

    .upsell-item span {
        font-size: 14px;
        opacity: 0.85;
    }

    /* UPSSELL ADD BUTTON — YELLOW */
    .upsell-item button {
        background: #ffcc00;
        color: #000;
        border: none;
        border-radius: 999px;
        padding: 10px 18px;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
    }

        .upsell-item button:hover {
            background: #ffd633;
        }

/* ==================================================
   CUSTOMER DETAILS (VERTICAL + SPACING)
================================================== */
.customer-section {
    margin-top: 36px;
    margin-bottom: 48px;
}

    .customer-section h3 {
        font-size: 22px;
        margin-bottom: 20px;
    }

.customer-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

    .customer-field label {
        font-size: 13px;
        font-weight: 600;
        color: #ccc;
    }

    .customer-field .required {
        color: #ff4d4d;
    }

    .customer-field .optional {
        font-size: 12px;
        color: #888;
    }

    .customer-field input {
        width: 100%;
        padding: 14px;
        border-radius: 12px;
        background: #222;
        border: 1px solid #333;
        color: #fff;
    }

        .customer-field input:focus {
            outline: none;
            border-color: #ffcc00;
        }

/* Messages */
.success-msg {
    margin-top: 14px;
    color: #4caf50;
    font-weight: 600;
}

.error-msg {
    margin-top: 14px;
    color: #ff4d4d;
    font-weight: 600;
}

/* ==================================================
   ORDER SUMMARY
================================================== */
.payment-summary h2 {
    margin-bottom: 18px;
}

.payment-summary .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 800;
    margin-top: 10px;
}

/* ==================================================
   CHECKOUT BUTTON (ALWAYS RED)
================================================== */
.checkout-btn,
.checkout-btn:disabled {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border-radius: 14px;
    border: none;
    background: #c40000;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

    .checkout-btn:hover {
        background: #e00000;
    }

/* ==================================================
   RESPONSIVE
================================================== */
@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .payment-summary {
        position: relative;
        top: auto;
        margin-top: 32px;
    }
}

@media (max-width: 420px) {
    .checkout-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .checkout-price {
        align-self: flex-end;
        margin-top: 6px;
    }
}
/* ==================================================
   FORCE CUSTOMER DETAILS TO STACK (FINAL OVERRIDE)
================================================== */

.customer-section {
    display: block !important;
}

    .customer-section .customer-field {
        display: block !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }

        .customer-section .customer-field input {
            display: block !important;
            width: 100% !important;
            max-width: 100% !important;
        }

    /* Extra space before Order Summary */
    .customer-section + .payment-summary,
    .customer-section + .order-summary {
        margin-top: 48px !important;
    }
/* ==================================================
   HARD LOCK CUSTOMER DETAILS (CACHE SAFE)
================================================== */

.checkout .customer-section {
    display: block !important;
}

    .checkout .customer-section .customer-field {
        display: block !important;
        width: 100% !important;
        margin-bottom: 22px !important;
    }

        .checkout .customer-section .customer-field label {
            display: block !important;
            margin-bottom: 6px !important;
        }

        .checkout .customer-section .customer-field input {
            display: block !important;
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }
