/* =========================================
   1. GLOBAL & FONTS
   ========================================= */
body, input, button, select, textarea, h1, h2, h3, h4, h5, h6, p, li, span, div, .woocommerce-order, .woocommerce-notice {
    font-family: 'Outfit', sans-serif !important;
    box-sizing: border-box;
}

/* HIDE UNWANTED FIELDS */
.hp-force-hide, #billing_country_field, #billing_city_field, #billing_state_field, #billing_postcode_field, #billing_phone_field, #billing_email_field, #billing_company_field, #billing_address_2_field {
    display: none !important;
}

/* =========================================
   2. LOGIN & PROFILE WRAPPER
   ========================================= */
.hp-wrapper, .elbiz-login-wrapper {
    background-color: #F3EFE0 !important;
    padding: 30px !important;
    color: #333 !important;
    border-radius: 20px !important;
    max-width: 1000px !important;
    margin: 20px auto !important;
    box-shadow: none !important;
}

/* Header Section */
.hp-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.hp-brand { font-size: 24px; font-weight: 700; color: #1a1a1a; letter-spacing: -0.5px; }

/* Forms & Inputs */
.hp-wrapper input[type="text"], 
.hp-wrapper input[type="tel"], 
.hp-wrapper input[type="email"],
.elbiz-login-wrapper input[type="text"],
.elbiz-login-wrapper input[type="tel"] {
    background: #fff !important;
    border: 1px solid #ddd !important;
    padding: 12px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    color: #333 !important;
    outline: none !important;
    width: 100% !important;
    font-family: 'Outfit', sans-serif !important;
    transition: 0.2s;
}

.hp-wrapper input:focus, .elbiz-login-wrapper input:focus {
    border-color: #1a1a1a !important;
}

/* Buttons */
.hp-save-btn, #send-otp, #verify-otp {
    background: #1a1a1a !important;
    color: white !important;
    border: none !important;
    padding: 14px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    width: 100% !important;
    margin-top: 10px;
    transition: 0.3s;
}
.hp-save-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Error Animation */
.error-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    border-color: red !important;
}
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* =========================================
   3. CHECKOUT SPECIFIC STYLES
   ========================================= */
.woocommerce-checkout input[type="text"], 
.woocommerce-checkout input[type="tel"], 
.woocommerce-checkout input[type="email"] {
    background-color: #F3EFE0 !important; border: none !important; padding: 15px !important; 
    border-radius: 10px !important; color: #333 !important;
}
.hp-locked-address input, .hp-locked-field input {
    background-color: #e5e5e5 !important; cursor: not-allowed !important; color: #777 !important;
}
#place_order { background-color: #1a1a1a !important; border-radius: 8px !important; font-weight: 700 !important; color:#fff !important; width:100%; transition:0.3s; padding: 15px !important; }

/* =========================================
   4. FOOD GRID (Menu)
   ========================================= */
/* Sticky Category Nav */
.elbiz-cat-nav {
    display: flex; overflow-x: auto; white-space: nowrap; gap: 10px; padding: 15px 10px;
    margin-bottom: 20px; border-bottom: 1px solid #eee; background: #fff; width: 100%; transition: all 0.3s ease;
}
.elbiz-cat-link { display: inline-block; padding: 8px 16px; background: #f5f5f5; border-radius: 20px; color: #333; text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.3s; }
.elbiz-cat-link:hover, .elbiz-cat-link.active { background: #1a1a1a; color: #fff; }
.elbiz-cat-section-title { font-size: 18px; font-weight: 700; margin: 40px 0 20px 0; color: #333; border-left: 4px solid #1a1a1a; padding-left: 10px; scroll-margin-top: 100px; }

/* Product Items */
.elbiz-food-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 1000px; margin: 0 auto; padding-bottom: 120px; }
.elbiz-food-item { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12px; padding: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); border: 1px solid #f0f0f0; transition: 0.2s; height: 140px; position: relative; overflow: hidden; }
.elbiz-food-item:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.08); border-color: #1a1a1a; }
.elbiz-food-info { flex: 1; padding-right: 15px; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.elbiz-food-title { font-size: 16px; font-weight: 700; color: #333; margin: 0 0 5px 0; }
.elbiz-food-desc { font-size: 13px; color: #777; margin: 0 0 10px 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.elbiz-food-price { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.elbiz-food-img-wrapper { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.elbiz-food-img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.elbiz-add-btn { position: absolute; bottom: -5px; right: -5px; background-color: #fff; color: #1a1a1a; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 22px; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.15); border: 1px solid #eee; transition: 0.2s; cursor: pointer; }

/* =========================================
   5. FLOATING CART & POPUP (Fixed)
   ========================================= */
/* Bottom Bar */
.elbiz-sticky-cart-wrapper { 
    position: fixed; bottom: 20px; right: 20px; left: 20px; /* برای موبایل بهتر است */
    background: #1a1a1a; color: #fff; padding: 15px 20px; 
    border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); 
    display: flex; justify-content: space-between; align-items: center; 
    z-index: 10000; animation: slideUp 0.3s ease-out; 
    max-width: 500px; margin: 0 auto; /* مرکز چین در دسکتاپ */
}
@keyframes slideUp { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }

.elbiz-sticky-info { display: flex; align-items: center; gap: 15px; cursor: pointer; flex: 1; }
.elbiz-toggle-icon { background: rgba(255,255,255,0.2); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; transition:0.3s; }
.elbiz-price-group { display:flex; flex-direction:column; line-height: 1.2; }
.elbiz-label { font-size: 10px; opacity: 0.7; text-transform:uppercase; letter-spacing: 0.5px; }
.elbiz-sticky-total { font-size: 16px; font-weight: 800; }
.elbiz-sticky-btn { background-color: #fff; color: #1a1a1a; padding: 10px 20px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14px; transition: 0.3s; }
.elbiz-sticky-btn:hover { transform: scale(1.05); }

/* Cart Popup Container */
.elbiz-cart-items-container {
    position: fixed; /* تغییر به Fixed برای قرارگیری دقیق */
    bottom: 90px; /* فاصله از پایین صفحه */
    left: 20px; 
    right: 20px;
    max-width: 500px;
    margin: 0 auto;
    background: #fff; 
    border-radius: 20px;
    box-shadow: 0 5px 40px rgba(0,0,0,0.2); 
    padding: 0; 
    display: none; /* پیش‌فرض مخفی */
    flex-direction: column; 
    max-height: 50vh; 
    overflow-y: auto;
    z-index: 9999;
}

/* کلاس نمایش */
.elbiz-cart-items-container.show { 
    display: flex !important; 
    animation: slideInUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideInUp { from{opacity:0; transform:translateY(20px);} to{opacity:1; transform:translateY(0);} }

/* Cart Header */
.elbiz-cart-header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 15px 20px; border-bottom: 1px solid #f0f0f0; background: #fff;
    position: sticky; top: 0; z-index: 10;
}
.elbiz-cart-header h4 { font-size: 16px; margin: 0; color: #1a1a1a; font-weight: 800; }
.close-cart { cursor: pointer; font-size: 24px; color: #999; line-height: 1; transition:0.2s; }
.close-cart:hover { color: #d32f2f; }

/* Cart List */
.elbiz-cart-list { list-style: none; padding: 0 20px; margin: 0; }
.elbiz-cart-li { 
    display: flex; align-items: center; padding: 15px 0; border-bottom: 1px solid #f9f9f9; 
}
.elbiz-cart-li:last-child { border-bottom: none; }

.elbiz-li-img { margin-right: 15px; }
.elbiz-li-img img { 
    width: 50px; height: 50px; border-radius: 10px; object-fit: cover; border:1px solid #eee;
}

.elbiz-li-details { flex: 1; display: flex; flex-direction: column; }
.elbiz-li-name { font-size: 14px; color: #333; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.elbiz-li-price { font-size: 13px; font-weight: 700; color: #1a1a1a; }

/* QTY Controls (+ -) */
.elbiz-li-controls { 
    display: flex; align-items: center; gap: 8px; background: #f5f5f5; padding: 5px; border-radius: 10px; margin-left: 10px;
}
.elbiz-qty-btn { 
    width: 28px; height: 28px; border: none; border-radius: 8px; 
    background: #fff; color: #1a1a1a; font-size: 16px; font-weight: bold; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.2s;
    margin: 0 !important; /* Overwrite general button margin */
}
.elbiz-qty-btn:hover { background: #e0e0e0; transform: scale(1.1); }
.elbiz-qty-btn.loading { opacity: 0.5; pointer-events: none; }
.elbiz-qty-val { font-size: 14px; font-weight: 700; color: #333; min-width: 20px; text-align: center; }

/* Responsive adjustments */
@media(max-width: 768px) {
    .elbiz-food-grid { grid-template-columns: 1fr; }
    .hp-wrapper, .elbiz-login-wrapper { padding: 20px !important; margin: 10px !important; }
}
/* =========================================
   ELEMENTOR CHECKOUT FIXES
   ========================================= */

/* حذف پس‌زمینه رنگی پیش‌فرض المنتور */
.elementor-widget-woocommerce-checkout-page,
.woocommerce-checkout {
    background: transparent !important;
}

/* جدول سفارش */
.woocommerce-checkout-review-order-table {
    background-color: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 15px !important;
    padding: 0 !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.03) !important;
    overflow: hidden !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 15px 20px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    background: transparent !important;
    font-size: 14px !important;
    color: #333 !important;
}

/* هدر جدول */
.woocommerce-checkout-review-order-table thead th {
    background-color: #f9f9f9 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #1a1a1a !important;
    font-size: 12px !important;
}

/* جمع کل (Total) */
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    background-color: #1a1a1a !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    border: none !important;
}
.woocommerce-checkout-review-order-table .order-total .amount {
    color: #fff !important;
}

/* باکس پرداخت */
#payment {
    background: #ffffff !important;
    border-radius: 15px !important;
    margin-top: 20px !important;
    padding: 20px !important;
    border: 1px solid #eee !important;
}

#place_order {
    width: 100% !important;
    background-color: #1a1a1a !important;
    color: #fff !important;
    font-weight: 700 !important;
    padding: 18px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    transition: 0.3s !important;
    margin-top: 10px !important;
}

#place_order:hover {
    background-color: #333 !important;
    transform: translateY(-2px);
}
/* ترفند CSS برای تغییر متن لیبل‌ها در المنتور */

/* 1. نام (Ad) */
label[for="billing_first_name"] {
    visibility: hidden;
    position: relative;
}
label[for="billing_first_name"]:after {
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    content: "Ad *"; /* متن جدید */
    color: #1a1a1a;
    font-weight: bold;
}

/* 2. نام خانوادگی (Soyad) */
label[for="billing_last_name"] {
    visibility: hidden;
    position: relative;
}
label[for="billing_last_name"]:after {
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    content: "Soyad *"; /* متن جدید */
    color: #1a1a1a;
    font-weight: bold;
}

/* 3. آدرس (Adres) */
label[for="billing_address_1"] {
    visibility: hidden;
    position: relative;
}
label[for="billing_address_1"]:after {
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    content: "Adres *"; /* متن جدید */
    color: #1a1a1a;
    font-weight: bold;
}
/* =========================================
   7. THANK YOU PAGE (ORDER RECEIVED)
   ========================================= */

/* کانتینر اصلی پیام تشکر */
.woocommerce-order {
    max-width: 1000px;
    margin: 0 auto;
    font-family: 'Outfit', sans-serif;
}

/* پیام سبز رنگ بالا */
.woocommerce-notice--success {
    background-color: #D1E7DD !important;
    color: #0F5132 !important;
    padding: 20px !important;
    border-radius: 12px;
    margin-bottom: 30px !important;
    text-align: center;
    font-weight: 700;
    border: 1px solid #BADBCC;
}

/* نوار اطلاعات سفارش (شماره، تاریخ و...) */
ul.order_details {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    padding: 25px !important;
    border-radius: 15px;
    list-style: none;
    justify-content: space-between;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    margin-bottom: 40px !important;
    gap: 20px;
}

ul.order_details li {
    float: none !important;
    border-right: 1px solid #eee;
    margin-right: 0 !important;
    padding-right: 20px !important;
    font-size: 13px;
    text-transform: uppercase;
    color: #777;
    width: auto !important;
}

ul.order_details li:last-child {
    border: none;
}

ul.order_details li strong {
    display: block;
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 800;
    margin-top: 5px;
    text-transform: none;
}

/* عنوان‌های بخش‌ها */
.woocommerce-order h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* جدول جزئیات سفارش */
.woocommerce-table--order-details {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    margin-bottom: 40px !important;
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-table--order-details th, 
.woocommerce-table--order-details td {
    padding: 15px 20px !important;
    border-bottom: 1px solid #f5f5f5 !important;
    text-align: left;
}

.woocommerce-table--order-details thead th {
    background-color: #f9f9f9;
    color: #1a1a1a;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

.woocommerce-table--order-details tbody td {
    color: #555;
    font-size: 14px;
}

.woocommerce-table--order-details tfoot th {
    font-weight: 600;
    color: #555;
    text-align: left;
}

.woocommerce-table--order-details tfoot tr:last-child th,
.woocommerce-table--order-details tfoot tr:last-child td {
    background-color: #1a1a1a;
    color: #fff !important;
    font-size: 16px;
    font-weight: 800;
}

/* بخش آدرس‌ها */
.woocommerce-customer-details {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.woocommerce-column--billing-address, 
.woocommerce-column--shipping-address {
    flex: 1;
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #eee;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

.woocommerce-customer-details address {
    font-style: normal;
    color: #555;
    line-height: 1.6;
    border: none !important;
    padding: 0 !important;
}

/* موبایل */
@media (max-width: 768px) {
    ul.order_details {
        flex-direction: column;
        gap: 15px;
    }
    ul.order_details li {
        border: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px !important;
        width: 100% !important;
    }
    .woocommerce-customer-details {
        flex-direction: column;
    }
}
/* =========================================
   8. FIX ADDRESS BOXES (One Box Only)
   ========================================= */

/* 1. مخفی کردن باکس دوم (Shipping Address) */
.woocommerce-column--shipping-address,
.col-2 {
    display: none !important;
}

/* 2. تمام عرض کردن باکس اول (Billing Address) */
.woocommerce-columns--addresses {
    display: block !important; /* حالت ستونی */
    max-width: 1000px;
    margin: 0 auto;
}

.woocommerce-column--billing-address, 
.col-1 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
}

/* 3. استایل‌دهی به باکس آدرس (کارت سفید و تمیز) */
.woocommerce-column--billing-address address {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 15px;
    padding: 30px !important;
    font-style: normal;
    line-height: 1.8;
    color: #444;
    font-size: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.03);
    position: relative;
}

/* آیکون تزئینی کنار آدرس (اختیاری) */
.woocommerce-column--billing-address address::before {
    content: '\f3c5'; /* آیکون مکان */
    font-family: "Font Awesome 6 Free"; /* اگر فونت آوسام دارید */
    font-weight: 900;
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 24px;
    color: #eee;
}

/* استایل شماره تلفن و ایمیل */
.woocommerce-customer-details--phone,
.woocommerce-customer-details--email {
    margin-top: 10px;
    display: block;
    font-weight: 500;
    color: #1a1a1a;
}

/* آیکون برای تلفن و ایمیل (با استفاده از کاراکتر یونیکد ساده) */
.woocommerce-customer-details--phone::before {
    content: "📞 ";
}
.woocommerce-customer-details--email::before {
    content: "✉️ ";
}

/* عنوان آدرس */
.woocommerce-column__title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    display: block;
}