/* ==========================================================================
   GK CHECKOUT - FINAL COMPACT LAYOUT
   ========================================================================== */
:root {
    --gk-primary: #ef394e;
    --gk-text: #232933;
    --gk-text-muted: #81858b;
    --gk-border: #e0e0e2;
    --gk-bg: #fcfcfc;
    --gk-radius: 12px;
}

body.gk-checkout-layout .woocommerce * {
    box-sizing: border-box;
    outline: none;
}

/* کانتینر اصلی (عرض کمتر برای چسبندگی بیشتر) */
body.gk-checkout-layout .woocommerce {
    max-width: 1200px; /* کاهش عرض برای حذف فضای خالی وسط */
    margin: 0 auto;
    padding: 30px 15px;
    background: var(--gk-bg);
    direction: rtl;
    min-height: 100vh;
}

/* --- 1. استپ‌پر (نوار مراحل) --- */
body.gk-checkout-layout .gk-checkout-steps {
    width: 100%;
    margin-bottom: 25px;
    background: #fff;
    padding: 20px;
    border-radius: var(--gk-radius);
    border: 1px solid var(--gk-border);
}

body.gk-checkout-layout .gk-checkout-steps__list {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 40px !important;
    position: relative;
}

/* خط اتصال */
body.gk-checkout-layout .gk-checkout-steps__list::before {
    content: '';
    position: absolute;
    top: 24px; /* تنظیم دقیق وسط آیکون */
    left: 60px;
    right: 60px;
    height: 2px;
    background: #f0f0f1;
    z-index: 0;
}

body.gk-checkout-layout .gk-checkout-steps__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    background: #fff; /* برای پوشاندن خط زیرین */
    padding: 0 15px;
}

/* آیکون */
body.gk-checkout-layout .gk-checkout-steps__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ccc;
    margin-bottom: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

body.gk-checkout-layout .gk-checkout-steps__label {
    font-size: 13px;
    font-weight: 700;
    color: #999;
}

/* وضعیت فعال */
body.gk-checkout-layout .gk-checkout-steps__item.is-current .gk-checkout-steps__icon {
    border-color: var(--gk-primary);
    color: var(--gk-primary);
    background: #fff5f5;
    transform: scale(1.1);
}
body.gk-checkout-layout .gk-checkout-steps__item.is-current .gk-checkout-steps__label {
    color: var(--gk-primary);
}

/* وضعیت تکمیل */
body.gk-checkout-layout .gk-checkout-steps__item.is-completed .gk-checkout-steps__icon {
    background: var(--gk-primary);
    border-color: var(--gk-primary);
    color: #fff;
}
body.gk-checkout-layout .gk-checkout-steps__item.is-completed .gk-checkout-steps__label {
    color: #333;
}

/* --- 2. گرید اصلی صفحه (فرم و سایدبار) --- */
body.gk-checkout-layout form.checkout {
    display: grid !important;
    /* ستون راست (فرم) بزرگتر | ستون چپ (سایدبار) ثابت 380px */
    grid-template-columns: 1fr 380px;
    gap: 25px; /* فاصله استاندارد بین دو ستون */
    align-items: start;
}

/* --- 3. ستون راست: فرم‌های آدرس (باکس‌های جداگانه و زیر هم) --- */
body.gk-checkout-layout #customer_details {
    display: flex;
    flex-direction: column;
    gap: 25px; /* فاصله بین باکس آدرس و حمل‌ونقل */
    width: 100%;
}

/* تنظیم ستون‌های داخلی ووکامرس (col-1 و col-2) برای نمایش زیر هم */
body.gk-checkout-layout #customer_details .col-1,
body.gk-checkout-layout #customer_details .col-2 {
    width: 100% !important;
    float: none !important;
    max-width: 100% !important;
    background: #fff;
    padding: 25px;
    border-radius: var(--gk-radius);
    border: 1px solid var(--gk-border);
}

/* باکس توضیحات (اگر جدا باشد) */
body.gk-checkout-layout .woocommerce-additional-fields {
    background: #fff;
    padding: 25px;
    border-radius: var(--gk-radius);
    border: 1px solid var(--gk-border);
}

/* عنوان باکس‌ها */
body.gk-checkout-layout .woocommerce-billing-fields h3,
body.gk-checkout-layout .woocommerce-shipping-fields h3,
body.gk-checkout-layout .woocommerce-additional-fields h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--gk-text);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: center;
}
/* آیکون کنار تیتر (اختیاری) */
body.gk-checkout-layout .woocommerce-billing-fields h3::before {
    content: ''; display: inline-block; width: 8px; height: 8px; background: var(--gk-primary); border-radius: 50%; margin-left: 10px;
}

/* چیدمان فیلدها (دو ستونه کردن فیلدهای داخلی مثل نام و نام خانوادگی) */
body.gk-checkout-layout .woocommerce-billing-fields__field-wrapper,
body.gk-checkout-layout .woocommerce-shipping-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* فیلدهایی که باید کل عرض را بگیرند */
body.gk-checkout-layout .form-row-wide,
body.gk-checkout-layout .form-row.notes,
body.gk-checkout-layout #billing_address_1_field,
body.gk-checkout-layout #shipping_address_1_field,
body.gk-checkout-layout #billing_email_field,
body.gk-checkout-layout #billing_phone_field {
    grid-column: 1 / -1;
}

/* استایل اینپوت‌ها */
body.gk-checkout-layout .form-row { margin: 0; }
body.gk-checkout-layout .form-row label {
    display: block; margin-bottom: 8px; font-weight: 500; color: #555; font-size: 13px;
}
body.gk-checkout-layout input.input-text,
body.gk-checkout-layout textarea,
body.gk-checkout-layout select {
    width: 100%; height: 46px; padding: 0 15px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; background: #fff; color: var(--gk-text);
}
body.gk-checkout-layout textarea { height: 100px; padding: 15px; }
body.gk-checkout-layout input.input-text:focus,
body.gk-checkout-layout textarea:focus,
body.gk-checkout-layout select:focus {
    border-color: var(--gk-primary); box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.1);
}

/* چک‌باکس حمل و نقل متفاوت */
body.gk-checkout-layout #ship-to-different-address {
    margin-bottom: 0; display: flex; align-items: center;
}
body.gk-checkout-layout #ship-to-different-address label {
    font-size: 16px; font-weight: 700; color: var(--gk-text); cursor: pointer; display: flex; align-items: center; gap: 10px;
}
body.gk-checkout-layout #ship-to-different-address input {
    width: 18px; height: 18px; accent-color: var(--gk-primary);
}

/* --- 4. ستون چپ: سایدبار چسبان --- */
body.gk-checkout-layout h3#order_review_heading { display: none; }

body.gk-checkout-layout #order_review {
    background: #fff;
    padding: 25px;
    border-radius: var(--gk-radius);
    border: 1px solid var(--gk-border);
    position: sticky;
    top: 20px;
}

/* جدول سفارش */
body.gk-checkout-layout table.woocommerce-checkout-review-order-table {
    width: 100%; border-collapse: collapse; margin-bottom: 20px; border: none;
}
body.gk-checkout-layout table.woocommerce-checkout-review-order-table th,
body.gk-checkout-layout table.woocommerce-checkout-review-order-table td {
    border: none; padding: 12px 0; border-bottom: 1px solid #f5f5f5; text-align: right; font-size: 14px; color: #555;
}
body.gk-checkout-layout table.woocommerce-checkout-review-order-table td {
    text-align: left; font-weight: 700; color: var(--gk-text);
}
body.gk-checkout-layout .cart_item .product-name { font-weight: 500; color: var(--gk-text); }
body.gk-checkout-layout .cart_item .product-quantity { color: var(--gk-text-muted); }

/* مجموع کل */
body.gk-checkout-layout tr.order-total th {
    font-size: 16px; font-weight: 800; color: var(--gk-text); border-top: 2px solid #eee;
}
body.gk-checkout-layout tr.order-total td {
    font-size: 20px; font-weight: 800; color: var(--gk-primary); border-top: 2px solid #eee;
}

/* بخش پرداخت */
body.gk-checkout-layout #payment { background: transparent; border-radius: 0; }
body.gk-checkout-layout #payment ul.payment_methods { padding: 0; border-bottom: none; margin-bottom: 20px; }
body.gk-checkout-layout #payment ul.payment_methods li {
    list-style: none; background: #f9f9f9; margin-bottom: 10px; border-radius: 8px; padding: 15px; border: 1px solid #eee;
}
body.gk-checkout-layout #payment ul.payment_methods li label { font-weight: 700; color: var(--gk-text); cursor: pointer; font-size: 14px; margin-right: 8px; }
body.gk-checkout-layout #payment div.payment_box {
    background: #fff; color: #666; margin-top: 10px; padding: 12px; border-radius: 6px; font-size: 13px; border: 1px dashed #ddd;
}
body.gk-checkout-layout #payment div.payment_box::before { display: none; }

/* دکمه ثبت سفارش */
body.gk-checkout-layout #place_order {
    background-color: var(--gk-primary) !important;
    color: #fff !important;
    display: block; width: 100%; padding: 16px 0 !important;
    border-radius: 8px !important; font-size: 18px !important; font-weight: 700 !important;
    text-align: center; border: none !important; cursor: pointer; transition: background 0.2s;
    box-shadow: 0 4px 12px rgba(239, 57, 78, 0.2);
}
body.gk-checkout-layout #place_order:hover { background-color: #d71d32 !important; }

/* نقشه */
body.gk-checkout-layout .gk-checkout-map-section {
    background: #fff; padding: 25px; border-radius: var(--gk-radius); border: 1px solid var(--gk-border); margin-top: 25px;
}
#gk-checkout-map {
    width: 100%; height: 300px; border-radius: 8px; border: 1px solid #ddd; z-index: 1;
}

/* --- موبایل --- */
@media (max-width: 992px) {
    body.gk-checkout-layout form.checkout {
        grid-template-columns: 1fr; /* تک ستونه */
    }
    body.gk-checkout-layout .woocommerce-billing-fields__field-wrapper,
    body.gk-checkout-layout .woocommerce-shipping-fields__field-wrapper {
        grid-template-columns: 1fr; /* فیلدها زیر هم */
    }
    body.gk-checkout-layout .gk-checkout-steps__list {
        padding: 0 !important; gap: 10px;
    }
    body.gk-checkout-layout .gk-checkout-steps__list::before {
        top: 20px; left: 20px; right: 20px;
    }
    body.gk-checkout-layout .gk-checkout-steps__icon {
        width: 40px; height: 40px; font-size: 14px;
    }
    body.gk-checkout-layout #order_review {
        position: static;
    }
}









/* ==========================================================================
   THANK YOU PAGE STYLES (Digikala Style)
   ========================================================================== */
.gk-thankyou-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 15px;
    font-family: inherit;
    direction: rtl;
}

/* هدر موفقیت */
.gk-thankyou-header {
    text-align: center;
    margin-bottom: 40px;
}
.gk-thankyou-icon-wrapper {
    width: 80px; height: 80px;
    background: #e6f9ed; /* سبز روشن */
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.gk-thankyou-check {
    font-size: 40px; color: #00a046; /* سبز دیجی‌کالا */
}
.gk-thankyou-title {
    font-size: 24px; font-weight: 800; color: #00a046; margin-bottom: 10px;
}
.gk-thankyou-subtitle {
    font-size: 16px; color: #555;
}
.gk-thankyou-subtitle strong {
    color: #000; font-size: 18px; margin-right: 5px;
}

/* گرید اصلی */
.gk-thankyou-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* باکس‌های سفید */
.gk-thankyou-box {
    background: #fff;
    border: 1px solid #e0e0e2;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}
.gk-box-title {
    font-size: 16px; font-weight: 700; color: #000;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f1;
}

/* لیست خلاصه */
.gk-order-overview {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; gap: 20px;
}
.gk-order-overview li {
    flex: 1 1 45%; /* دو ستونه */
    display: flex; flex-direction: column; gap: 5px;
}
.gk-order-overview span { font-size: 13px; color: #81858b; }
.gk-order-overview strong { font-size: 15px; color: #000; }

/* جدول محصولات */
.gk-thankyou-products {
    width: 100%; border-collapse: collapse;
}
.gk-thankyou-products th {
    text-align: right; color: #81858b; font-weight: 400; padding-bottom: 10px; border-bottom: 1px solid #f0f0f1;
}
.gk-thankyou-products td {
    padding: 15px 0; border-bottom: 1px solid #f9f9f9; vertical-align: middle;
}
.gk-thankyou-products tr:last-child td { border: none; }
.gk-product-name {
    display: flex; align-items: center; gap: 10px;
}
.gk-product-name img {
    width: 50px; height: 50px; object-fit: contain; border-radius: 4px; border: 1px solid #eee;
}

/* اطلاعات ارسال (سایدبار) */
.gk-delivery-row {
    margin-bottom: 15px; display: flex; flex-direction: column; gap: 5px;
}
.gk-delivery-row .label { color: #81858b; font-size: 13px; }
.gk-delivery-row .value { color: #000; font-weight: 500; font-size: 14px; line-height: 1.6; }

/* نقشه */
.gk-delivery-map-wrapper { margin-top: 20px; }
.gk-map-label { font-size: 13px; color: #81858b; margin-bottom: 8px; }
#gk-thankyou-map {
    width: 100%; height: 200px; border-radius: 8px; border: 1px solid #eee;
}

/* دکمه‌ها */
.gk-thankyou-actions { display: flex; flex-direction: column; gap: 10px; }
.gk-btn {
    display: block; text-align: center; padding: 12px; border-radius: 8px; text-decoration: none; font-weight: 700; transition: 0.2s;
}
.gk-btn--primary {
    background: #ef394e; color: #fff;
}
.gk-btn--primary:hover { background: #d71d32; color: #fff; }
.gk-btn--secondary {
    background: #fff; border: 1px solid #ddd; color: #555;
}
.gk-btn--secondary:hover { border-color: #999; color: #333; }

/* ریسپانسیو */
@media (max-width: 900px) {
    .gk-thankyou-grid { grid-template-columns: 1fr; }
    .gk-order-overview li { flex: 1 1 100%; }
}

/* استایل حالت شکست (Failed) */
.gk-thankyou-header--failed .gk-thankyou-icon-wrapper { background: #fef2f2; }
.gk-thankyou-header--failed .gk-thankyou-title { color: #ef394e; }
.gk-icon-failed { color: #ef394e; font-size: 40px; font-weight: bold; }
