/* ═══════════════════════════════════════════════════════════════
   ووکامرس اختصاصی دیتاگستران v1.11.0
   سبد خرید، تسویه حساب، فروشگاه — ریسپانسیو و تمیز
   ═══════════════════════════════════════════════════════════════ */

/* ── پایه ── */
.dg-wc-wrap { padding-block: 2rem 4rem; min-height: 50vh; }
.dg-wc-container { max-width: 1100px; }
.dg-wc-page-article { max-width: 1100px; margin-inline: auto; }
.dg-wc-content { direction: rtl; }

/* ── ریست فیلدهای ووکامرس ── */
.woocommerce form .form-row,
.woocommerce-page form .form-row {
    float: none !important;
    width: 100% !important;
    clear: none !important;
    margin: 0 0 1rem !important;
    padding: 0 !important;
}

.woocommerce form .form-row label,
.woocommerce-page form .form-row label {
    display: block !important;
    float: none !important;
    width: 100% !important;
    font-size: .82rem;
    font-weight: 800;
    color: var(--teal);
    margin-bottom: .45rem !important;
}

.woocommerce form .form-row .input-text,
.woocommerce form .form-row input[type="text"],
.woocommerce form .form-row input[type="email"],
.woocommerce form .form-row input[type="tel"],
.woocommerce form .form-row input[type="password"],
.woocommerce form .form-row input[type="number"],
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .select2-container .select2-selection--single {
    width: 100% !important;
    display: block !important;
    float: none !important;
    border: 1.5px solid var(--line) !important;
    border-radius: .85rem !important;
    background: var(--paper) !important;
    color: var(--teal-deep) !important;
    padding: .82rem 1.1rem !important;
    font-size: .95rem !important;
    font-weight: 700;
    font-family: inherit !important;
    height: auto !important;
    box-sizing: border-box !important;
    transition: border-color .2s;
}

.woocommerce form .form-row .input-text:focus,
.woocommerce form .form-row input:focus,
.woocommerce form .form-row textarea:focus {
    border-color: var(--turquoise) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(23,160,138,.1);
}

.woocommerce form .form-row .woocommerce-input-wrapper {
    display: block !important;
    width: 100% !important;
}

/* ── لایه Grid برای فرم‌ها ── */
.woocommerce .woocommerce-billing-fields__field-wrapper,
.woocommerce .woocommerce-shipping-fields__field-wrapper,
.woocommerce .woocommerce-address-fields__field-wrapper {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.woocommerce .form-row-wide,
.woocommerce #billing_address_1_field,
.woocommerce #billing_address_2_field,
.woocommerce #billing_country_field,
.woocommerce #billing_email_field,
.woocommerce #billing_phone_field,
.woocommerce #order_comments_field {
    grid-column: 1 / -1 !important;
}

/* ── دکمه‌ها ── */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--teal) !important; color: #fff !important;
    border-radius: .85rem !important; font-weight: 800 !important; font-size: .9rem !important;
    padding: .75rem 1.5rem !important; border: 0 !important;
    font-family: inherit !important; cursor: pointer;
    transition: background .2s;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover { background: var(--teal-deep) !important; }
.woocommerce a.button.alt,
.woocommerce button.button.alt { background: linear-gradient(135deg, var(--gold-bright), var(--gold)) !important; color: var(--teal-deep) !important; }

/* ── جدول سبد خرید ── */
.woocommerce table.shop_table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border: 1.5px solid var(--line); border-radius: 1.2rem;
    overflow: hidden; background: var(--card); box-shadow: var(--shadow-card);
}
.woocommerce table.shop_table thead th {
    background: var(--teal-deep); color: #fff;
    padding: .85rem 1.1rem; font-size: .82rem; font-weight: 800; text-align: right;
}
.woocommerce table.shop_table td {
    padding: .9rem 1.1rem; border-bottom: 1px solid rgba(229,219,192,.5);
    vertical-align: middle; font-size: .9rem;
}
.woocommerce table.shop_table tr:last-child td { border-bottom: 0; }
.woocommerce table.shop_table .product-thumbnail { display: none !important; }
.woocommerce table.shop_table .product-name a { font-weight: 900; color: var(--teal-deep); }
.woocommerce table.shop_table .product-quantity .qty {
    width: 65px; text-align: center; border: 1.5px solid var(--line);
    border-radius: .7rem; padding: .5rem; font-weight: 800; background: var(--paper);
}
.woocommerce .product-remove .remove { color: var(--danger) !important; font-size: 1.4rem; }

/* متای آیتم‌های دامنه */
.woocommerce .wc-item-meta {
    margin: .5rem 0 0; padding: .5rem .8rem;
    background: var(--gold-soft); border: 1px solid rgba(185,146,72,.25);
    border-radius: .6rem; list-style: none; font-size: .78rem;
}
.woocommerce dl.variation { margin: .4rem 0 0; padding: .4rem .7rem; background: var(--gold-soft); border-radius: .5rem; font-size: .78rem; }

/* ── کوپن و اکشن‌های سبد ── */
.woocommerce td.actions { background: var(--paper) !important; }
.woocommerce .coupon { display: flex; gap: .5rem; flex-wrap: wrap; }
.woocommerce .coupon input[name="coupon_code"] { min-width: 150px; }
.woocommerce .actions > button[name="update_cart"] { margin-right: auto; }

/* ── جمع سبد ── */
.woocommerce .cart-collaterals { margin-top: 2rem; }
.woocommerce .cart_totals {
    background: var(--card); border: 1.5px solid var(--line);
    border-radius: 1.3rem; padding: 1.8rem; box-shadow: var(--shadow-card);
    max-width: 420px; margin-right: auto;
}
.woocommerce .cart_totals h2 { font-size: 1.2rem; font-weight: 900; padding-bottom: .8rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; }
.woocommerce .cart_totals table { width: 100%; border-collapse: collapse; }
.woocommerce .cart_totals th, .woocommerce .cart_totals td { padding: .7rem 0; font-size: .92rem; border-bottom: 1px dashed var(--line); }
.woocommerce .cart_totals .order-total th, .woocommerce .cart_totals .order-total td { font-weight: 900; color: var(--teal); font-size: 1.2rem; border-bottom: 0; padding-top: 1rem; }
.woocommerce .wc-proceed-to-checkout .checkout-button {
    width: 100% !important; margin-top: 1rem; font-size: 1.05rem !important; font-weight: 900 !important; padding: 1rem !important;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold)) !important; color: var(--teal-deep) !important;
    border-radius: 1rem !important;
}

/* ── تسویه حساب ── */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-additional-fields h3 {
    font-size: 1.15rem; font-weight: 900; color: var(--teal-deep);
    padding-right: 1rem; border-right: 4px solid var(--gold); margin: 1.5rem 0 1rem;
}
.woocommerce-checkout #order_review {
    background: var(--card); border: 1.5px solid var(--line);
    border-radius: 1.3rem; padding: 1.5rem; box-shadow: var(--shadow-card);
}
.woocommerce-checkout #order_review table.shop_table { border: 0; box-shadow: none; }
.woocommerce-checkout #payment {
    background: var(--gold-soft); border: 1.5px solid rgba(185,146,72,.35);
    border-radius: 1.1rem; margin-top: 1.2rem; overflow: hidden;
}
.woocommerce-checkout #payment .wc_payment_methods { list-style: none; margin: 0; padding: 1rem 1.2rem; }
.woocommerce-checkout #payment .payment_box { background: rgba(255,254,248,.9); border-radius: .6rem; padding: .7rem 1rem; margin-top: .4rem; font-size: .85rem; }
.woocommerce-checkout #place_order {
    width: 100% !important; font-size: 1.1rem !important; font-weight: 900 !important; padding: 1.1rem !important;
    background: linear-gradient(135deg, var(--teal), var(--teal-deep)) !important; color: #fff !important;
    border-radius: 1rem !important; border: 0 !important; cursor: pointer; margin-top: .5rem;
}

/* ── پیام‌ها ── */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
    border-radius: 1rem !important; padding: 1rem 1.3rem !important;
    font-weight: 700; font-size: .88rem; margin-bottom: 1.2rem !important;
}
.woocommerce .woocommerce-message { background: #ecfdf5 !important; border-top: 3px solid var(--ok) !important; }
.woocommerce .woocommerce-error { background: #fef2f2 !important; border-top: 3px solid var(--danger) !important; }

/* ── خالی بودن سبد ── */
.woocommerce .cart-empty { text-align: center; padding: 3rem; font-size: 1rem; color: var(--ink-soft); }
.woocommerce .return-to-shop { text-align: center; margin-top: 1rem; }

/* ═══════════ ریسپانسیو موبایل ═══════════ */
@media (max-width: 768px) {
    /* فرم‌ها تک‌ستونه */
    .woocommerce .woocommerce-billing-fields__field-wrapper,
    .woocommerce .woocommerce-shipping-fields__field-wrapper,
    .woocommerce .woocommerce-address-fields__field-wrapper {
        grid-template-columns: 1fr !important;
    }
    .woocommerce .form-row,
    .woocommerce .form-row-first,
    .woocommerce .form-row-last {
        grid-column: 1 / -1 !important;
    }

    /* سبد خرید کارت‌مانند */
    .woocommerce table.shop_table { border: 0 !important; background: transparent !important; box-shadow: none !important; }
    .woocommerce table.shop_table thead { display: none !important; }
    .woocommerce table.shop_table tbody tr {
        display: block !important; position: relative;
        border: 1.5px solid var(--line) !important; border-radius: 1.1rem !important;
        background: var(--card) !important; padding: 1rem !important;
        margin-bottom: .9rem; box-shadow: var(--shadow-card) !important;
    }
    .woocommerce table.shop_table td {
        display: flex !important; align-items: center; justify-content: space-between !important;
        width: 100% !important; border-bottom: 1px solid rgba(229,219,192,.35) !important;
        padding: .5rem 0 !important; font-size: .88rem !important;
    }
    .woocommerce table.shop_table td:last-child { border-bottom: 0 !important; }
    .woocommerce table.shop_table td::before {
        content: attr(data-title);
        font-weight: 800; color: var(--teal-deep); font-size: .78rem; flex-shrink: 0;
    }
    .woocommerce table.shop_table td.product-thumbnail { display: none !important; }
    .woocommerce table.shop_table td.product-name { flex-direction: column; align-items: flex-start !important; }
    .woocommerce table.shop_table td.product-name::before { display: none !important; }
    .woocommerce table.shop_table td.product-remove { position: absolute; left: .8rem; top: .6rem; border: 0 !important; padding: 0 !important; }
    .woocommerce table.shop_table td.product-remove::before { display: none !important; }
    .woocommerce table.shop_table td.actions { flex-direction: column !important; align-items: stretch !important; }
    .woocommerce table.shop_table td.actions::before { display: none !important; }
    .woocommerce .coupon { flex-direction: column; }
    .woocommerce .actions .button { width: 100% !important; }

    /* جمع سبد */
    .woocommerce .cart_totals { max-width: 100%; }

    /* تسویه */
    .woocommerce-checkout #order_review { padding: 1rem; }
}
