/*
Theme Name: Zandkarimi Digital Marketing
Theme URI: https://zandkarimi.com
Author: Zandkarimi Team
Author URI: https://zandkarimi.com
Description: قالب اختصاصی آژانس دیجیتال مارکتینگ زندکریمی 
Version: 1.3.0 (Final Checkout Fixes)
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zandkarimi
Tags: rtl-language-support, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================
   1. GLOBAL & LAYOUT FIXES
   ========================================= */

/* حل مشکل رفتن محتوا زیر هدر در صفحات داخلی */
body:not(.home) .site-main {
    padding-top: 120px; /* تنظیم ارتفاع بر اساس هدر */
}

@media (max-width: 768px) {
    body:not(.home) .site-main {
        padding-top: 100px;
    }
}

/* =========================================
   2. HEADER & MINI CART
   ========================================= */

.header-cart-wrapper {
    position: relative;
    display: inline-block;
    padding: 10px 0;
}

.cart-custom-link {
    text-decoration: none;
    color: #fff;
    font-size: 24px;
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* شمارنده قرمز رنگ */
.cart-count-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #ff4d4d;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* باکس بازشو (Dropdown) */
.header-mini-cart-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background-color: #1a1a1a;
    border: 1px solid #cca458;
    border-radius: 8px;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: right;
}

/* نمایش باکس هنگام هاور */
.header-cart-wrapper:hover .header-mini-cart-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* محتویات داخل مینی کارت */
.header-mini-cart-dropdown .woocommerce-mini-cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.header-mini-cart-dropdown .woocommerce-mini-cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    margin-left: 10px;
}

.header-mini-cart-dropdown .woocommerce-mini-cart-item a {
    color: #fff !important;
    font-size: 0.9rem;
    display: block;
    text-decoration: none;
}

.header-mini-cart-dropdown .quantity {
    color: #aaa;
    font-size: 0.8rem;
    display: block;
    margin-top: 5px;
}

/* دکمه‌های پایین مینی کارت */
.header-mini-cart-dropdown .woocommerce-mini-cart__buttons {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.header-mini-cart-dropdown .button {
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
}

.header-mini-cart-dropdown .button.checkout {
    background-color: #cca458;
    color: #000 !important;
    font-weight: bold;
}

.header-mini-cart-dropdown .button:not(.checkout) {
    background-color: #333;
    color: #fff !important;
}

/* =========================================
   3. SHOP ARCHIVE (LIST PAGE)
   ========================================= */

.shop-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.shop-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #333;
}

/* گرید محصولات */
.custom-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* کارت محصول */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    height: 200px;
    overflow: hidden;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #222;
}

.product-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.product-meta .price {
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.1rem;
}

.product-meta .button {
    background-color: #333;
    color: #fff;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.3s;
}

.product-meta .button:hover {
    background-color: #000;
}

/* =========================================
   4. SINGLE PRODUCT PAGE (FIXED FULL IMAGE)
   ========================================= */

.custom-single-product-layout {
    padding-top: 40px;
}

/* ساختار دو ستونه (تصویر بزرگ) */
.product-top-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: flex-start;
    margin-bottom: 60px;
}

.product-gallery-column {
    flex: 0 0 60%; /* 60 درصد عرض برای عکس */
    max-width: 60%;
    padding-left: 30px;
}

.product-summary-column {
    flex: 0 0 40%;
    max-width: 40%;
}

@media (max-width: 768px) {
    .product-gallery-column,
    .product-summary-column {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0;
    }
}

/* --- تنظیمات اجباری برای بزرگ کردن تصویر --- */
.product-gallery-column .woocommerce-product-gallery,
.product-gallery-column .woocommerce-product-gallery__wrapper,
.product-gallery-column .woocommerce-product-gallery__image {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.product-gallery-column img,
.woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    display: block !important;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* --- سایر استایل‌های محصول --- */

h1.product_title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #fff !important;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.product-short-description {
    font-size: 1rem;
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.product-actions {
    background-color: #111 !important;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.product-actions .price,
.product-actions .amount {
    color: #cca458 !important;
    font-size: 1.8rem !important;
    font-weight: bold;
}

.single_add_to_cart_button {
    background-color: #333 !important;
    color: #fff !important;
    padding: 12px 30px !important;
    border-radius: 8px !important;
    font-size: 1.1rem !important;
    border: 1px solid #555 !important;
    transition: 0.3s;
}

.single_add_to_cart_button:hover {
    background-color: #cca458 !important;
    color: #000 !important;
    border-color: #cca458 !important;
    transform: scale(1.02);
}

.quantity .qty {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #444 !important;
    height: 40px;
    border-radius: 5px;
}

.product_meta {
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 15px;
    font-size: 0.9rem;
    color: #888;
}

.product_meta a {
    color: #aaa !important;
    text-decoration: none;
    transition: 0.3s;
}

.product_meta a:hover {
    color: #cca458 !important;
}

/* --- تب‌های ووکامرس (Dark Mode) --- */
.woocommerce-tabs ul.tabs {
    border-bottom: 1px solid #333 !important;
    margin: 0 0 -1px !important;
    padding: 0 !important;
    background: transparent !important;
    list-style: none;
    display: flex;
    gap: 10px;
}

.woocommerce-tabs ul.tabs li {
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
}

.woocommerce-tabs ul.tabs li a {
    background-color: #222 !important;
    color: #888 !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 10px 20px !important;
    transition: 0.3s;
    font-weight: bold;
    text-decoration: none;
}

.woocommerce-tabs ul.tabs li.active a {
    background-color: #111 !important;
    color: #cca458 !important;
    border: 1px solid #333 !important;
    border-bottom: 1px solid #111 !important;
}

.woocommerce-Tabs-panel {
    background-color: #111 !important;
    color: #ddd !important;
    border: 1px solid #333 !important;
    border-radius: 0 0 12px 12px !important;
    padding: 30px !important;
    margin-top: 0 !important;
}

.woocommerce-tabs::before, 
.woocommerce-tabs::after {
    display: none !important;
}

/* =========================================
   5. CART PAGE
   ========================================= */

.woocommerce-cart .woocommerce, 
.woocommerce-cart .woocommerce table.shop_table {
    color: #e0e0e0;
}

.woocommerce-cart a {
    color: #cca458 !important;
    text-decoration: none;
}
.woocommerce-cart a:hover {
    color: #fff !important;
}

.woocommerce table.shop_table {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid #333 !important;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.woocommerce table.shop_table th {
    background-color: #252525;
    color: #cca458;
    padding: 15px !important;
    font-weight: bold;
    border-bottom: 1px solid #333 !important;
}

.woocommerce table.shop_table td {
    border-top: 1px solid #333 !important;
    padding: 15px !important;
}

.woocommerce a.remove {
    color: #ff4d4d !important;
    background: transparent !important;
    font-size: 1.5rem !important;
}
.woocommerce a.remove:hover {
    color: #fff !important;
    background: #ff4d4d !important;
}

.woocommerce button.button {
    background-color: #333;
    color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px 20px;
    transition: 0.3s;
}
.woocommerce button.button:hover {
    background-color: #cca458;
    color: #000;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    display: block;
    background-color: #cca458 !important;
    color: #000 !important;
    font-weight: bold !important;
    text-align: center;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    margin-top: 20px;
    font-size: 1.1rem;
    transition: 0.3s;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(204, 164, 88, 0.3);
}

.cart-collaterals .cart_totals {
    background-color: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
}

.cart-collaterals .cart_totals h2 {
    color: #cca458 !important;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.cart-collaterals .cart_totals table th,
.cart-collaterals .cart_totals table td {
    color: #fff !important;
    border-top: 1px solid #333 !important;
}

.coupon input.input-text {
    background-color: #000 !important;
    border: 1px solid #444 !important;
    color: #fff !important;
    padding: 10px !important;
    border-radius: 5px !important;
}

/* =========================================
   6. CHECKOUT PAGE STYLES (Final Fixes)
   ========================================= */

/* استایل فیلدها و اینپوت‌ها */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout textarea,
.woocommerce-checkout select {
    background-color: #0d0d0d !important;
    color: #fff !important;
    border: 1px solid #333 !important;
    padding: 12px !important;
    border-radius: 5px !important;
    box-shadow: none !important;
}

.woocommerce-checkout input:focus,
.woocommerce-checkout textarea:focus {
    border-color: #cca458 !important;
    outline: none !important;
}

/* حل مشکل تداخل متن کشور/منطقه و استان با فیلد */
/* این کد لیبل‌ها رو میاره بالای فیلد */
.woocommerce-checkout .form-row {
    display: block !important;
    position: relative !important;
    margin-bottom: 20px !important;
}

.woocommerce-checkout .form-row label {
    position: static !important;
    display: block !important;
    margin-bottom: 8px !important;
    font-size: 0.9rem !important;
    color: #cca458 !important; /* طلایی */
    opacity: 1 !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
}

/* اصلاح لیست‌های کشویی (استان و شهر - Select2) */
.select2-container .select2-selection--single {
    background-color: #0d0d0d !important;
    border: 1px solid #333 !important;
    height: 50px !important; /* ارتفاع ثابت */
    border-radius: 5px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
    line-height: 50px !important;
    padding-right: 0 !important;
}

.select2-dropdown {
    background-color: #1a1a1a !important;
    border: 1px solid #cca458 !important;
}

.select2-results__option {
    color: #ddd !important;
}

.select2-results__option--highlighted {
    background-color: #cca458 !important;
    color: #000 !important;
}

/* دکمه نهایی "ثبت سفارش" (طلایی) */
#place_order {
    background-color: #cca458 !important;
    color: #000 !important;
    font-weight: bold !important;
    font-size: 1.2rem !important;
    padding: 18px 30px !important;
    border-radius: 8px !important;
    border: none !important;
    width: 100% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 20px !important;
    box-shadow: 0 4px 15px rgba(204, 164, 88, 0.2) !important;
}

#place_order:hover {
    background-color: #fff !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(204, 164, 88, 0.4) !important;
}

/* باکس سفارش و روش‌های پرداخت */
.woocommerce-checkout-review-order {
    background-color: #111;
    padding: 25px;
    border: 1px solid #333;
    border-radius: 12px;
}

.woocommerce-checkout-review-order table {
    background-color: transparent !important;
    border: none !important;
}

.woocommerce-checkout-review-order th,
.woocommerce-checkout-review-order td {
    border-bottom: 1px solid #333 !important;
    color: #ddd !important;
}

#payment {
    background-color: #1a1a1a !important;
    border-radius: 8px !important;
}

#payment div.payment_box {
    background-color: #000 !important;
    color: #aaa !important;
}

#payment div.payment_box::before {
    border-bottom-color: #000 !important;
}

.checkout_coupon button[type="submit"] {
    background-color: #333 !important;
    color: #fff !important;
}
.checkout_coupon button[type="submit"]:hover {
    background-color: #cca458 !important;
    color: #000 !important;
}

/* =========================================
   7. FOOTER STYLES
   ========================================= */

.site-footer {
    background-color: #0a0a0a;
    color: #aaa;
    padding-top: 80px;
    margin-top: 100px;
    border-top: 3px solid #cca458;
    font-size: 0.95rem;
}

.footer-widgets-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 60px;
}

@media (max-width: 992px) {
    .footer-widgets-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 576px) {
    .footer-widgets-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.footer-title, 
.footer-column h2, 
.widget-title {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 25px;
    font-weight: bold;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after,
.widget-title::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background-color: #cca458;
    margin-top: 10px;
}

@media (max-width: 576px) {
    .footer-title::after { margin: 10px auto; }
}

.footer-logo .logo-text {
    font-size: 1.8rem;
    color: #cca458;
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
}

.footer-description {
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column a {
    color: #aaa;
    text-decoration: none;
    transition: 0.3s;
}

.footer-column a:hover {
    color: #cca458;
    padding-right: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

@media (max-width: 576px) {
    .social-links { justify-content: center; }
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #222;
    color: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    background-color: #cca458;
    color: #000;
    transform: translateY(-3px);
}

.footer-bottom {
    background-color: #000;
    padding: 25px 0;
    border-top: 1px solid #1a1a1a;
    text-align: center;
    font-size: 0.9rem;
}
/* =========================================
   ULTIMATE CHECKOUT FIXES (The Final Stand)
   ========================================= */

/* 1. حل قطعی مشکل تداخل متن کشور و استان */
/* استفاده از body برای افزایش قدرت سلکتور */
body.woocommerce-checkout .form-row {
    display: block !important;
    position: relative !important;
    margin-bottom: 25px !important;
    padding-top: 25px !important; /* ایجاد فضای خالی بالای فیلد */
}

/* استایل لیبل (کشور، استان، نام و...) */
body.woocommerce-checkout .form-row label {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    
    color: #cca458 !important; /* رنگ طلایی */
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: bold !important;
    
    background: transparent !important;
    opacity: 1 !important;
    transform: none !important; /* جلوگیری از هرگونه انیمیشن */
    z-index: 100 !important;
    pointer-events: none !important;
    white-space: nowrap !important; /* جلوگیری از شکستن متن */
}

/* حذف لیبل‌های مخفی که گاهی ووکامرس اضافه می‌کند */
body.woocommerce-checkout .form-row label.screen-reader-text {
    display: none !important;
}

/* 2. اصلاح فیلدهای کشویی (Select2 - کشور و استان) */
/* حذف پس‌زمینه سفید و تنظیم ارتفاع */
body .select2-container .select2-selection--single {
    height: 50px !important;
    background-color: #0d0d0d !important;
    border: 1px solid #333 !important;
    border-radius: 5px !important;
    display: flex !important;
    align-items: center !important;
    margin-top: 0 !important;
    box-shadow: none !important;
}

/* استایل متن داخل فیلد (ایران، تهران) */
body .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
    line-height: 50px !important;
    padding-right: 15px !important;
    padding-left: 30px !important;
}

/* استایل فلش کوچک سمت چپ */
body .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    top: 1px !important;
    left: 1px !important;
}
body .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #cca458 transparent transparent transparent !important;
}

/* استایل لیست بازشونده (Dropdown) */
body .select2-dropdown {
    background-color: #1a1a1a !important;
    border: 1px solid #cca458 !important;
    z-index: 9999 !important;
}
body .select2-results__option {
    color: #ddd !important;
    padding: 10px 15px !important;
}
body .select2-results__option--highlighted[aria-selected] {
    background-color: #cca458 !important;
    color: #000 !important;
}

/* 3. استایل فیلدهای متنی معمولی (نام، آدرس و...) */
body.woocommerce-checkout input.input-text,
body.woocommerce-checkout textarea {
    background-color: #0d0d0d !important;
    color: #fff !important;
    border: 1px solid #333 !important;
    padding: 12px 15px !important;
    border-radius: 5px !important;
    height: 50px !important; /* هم‌ارتفاع با فیلدهای کشویی */
    box-shadow: none !important;
}
body.woocommerce-checkout textarea {
    height: 120px !important;
    padding-top: 15px !important;
}
body.woocommerce-checkout input.input-text:focus,
body.woocommerce-checkout textarea:focus {
    border-color: #cca458 !important;
    outline: none !important;
}

/* 4. حل قطعی مشکل دکمه ثبت سفارش (با بالاترین اولویت) */
/* استفاده از ID و چندین کلاس برای اطمینان از اعمال استایل */
body.woocommerce-checkout #payment #place_order,
body.woocommerce-checkout button.button.alt#place_order {
    background-color: #cca458 !important; /* رنگ طلایی */
    color: #000 !important; /* متن مشکی */
    font-size: 18px !important;
    font-weight: bold !important;
    
    padding: 20px 30px !important;
    width: 100% !important;
    border: none !important;
    border-radius: 8px !important;
    
    margin-top: 30px !important;
    cursor: pointer !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    float: none !important;
    
    transition: all 0.3s ease !important;
    box-shadow: 0 5px 15px rgba(204, 164, 88, 0.3) !important;
}

/* استایل هاور دکمه */
body.woocommerce-checkout #payment #place_order:hover,
body.woocommerce-checkout button.button.alt#place_order:hover {
    background-color: #fff !important; /* سفید شدن در هاور */
    color: #000 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 25px rgba(204, 164, 88, 0.5) !important;
}