:root {
    --primary-pink: #ff4dc7; 
    --primary-pink-light: #FFE5EA;
    --primary-yellow: #FFC700;
    --bg-main: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(244,222,245,0.8));
    --card-white: #FFFFFF;
    --text-dark: #2B2B2B;
    --text-gray: #8F95A5;
    --border-light: #F0F0F0;
    
    --shadow-card: 0px 8px 24px rgba(149, 157, 165, 0.1);
    --shadow-float: 0px 10px 30px rgba(255, 77, 109, 0.3);
    
    --radius-main: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; font-family: 'Vazirmatn', sans-serif,'Poppins';}



body { 
    background-color: #ef95e2; 
    height: 100vh; 
    width: 100vw;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden; 
}
a{
    text-decoration: none;
}
/* --- فریم اپلیکیشن --- */
#app-frame {
    width: 100%;
    height: 100vh;
    background-color: var(--bg-main);
    position: relative;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.watermark-banner {
  position: fixed;
  bottom: 14%;
  left: 50%;
  transform: translate(-50%, -50%); /* وسط صفحه */
  background-color: rgba(255, 255, 255, 0.5); /* نیمه‌شفاف */
  color: #313131;
  padding: 6px 12px; /* کوچیک‌تر */
  font-size: 12px; /* کوچیک‌تر */
  font-family: 'Vazirmatn', sans-serif;
  border-radius: 6px;
  z-index: 10000;
  text-align: center;
  max-width: 80%; /* جلوگیری از بزرگ شدن بیش از حد در موبایل */
  white-space: nowrap; /* جلوگیری از شکستن خط */
}

.watermark-banner a {
  color: #bb9600;
  text-decoration: none;
}


/* --- ساختار صفحات --- */
.view-container { flex: 1; position: relative; overflow: hidden; }

.view {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    overflow-y: auto; padding-bottom: 110px !important;
    display: none; opacity: 0; transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: var(--bg-main);
    scrollbar-width: none; 
}
.view.active { display: block; opacity: 1; z-index: 1; }
.view::-webkit-scrollbar { display: none; }

/* --- هدر --- */
.app-header {
    padding: 45px 25px 15px; 
    display: flex; justify-content: space-between; align-items: center; 
    background: var(--bg-main); 
    position: sticky; top: 0; z-index: 10;
}
.menu-btn { font-size: 22px; color: var(--text-dark); cursor: pointer; padding: 5px; }
.location { display: flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--text-dark); max-width: 60%; }
.location span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.location i { margin-inline-end: 8px; color: var(--primary-pink); font-size: 18px; flex-shrink: 0; }
.lang-btn {
    background: white; padding: 6px 12px; border-radius: 12px; 
    font-size: 12px; font-weight: 800; color: var(--primary-pink); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); cursor: pointer;
}
/* ==================== استایل‌های نقشه (Leaflet Map) ==================== */
.old-price { font-size:12px; color:#999; }
.discount-tag { position:absolute; left:8px; top:8px; background:#ff5a7a; color:white; padding:4px 8px; border-radius:8px; font-size:12px; }
.sold-badge { position:absolute; right:8px; top:8px; background:#333; color:white; padding:4px 8px; border-radius:8px; font-size:12px; opacity:0.9; }
.add-mini-btn.disabled { opacity:0.4; pointer-events:none; }
.p-card.out-of-stock { opacity:0.7; pointer-events:auto; } /* اجازه میدیم برای نمایش جزئیات کلیک کنه ولی اضافه نشه */

.var-row.var-out { opacity:0.6; pointer-events:auto; } /* اجازه میده کاربر ببینه ولی انتخاب نمیشه */
.var-row.var-out .var-check { opacity:0.3; }
.no-stock-btn {
    background: #cfcfcf !important;
    border: none !important;
    cursor: not-allowed !important;
}
.detail-price-badge {
    background: rgba(255,255,255,0.25);
    padding: 5px 12px;
    border-radius: 12px;
}

.float-cart-btn.disabled {
    background: #a7a7a7 !important;
    cursor: not-allowed !important;
}

.float-cart-btn.disabled span {
    opacity: 0.6;
}

.no-stock-text {
    font-size: 10px;
    font-weight: bold;
    color: #555;
}

#map-container {
    width: 100%;
    height: 220px; /* این خط حیاتی است! اگر نباشد مپ دیده نمی‌شود */
    background-color: #e0e0e0; /* رنگ پس‌زمینه تا قبل از لود شدن مپ */
    border-radius: 24px;
    margin-top: 20px;
    overflow: hidden; /* برای گرد شدن گوشه‌های نقشه */
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* سایه نرم */
}

/* استایل پاپ‌آپ (کادر سفید روی پین) */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.98) !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15) !important;

}

/* =========================================================
   صفحه پیگیری سفارش — نسخه نهایی تم پینک (فوق‌العاده زیبا و ریسپانسیو)
   ========================================================= */

.page-section.tracking-page {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #fff0f8 0%, #fce8f5 50%, #fad0ec 100%);
    display: none;
    flex-direction: column;
    z-index: 999999999999999999999;
    overflow-y: auto;
    padding-bottom: 100px;
}

.page-section.tracking-page.active {
    display: flex;
    animation: fadeIn 0.6s ease-out;
}

/* دکمه برگشت — پینکی و شیک */
.mobile-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 52px;
    height: 52px;
    background: white;
    border: none;
    border-radius: 50%;
    color: var(--primary-pink);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 35px rgba(255, 77, 199, 0.3);
    z-index: 99999;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.mobile-back-btn:hover {
    transform: scale(1.12) translateY(-4px);
    box-shadow: 0 20px 50px rgba(255, 77, 199, 0.45);
}

.mobile-back-btn:active {
    transform: scale(0.95);
}

/* رپر اصلی */
.tracking-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 90px 20px 40px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* هدر */
.tracking-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.tracking-title {
    font-size: 34px;
    font-weight: 900;
    color: var(--primary-pink);
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 20px rgba(255, 77, 199, 0.25);
}

.tracking-subtitle {
    font-size: 16px;
    color: #888;
    font-weight: 500;
    opacity: 0.9;
    margin: 0;
}

/* کارت اصلی سفارش */
.current-order-card {
    background: white;
    border-radius: 32px;
    padding: 35px 28px;
    width: 100%;
    box-shadow: 
        0 25px 60px rgba(255, 77, 199, 0.22),
        0 8px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    animation: popUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.current-order-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 7px;
    background: linear-gradient(90deg, #ff4dc7, #ff8adc, #ff4dc7);
    border-radius: 32px 32px 0 0;
}

/* شماره سفارش */
.order-ref-big {
    font-size: 31px;
    font-weight: 900;
    color: var(--primary-pink);
    letter-spacing: 4px;
    text-align: center;
    margin: 8px 0 25px;
    font-family: 'Montserrat', sans-serif;
}

/* وضعیت سفارش */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 800;
    margin: 20px auto;
    min-width: 240px;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.status-pill i {
    font-size: 24px;
    animation: pulse 2s infinite;
}

/* شبکه اطلاعات */
.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 35px 0;
}

.info-item {
    background: #fdf2f8;
    padding: 22px 18px;
    border-radius: 22px;
    text-align: center;
    border: 2px dashed rgba(255, 77 199 / 0.25);
    transition: all 0.4s;
}

.info-item:hover {
    transform: translateY(-6px);
    border-style: solid;
    border-color: var(--primary-pink);
    box-shadow: 0 15px 40px rgba(255, 77 199 / 0.2);
}

.info-item i {
    font-size: 30px;
    color: var(--primary-pink);
    margin-bottom: 12px;
    display: block;
}

.info-item small {
    display: block;
    color: #999;
    font-size: 13.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.info-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-dark);
}

.price-big {
    font-size: 29px !important;
    background: linear-gradient(90deg, #ff4dc7, #ff1493);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

/* نکته پایین */
.refresh-hint {
    text-align: center;
    margin-top: 40px;
    padding: 22px;
    background: linear-gradient(135deg, rgba(255,77,199,0.1), rgba(255,140,220,0.05));
    border-radius: 24px;
    color: var(--primary-pink);
    font-size: 15.5px;
    font-weight: 700;
    border: 2.5px dashed rgba(255,77,199,0.35);
    backdrop-filter: blur(8px);
}

/* لودر */
.tracking-loader {
    text-align: center;
    padding: 100px 20px;
    color: #bbb;
}

.tracking-loader i {
    font-size: 70px;
    color: var(--primary-pink);
    margin-bottom: 25px;
    animation: spin 2s linear infinite;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popUp {
    0% { transform: scale(0.85); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ریسپانسیو کامل */
@media (max-width: 480px) {
    .mobile-back-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
        top: 15px;
        left: 15px;
    }

    .tracking-title {
        font-size: 28px;
    }

    .order-ref-big {
        font-size: 26px;
        letter-spacing: 2px;
    }

    .status-pill {
        font-size: 16px;
        padding: 12px 24px;
        min-width: auto;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .current-order-card {
    
        padding: 28px 20px;
    }

    .price-big {
        font-size: 26px !important;
    }
}
.leaflet-popup-content {
    margin: 10px 14px !important;
    font-family: 'Vazirmatn', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-dark) !important;
    text-align: center;
}
.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.98) !important;
}
.leaflet-popup-close-button {
    display: none !important; /* حذف دکمه ضربدر برای زیبایی */
}
/* --- اصلاحیه بخش پین و انیمیشن --- */

/* کانتینر اصلی آیکون که لیفلت می‌سازد */
.custom-pin {
    display: flex !important;
    justify-content: center;
    align-items: center;
    position: relative;
    /* این ابعاد باید با iconSize در جاوااسکریپت یکی باشد */
    width: 40px; 
    height: 40px;
}

/* دایره مرکزی (نقطه ثابت) */
.pin-inner {
    width: 14px;
    height: 14px;
    background-color: var(--primary-pink);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 10; /* حتما بالاتر از موج باشد */
    position: relative; /* برای اینکه z-index کار کند */
}

/* دایره موج‌دار (انیمیشن) */
.pin-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto; /* ترفند وسط‌چین کردن مطلق */
    width: 100%; /* پر کردن کل فضای کانتینر */
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary-pink);
    opacity: 0;
    z-index: 1; /* پایین‌تر از دایره مرکزی */
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* انیمیشن جدید: فقط اسکیل تغییر می‌کند، ترنسلیت حذف شد تا مرکز بهم نریزد */
@keyframes pulse-ring {
    0% {
        transform: scale(0.3);
        opacity: 0.8;
    }
    80%, 100% {
        transform: scale(1.5); /* موج تا 1.5 برابر سایز کانتینر بزرگ می‌شود */
        opacity: 0;
    }
}

/* تنظیم دقیق پاپ‌آپ (اسم رستوران) */
.leaflet-popup {
    margin-bottom: 5px; /* کمی فاصله از پین */
}

/* حذف کنترلرها اگر احیاناً باقی ماندند */
.leaflet-control-attribution { display: none !important; }
/* --- خانه --- */
.hero-title { padding: 0 25px; font-size: 24px; font-weight: 800; color: var(--text-dark); line-height: 1.5; margin-bottom: 20px; }
.text-pink { color: var(--primary-pink); }
.text-yellow { color: var(--primary-pink); }

.search-box { padding: 0 25px; display: flex; gap: 15px; margin-bottom: 25px; }
.search-input { 
    flex: 1; background: var(--card-white); border-radius: 16px; padding: 0 15px; height: 50px; 
    display: flex; align-items: center; box-shadow: var(--shadow-card); 
}
.search-input input { 
    border: none; outline: none; width: 100%; background: transparent; 
    font-size: 14px; margin-inline-start: 10px; color: var(--text-dark);
}

/* --- دکمه فیلتر و کتگوری --- */
.filter-btn-icon {
    width: 45px; height: 45px; flex-shrink: 0;
    background: var(--text-dark); color: white; border-radius: 14px;
    display: flex; justify-content: center; align-items: center;
    margin-inline-end: 12px; cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.category-scroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.category-scroll::-webkit-scrollbar { display: none; }
.cat-chip { 
    display: flex; align-items: center; padding: 10px 20px; 
    background: var(--card-white); border-radius: 50px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); cursor: pointer; 
    white-space: nowrap; transition: 0.3s; 
    font-size: 13px; font-weight: 600; color: var(--text-gray); 
}
.cat-chip.active { background: var(--primary-pink); color: white; box-shadow: 0 8px 20px rgba(255, 77, 109, 0.3); }
.cat-chip i { margin-inline-end: 8px; font-size: 16px; }

/* --- گرید محصولات --- */
.products-grid { padding: 0 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-bottom: 40px; }
.p-card { 
    background: var(--card-white); border-radius: var(--radius-main); padding: 12px; 
    box-shadow: var(--shadow-card); text-align: center; position: relative; 
    transition: transform 0.2s; cursor: pointer; overflow: hidden;
}
.p-card:active { transform: scale(0.97); }

.discount-tag { 
    position: absolute; top: 36px; left: 12px; 
    background: #FF3B30; color: white; font-size: 10px; font-weight: 800; 
    padding: 4px 8px; border-radius: 8px; z-index: 2;
}
html[dir="ltr"] .discount-tag { left: 12px; right: auto; }
html[dir="rtl"] .discount-tag { right: 12px; left: auto; }

.fav-btn { position: absolute; top: 12px; left: 12px; color: #E0E0E0; z-index: 3; font-size: 18px; transition: 0.3s; }
html[dir="ltr"] .fav-btn { right: 12px; left: auto; }
html[dir="rtl"] .fav-btn { left: 12px; right: auto; }
.fav-btn.active { color: var(--primary-pink); }

.p-img { width: 100%; height: 100px; object-fit: contain; margin: 15px 0 10px; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1)); }
.p-title { font-weight: 700; font-size: 14px; color: var(--text-dark); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.p-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.price-col { display: flex; flex-direction: column; align-items: flex-start; }
.old-price { font-size: 11px; text-decoration: line-through; color: #ccc; margin-bottom: 2px; }
.curr-price { font-size: 14px; font-weight: 800; color: var(--text-dark); }
.curr-price small { font-size: 10px; font-weight: 500; }

.add-mini-btn { 
    width: 32px; height: 32px; background: var(--primary-pink); 
    border-radius: 10px; display: flex; justify-content: center; align-items: center; 
    color: #ffffff; font-size: 12px; box-shadow: 0 4px 10px rgba(255, 199, 0, 0.3);
}

/* --- جزئیات --- */
#detail-view { background: var(--bg-main); z-index: 20; }
.detail-header {
  position: relative;
  width: 100%;
  height: 320px;
  /* background را از اینجا حذف می‌کنیم */
  background: transparent; 
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* این لایه زرد رنگ است که برش می‌خورد */
.detail-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: var(--primary-pink);
  
  /* برش دایره‌ای (گاز زده) فقط روی این لایه اعمال می‌شود */
  -webkit-mask: radial-gradient(circle 160px at bottom center, transparent 98%, black 100%);
          mask: radial-gradient(circle 160px at bottom center, transparent 98%, black 100%);
  
  z-index: -1; /* می‌رود پشت عکس */
  border-radius: 0 0 40px 40px; /* گردی گوشه‌های کناری (اختیاری) */
}

/* تنظیم عکس برای اینکه روی دایره بیاید */
.big-food-img {
  width: 240px; 
  height: 240px; 
  object-fit: contain; 
  
  /* تنظیم موقعیت */
  margin-top: 20px; 
  
  /* سایه و انیمیشن */
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15)); 
  animation: float 6s ease-in-out infinite;
  
  /* نکته مهم: اگر عکس خیلی پایین است، با این عدد بازی کن تا بیاید بالا */
  transform: translateY(-10px); 
  
  z-index: 10; /* عکس همیشه رو قرار می‌گیرد */
}
.detail-nav { position: absolute; top: 45px; width: 100%; padding: 0 25px; display: flex; justify-content: space-between; z-index: 5; }
.nav-icon-btn { 
    width: 40px; height: 40px; background: rgba(255,255,255,0.4); 
    backdrop-filter: blur(5px); border-radius: 12px; 
    display: flex; justify-content: center; align-items: center; 
    color: #333; cursor: pointer; font-size: 16px; transition: 0.2s;
}
.overlay.open {
    opacity: 1;
    pointer-events: all;
    z-index: 150 !important;
}

.sidebar {
    z-index: 200 !important;
}

.sidebar.open {
    transform: translateX(0) !important; /* برای rtl هم همین */
}
.big-food-img { 
    width: 240px; height: 240px; object-fit: contain; margin-top: 40px; 
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15)); animation: float 6s ease-in-out infinite; 
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.detail-content { padding: 30px 25px 120px; text-align: center; height: 65%; overflow-y: auto; }
.meta-row { display: flex; justify-content: center; gap: 10px; margin: 15px 0; flex-wrap: wrap; }
.meta-badge { 
    background: var(--bg-main); padding: 6px 14px; border-radius: 20px; 
    font-size: 11px; color: var(--text-gray); display: flex; align-items: center; 
}
.meta-badge i { color: var(--primary-pink); margin-inline-end: 6px; }

.qty-control { 
    display: inline-flex; align-items: center; background: var(--primary-pink); 
    padding: 8px 25px; border-radius: 30px; color: white; gap: 20px; 
    margin: 20px 0; box-shadow: var(--shadow-float);
}
.qty-btn { font-size: 20px; font-weight: bold; cursor: pointer; }

.variations-box { text-align: start; margin-top: 25px; border-top: 1px dashed #eee; padding-top: 20px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 15px; }

.var-row { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px; border: 1px solid var(--border-light); border-radius: 14px; 
    margin-bottom: 10px; cursor: pointer; transition: 0.2s; 
}
.var-row.selected { border-color: var(--primary-pink); background: var(--primary-pink-light); }
.var-check { 
    width: 20px; height: 20px; border: 2px solid #ddd; border-radius: 6px; 
    margin-inline-end: 12px; display: flex; align-items: center; justify-content: center;
}
.var-row.selected .var-check { background: var(--primary-pink); border-color: var(--primary-pink); }
.var-check i { color: white; font-size: 10px; display: none; }
.var-row.selected .var-check i { display: block; }

.float-cart-btn { 
 
    background: var(--primary-pink); color: white; padding: 18px 25px; 
    border-radius: 20px; border: none; font-size: 16px; font-weight: 700; 
    box-shadow: var(--shadow-float); cursor: pointer; display: flex; 
    justify-content: space-between; align-items: center; z-index: 30; 
}
.float-cart-btn {
    position: fixed !important;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    width: calc(100% - 50px);
    max-width: 400px;
}
/* --- سبد خرید --- */

.cart-card { 
    display: flex; align-items: center; background: white; padding: 15px; 
    border-radius: 20px; margin-bottom: 15px; box-shadow: var(--shadow-card); 
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.cart-thumb { width: 65px; height: 65px; object-fit: contain; margin-inline-end: 15px; }
.cart-details { flex: 1; }
.cart-name { font-weight: 700; font-size: 14px; color: var(--text-dark); }
.cart-price { font-weight: 700; color: var(--primary-pink); margin-top: 5px; font-size: 14px; }

.cart-actions { 
    display: flex; flex-direction: column; align-items: center; gap: 8px; 
    background: #F8F9FB; padding: 8px 6px; border-radius: 12px; margin-inline-start: 10px;
}
.qty-mini { font-size: 14px; font-weight: 700; }
.act-btn { color: var(--text-dark); cursor: pointer; font-size: 12px; }

.bill-panel {
    position: fixed !important;
    bottom: 93px;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    padding: 25px 25px 23px;
    border-radius: 35px 35px 35px 35px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.08);
    z-index: 90;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.bill-panel.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}
.cart-list {
    padding: 20px 25px 350px 25px !important;
    padding-bottom: 380px !important;
    min-height: calc(100vh - 300px);
}

/* مودال موفقیت سفارش */
.success-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 999999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-modal.show {
    opacity: 1;
    pointer-events: all;
}

.success-content {
    background: white;
    width: 90%;
    max-width: 380px;
    border-radius: 28px;
    padding: 40px 25px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-icon {
    width: 90px; height: 90px;
    background: var(--primary-pink);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 44px;
    margin: 0 auto 25px;
    box-shadow: 0 10px 30px rgba(255, 77, 199, 0.4);
}

.success-content h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.order-number {
    font-size: 18px;
    color: var(--text-dark);
    margin: 15px 0;
}

.order-number strong {
    color: var(--primary-pink);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
}

.success-btn {
    margin-top: 25px;
    width: 100%;
    background: var(--primary-pink);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-float);
}
/* نمایش خطا در فیلدها */
.form-group {
    position: relative;
    transition: all 0.3s;
}

.form-group.error .form-input {
    border-color: #FF3B30 !important;
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.15);
    background-color: #fff8f8;
}

.form-group.error .form-label {
    color: #FF3B30;
}

/* لرزش کوچک برای جلب توجه */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.form-group.error {
    animation: shake 0.5s ease-in-out;
}
#cart-view {
    padding-bottom: 380px !important;
}
.bill-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; color: var(--text-gray); font-weight: 500; }
.bill-total { font-size: 18px; font-weight: 800; color: var(--text-dark); margin-top: 15px; padding-top: 15px; border-top: 1px dashed #eee; }
.checkout-btn { 
    width: 100%; background: var(--primary-pink); color: white; padding: 18px; 
    border-radius: 18px; border: none; font-weight: 700; font-size: 16px; 
    box-shadow: var(--shadow-float); cursor: pointer; margin-top: 20px; 
}

/* --- فرم اطلاعات --- */
.info-form { padding: 25px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; color: var(--text-dark); margin-bottom: 8px; font-weight: 700; }
.form-input { 
    width: 100%; padding: 16px; border: 1px solid var(--border-light); 
    background: white; border-radius: 16px; outline: none; transition: 0.3s; font-size: 14px; 
}
.form-input:focus { border-color: var(--primary-pink); box-shadow: 0 0 0 4px var(--primary-pink-light); }

.service-switch { 
    display: flex; justify-content: space-between; align-items: center; 
    background: white; padding: 15px; border-radius: 18px; 
    margin-bottom: 25px; box-shadow: var(--shadow-card); 
}
.switch-toggle { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #E0E0E0; transition: .4s; border-radius: 34px; }
.slider:before {
    position: absolute; content: ""; height: 22px; width: 22px; left: 28px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: var(--primary-pink); }
html[dir="ltr"] input:checked + .slider:before { transform: translateX(24px); }
html[dir="rtl"] input:checked + .slider:before { transform: translateX(-24px); }

/* --- پروفایل و دکمه‌های شبکه اجتماعی --- */
.social-grid { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.social-btn {
    width: 50px; height: 50px; background: white; border-radius: 15px;
    display: flex; justify-content: center; align-items: center;
    font-size: 24px; box-shadow: var(--shadow-card); transition: 0.2s;
}
.social-btn:active { transform: scale(0.9); }
.map-btn {
    display: inline-block; background: var(--primary-pink); color: white;
    text-decoration: none; padding: 12px 25px; border-radius: 15px;
    font-size: 14px; font-weight: 700; margin-top: 10px;
}

/* --- مودال فیلتر - کاملاً سازگار با safe area (آیفون + اندروید جدید) --- */
.filter-modal {
    position: fixed;                     /* مهم: از absolute به fixed تغییر کرد */
    inset-inline-start: 0;               /* left: 0 با احترام به rtl */
    inset-inline-end: 0;                 /* right: 0 */
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    background: white;
    border-radius: 30px 30px 0 0;
    padding: 25px 25px 50px;
    z-index: 200;
    
    /* مهم‌ترین بخش: فاصله از پایین صفحه با احترام به safe area */
    padding-bottom: calc(50px + env(safe-area-inset-bottom, 20px));
    /* یا روش بهتر و کاملاً پشتیبانی‌شده: */
    padding-bottom: calc(50px + max(env(safe-area-inset-bottom), 20px));

    /* برای مرورگرهای قدیمی */
    padding-bottom: calc(50px + constant(safe-area-inset-bottom));
    padding-bottom: calc(50px + env(safe-area-inset-bottom));

    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.12);
    will-change: transform;
}

.filter-modal.open {
    transform: translateY(0);
}

/* اگر مرورگر env() رو نمی‌شناخت، حداقل فاصله بده */
@supports not (padding-bottom: env(safe-area-inset-bottom)) {
    .filter-modal {
        padding-bottom: 70px !important; /* 50px + حداقل 20px فاصله */
    }
}
.filter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; font-weight: 800; font-size: 18px; color: var(--text-dark); }
.filter-header i { padding: 10px; cursor: pointer; color: #999; }

.filter-options { display: flex; flex-direction: column; gap: 10px; }
.filter-option {
    padding: 18px; background: var(--bg-main); border-radius: 18px;
    font-size: 15px; font-weight: 600; color: var(--text-dark);
    display: flex; align-items: center; cursor: pointer;
}
.filter-option i { margin-inline-end: 12px; font-size: 18px; }
.filter-option:active { background: #eee; }

/* --- منوی پایین --- */
.bottom-nav { 
    position: fixed;                    /* به جای absolute → fixed */
    left: 0;
    right: 0;
    bottom: 0;
    height: 85px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.04);
    z-index: 100;
    
    /* مهم‌ترین بخش: احترام به safe area */
    padding-bottom: env(safe-area-inset-bottom, 20px);   /* اگر safe area بود از اون استفاده کن، وگرنه حداقل 20px */
    padding-bottom: max(env(safe-area-inset-bottom), 20px); /* بهترین روش برای همه مرورگرها */
    
    /* برای مرورگرهای قدیمی که env() رو پشتیبانی نمی‌کنن */
    padding-bottom: constant(safe-area-inset-bottom); /* برای iOS < 11.2 */
    padding-bottom: env(safe-area-inset-bottom);      /* برای iOS ≥ 11.2 و اندروید */
}

/* اگر مرورگر env() رو نمی‌شناخت، حداقل 20px فاصله بده */
@supports not (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: 20px !important;
    }
}
.nav-item { font-size: 24px; color: #D1D5DB; cursor: pointer; position: relative; padding: 10px; transition: 0.3s; }
.nav-item.active { color: var(--primary-pink); transform: translateY(-5px); }
.cart-badge { 
    position: absolute; top: 5px; right: 5px; background: var(--primary-pink); 
    color: white; width: 18px; height: 18px; font-size: 10px; border-radius: 50%; 
    display: flex; justify-content: center; align-items: center; border: 2px solid white; 
    transform: scale(0); transition: 0.3s; 
}
.cart-badge.show { transform: scale(1); }

/* --- سایدبار و تست --- */
.sidebar { 
    position: absolute; top: 0; left: 0; width: 75%; height: 100%; 
    background: white; z-index: 200; transform: translateX(-100%); 
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); padding: 50px 30px; 
    box-shadow: 10px 0 40px rgba(0,0,0,0.1); 
}
html[dir="rtl"] .sidebar { right: 0; left: auto; transform: translateX(100%); }
.sidebar.open { transform: translateX(0); }

.side-link { display:flex; align-items:center; margin-bottom:30px; cursor:pointer; font-weight: 600; color: var(--text-dark); }
.side-link i { color:var(--primary-pink); width:35px; font-size: 20px; }

.overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.4); z-index: 150; opacity: 0; 
    pointer-events: none; transition: 0.3s; backdrop-filter: blur(3px); 
}
.overlay.open { opacity: 1; pointer-events: all; }

.toast { 
    position: absolute; top: 30px; left: 50%; transform: translateX(-50%) translateY(-100px); 
    background: #2D2D2D; color: white; padding: 12px 25px; border-radius: 30px; 
    font-size: 13px; font-weight: 500; z-index: 300; transition: 0.4s; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); width: max-content; display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast i { color: var(--primary-pink); }