/* checkout.html - Checkout Page */

/* Premium Background */
body {
    background-image: url('../../assets/backgrounds/premium-bg.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

.checkout-page {
    display: grid;
    gap: 30px;
    margin: 30px 0;
}

@media(min-width: 768px) {
    .checkout-page {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* Form Section */
.checkout-form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* Checkout Form - Premium Background */
#checkoutForm {
    background-image: url('../../assets/backgrounds/premium-bg.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: var(--radius);
}

.checkout-form h2 {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

@media(min-width: 480px) {
    .form-row.split {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

/* Order Summary */
.order-summary {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: calc(var(--headerH) + 20px);
}

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

.order-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.order-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.order-item-info {
    flex: 1;
}

.order-item-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.order-item-qty {
    font-size: 0.8rem;
    color: var(--muted);
}

.order-item-price {
    font-weight: 600;
}

/* Totals */
.order-totals {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.order-totals .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.order-totals .grand-total {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.order-totals .grand-total span:last-child {
    color: var(--accent);
}

/* Checkout Empty */
.checkout-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

/* Checkout form içindeki metin alanlarının beyazlığını kır */
#checkoutForm input,
#checkoutForm select,
#checkoutForm textarea {
    background: #f767ca2a !important;
}

/* Checkout sağ özet alanındaki notice arka planını inputlarla uyumlu yap */
#checkoutWrap .notice {
    background: #f767ca2a !important;
}

/* =====================================================
   MOBİL CHECKOUT LAYOUT - DİKEY DÜZEN
   Özet → Teslimat → Ödeme sıralaması
===================================================== */
@media (max-width: 768px) {

    /* Ana row dikey düzene geçsin */
    #checkoutWrap>.row {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Özet kartı EN ÜSTE (order: 1) */
    #checkoutWrap>.row>.card:not(#checkoutForm) {
        order: 1 !important;
        width: 100% !important;
        flex: none !important;
    }

    /* Teslimat + Ödeme formu ALTA (order: 2) */
    #checkoutWrap>.row>#checkoutForm {
        order: 2 !important;
        width: 100% !important;
        flex: none !important;
    }

    /* Form içi satırlar da dikey olsun */
    #checkoutForm .row {
        flex-direction: column;
        gap: 10px;
    }

    #checkoutForm .row input,
    #checkoutForm .row select {
        width: 100% !important;
    }
}