/* ========================= */
/* CHECKOUT PAGE */
/* ========================= */

.checkout-section {
    padding: 40px;
}

.checkout-wrapper {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: auto;
}

/* LEFT FORM */

.checkout-form {
    background: #1c1c1c;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
}

.checkout-form h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #111;
    color: #fff;
    font-size: 0.95rem;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: #2e7d32;
}

.checkout-items-list {
    margin-bottom: 20px;
}

.summary-divider {
    border: none;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 15px 0;
}

.payment-options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* RIGHT SUMMARY */

.order-summary {
    background: #1c1c1c;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    height: fit-content;
}

.order-summary h3 {
    margin-bottom: 20px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.summary-row.total {
    margin-top: 20px;
    font-weight: 700;
    font-size: 1.2rem;
}

.btn-place-order {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: #2e7d32;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-place-order:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(46,125,50,0.4);
}


.btn-place-order:disabled {
    background-color: #999;     
    cursor: not-allowed;        
    opacity: 0.7;           
}


.btn-place-order.loading {
    background-color: #999;
    cursor: not-allowed;
    pointer-events: none;  
    opacity: 0.7;
}


.free-shipping {
    color: #16a34a;       
    font-weight: 600;
}

.free-shipping::before {
    content: "✓ ";
}

.address-preview {
    margin-top: 20px;
    padding: 15px;
    background: #111;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.address-preview h4 {
    margin-bottom: 10px;
}

#previewBox p {
    margin: 4px 0;
}

/* MOBILE */

@media (max-width: 900px) {
    .checkout-wrapper {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}


/* MOBILE IMPROVEMENTS */

@media (max-width: 600px) {

    .checkout-section {
        padding: 20px 12px;
    }

    .checkout-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .checkout-form,
    .order-summary {
        padding: 20px;
        border-radius: 12px;
    }

    /* Make inputs BIGGER and easier to type */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .checkout-form input,
    .checkout-form textarea {
        padding: 16px;
        font-size: 1rem;
        border-radius: 10px;
    }

    /* Make headings clearer */
    .checkout-form h3,
    .order-summary h3 {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    /* Improve address preview readability */
    .address-preview {
        padding: 14px;
        font-size: 0.95rem;
    }

    #previewBox p {
        line-height: 1.5;
    }

    /* Order summary spacing */
    .checkout-item {
        font-size: 0.95rem;
        padding: 6px 0;
    }

    .summary-row {
        font-size: 0.95rem;
    }

    .summary-row.total {
        font-size: 1.1rem;
    }

    /* Make button easier to tap */
    .btn-place-order {
        padding: 16px;
        font-size: 1.05rem;
        border-radius: 12px;
    }
}