/* ============================================
   طراحی موبایل مطابق تصویر Sam Pardazesh
   ============================================ */

/* ========== Top Banner Mobile ========== */
.top-banner-container-mobile {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.top-banner-link-mobile {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.top-banner-img-mobile {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ========== Mobile Header (فقط باکس جستجو - ثابت برای همه صفحات) ========== */
.mobile-header {
    background: #fff !important;
    padding: 0.75rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    width: 100% !important;
    margin: 0 !important;
    min-height: auto !important;
}

.mobile-header-search-container {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
}


.mobile-search-form {
    width: 100% !important;
    margin: 0 !important;
}

.mobile-search-form .search-input-wrapper {
    position: relative;
    width: 100% !important;
    margin: 0 !important;
}

.mobile-search-form .search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.2rem;
    z-index: 2;
    pointer-events: none;
}

.mobile-search-input {
    width: 100% !important;
    height: 56px !important;
    padding: 0 52px 0 18px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    background: #f9fafb !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    font-family: 'IRANSans', 'IRANSansWeb', 'Vazir', sans-serif !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    display: block !important;
}

.mobile-search-input:focus {
    background: #fff !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.mobile-search-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.mobile-search-form .search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    background: #fff;
    border-radius: 12px;
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
}

.mobile-search-form .search-suggestions a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.mobile-search-form .search-suggestions a:last-child {
    border-bottom: none;
}

.mobile-search-form .search-suggestions a:hover {
    background: #f8fafc;
}

.mobile-search-form .search-suggestions .suggestion-type {
    font-size: 0.8rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

/* ========== Mobile Slider Styles (چسبیده به گوشه‌ها) ========== */
.mobile-slider-container {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-slider-wrapper {
    height: 200px;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden;
    position: relative;
    width: 100% !important;
}

.mobile-slider-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    border-radius: 0 !important;
}

.mobile-slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;
}

.mobile-slider-item.active {
    opacity: 1;
    z-index: 2;
}

.mobile-slider-content {
    position: relative;
    z-index: 3;
    color: white;
    text-align: right;
    padding: 1.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    max-width: 90%;
    margin: 0 auto;
}

.mobile-slider-content h1 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.mobile-slider-content p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.mobile-slider-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 6px;
}

.mobile-slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-slider-dot.active {
    background: white;
    width: 20px;
    border-radius: 3px;
}

/* ========== Brand Grid ========== */
.mobile-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.mobile-brand-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-brand-card:hover,
.mobile-brand-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

.mobile-brand-logo {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.mobile-brand-logo img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.mobile-brand-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.mobile-brand-name-english {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
}

.mobile-brand-arrow {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ========== Chat Widget Button Mobile Style ========== */
@media (max-width: 767.98px) {
    .chat-widget-button {
        bottom: 80px !important;
        right: 1rem !important;
        left: auto !important;
        width: 56px !important;
        height: 56px !important;
        background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%) !important;
        box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4) !important;
    }
    
    .chat-widget-button:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(20, 184, 166, 0.5) !important;
    }
    
    .chat-widget-popup {
        bottom: 140px !important;
        right: 1rem !important;
        left: auto !important;
        width: calc(100% - 2rem) !important;
        max-width: 380px !important;
    }
}

/* ========== Bottom Navigation Bar (طراحی مدرن و معلق - ثابت برای همه صفحات) ========== */
.mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    z-index: 1000 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    width: 100% !important;
    margin: 0 !important;
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    padding: 0.5rem 0.5rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
    position: relative;
    flex: 1;
    max-width: none;
}

.mobile-bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 0 0 3px 3px;
    transition: width 0.3s ease;
}

.mobile-bottom-nav-item.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
}

.mobile-bottom-nav-item.active::before {
    width: 60%;
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.mobile-bottom-nav-item.active i {
    color: #ef4444;
}

.mobile-bottom-nav-item:active {
    transform: translateY(0) scale(0.95);
}

.mobile-bottom-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
    color: inherit;
}

.mobile-bottom-nav-item.active i {
    transform: scale(1.1);
    color: #ef4444;
}

.mobile-bottom-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: all 0.3s ease;
}

.mobile-bottom-nav-item.active span {
    font-weight: 600;
    color: #ef4444;
}

.mobile-bottom-nav-item .badge {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(20%);
    font-size: 0.6rem !important;
    padding: 0.2rem 0.4rem !important;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* ========== Hide Desktop Elements on Mobile ========== */
@media (max-width: 767.98px) {
    /* Hide desktop header */
    .navbar,
    .top-banner-container:not(.mobile-top-info-banner),
    .site-header:not(.mobile-header) {
        display: none !important;
    }
    
    /* Add padding bottom for bottom nav (برای همه صفحات) */
    body {
        padding-bottom: 80px !important;
    }
    
    /* اطمینان از نمایش هدر و نوار پایین در همه صفحات */
    .mobile-header,
    .mobile-bottom-nav {
        display: flex !important;
    }
    
    /* جلوگیری از مخفی شدن هدر و نوار پایین */
    .d-md-none.mobile-header,
    .d-md-none.mobile-bottom-nav {
        display: flex !important;
    }
    
    /* Hide desktop footer on mobile */
    .footer {
        display: none !important;
    }
    
    /* Adjust main content */
    .container {
        padding-bottom: 1rem;
    }
    
    /* Show mobile slider instead of desktop hero slider */
    .hero-slider:not(.mobile-slider-wrapper) {
        display: none !important;
    }
    
    .mobile-slider-wrapper {
        display: block !important;
    }
    
    /* Adjust product sections for mobile */
    .products-section {
        padding: 1.5rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    
    /* Adjust category grid for mobile */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
    
    /* Daily deals section mobile adjustments */
    .daily-deals-section {
        margin-top: 1rem !important;
        padding: 1.5rem 0 !important;
    }
    
    .daily-deals-title {
        font-size: 1.25rem !important;
    }
}

/* ========== Desktop: Hide Mobile Elements ========== */
@media (min-width: 768px) {
    .mobile-top-info-banner,
    .mobile-header,
    .mobile-slider-container,
    .mobile-brand-grid,
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* ========== اطمینان از نمایش هدر و نوار پایین در همه صفحات موبایل ========== */
@media (max-width: 767.98px) {
    /* نمایش هدر موبایل در همه صفحات */
    .mobile-header.d-md-none {
        display: flex !important;
    }
    
    /* نمایش نوار پایین در همه صفحات */
    .mobile-bottom-nav.d-md-none {
        display: flex !important;
    }
    
    /* جلوگیری از مخفی شدن توسط استایل‌های دیگر */
    body .mobile-header,
    body .mobile-bottom-nav {
        display: flex !important;
    }
    
    /* اضافه کردن padding برای محتوا */
    main {
        padding-bottom: 80px !important;
    }
    
    .customer-profile-body main,
    .customer-profile-body .container {
        padding-bottom: 80px !important;
    }
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 480px) {
    .mobile-slider-container {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .mobile-slider-wrapper {
        height: 180px;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .mobile-slider-title {
        font-size: 1.1rem;
    }
    
    .mobile-slider-subtitle {
        font-size: 0.85rem;
    }
    
    .mobile-brand-grid {
        gap: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .mobile-brand-card {
        padding: 0.75rem;
    }
    
    .mobile-brand-logo {
        height: 40px;
    }
    
    .mobile-header-logo .logo-text {
        font-size: 1rem;
    }
}

