/* ============================================================
   mobile-premium.css — التصميم البريميوم للهاتف
   الفلسفة: مساحات مدروسة + بطاقات أنيقة + تسلسل بصري واضح
   يُحمَّل بعد style.min.css مباشرة
   ============================================================ */

@media (max-width: 768px) {

    html { font-size: 14px; }

    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
        background: var(--bg, #f7f6f4);
    }
    .dark-mode body { background: #0f172a; }

    /* ============ 1) الهيدر — نظيف ومتوازن ============ */
    .header {
        position: sticky;
        top: 0;
        z-index: 90;
        background: rgba(255,255,255,0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(15,23,42,0.06);
        padding: 10px 16px;
    }
    .dark-mode .header {
        background: rgba(15,23,42,0.92);
        border-bottom-color: rgba(255,255,255,0.06);
    }
    .header-inner { min-height: 40px; }
    .header .logo img { width: 84px; height: auto; }
    .nav-icon-btn {
        width: 36px; height: 36px;
        font-size: 0.95rem;
        border-radius: 12px;
        color: var(--text-main, #0f172a);
        transition: background 0.2s ease;
    }
    .nav-icon-btn:active { background: rgba(212,175,55,0.12); }

    /* ============ 2) قسم البطل — صورة كاملة + بطاقة نصية ============ */
    .hero-section {
        padding: 0;
        gap: 0;
        flex-direction: column;
    }
    /* البطاقة النصية تطفو فوق الصورة */
    .hero-info-card {
        order: 2;
        margin: -56px 16px 0;
        position: relative;
        z-index: 2;
        padding: 22px 20px;
        border-radius: 20px;
        background: var(--card-bg, #fff);
        border: none;
        box-shadow: 0 12px 32px rgba(15,23,42,0.10);
        text-align: center;
    }
    .hero-info-card h1 {
        font-size: 1.3rem;
        line-height: 1.5;
        margin-bottom: 8px;
        font-weight: 800;
    }
    .hero-info-card h1 span { color: #b8912a; }
    .hero-info-card p {
        font-size: 0.82rem;
        line-height: 1.7;
        color: var(--text-sub, #64748b);
        margin-bottom: 14px;
    }
    .cta-button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 11px 24px;
        font-size: 0.85rem;
        font-weight: 700;
        border-radius: 40px;
        background: #0f172a;
        color: #fff;
        box-shadow: 0 8px 20px rgba(15,23,42,0.22);
        transition: transform 0.2s ease;
    }
    .cta-button:active { transform: scale(0.96); }

    .hero-visual-card {
        order: 1;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .hero-visual-card .slider { height: 240px; }
    .hero-visual-card .slider img {
        width: 100%;
        height: 240px;
        object-fit: cover;
    }
    .slider-arrows-external .arrow-btn {
        width: 32px; height: 32px;
        font-size: 0.75rem;
        border-radius: 50%;
        background: rgba(255,255,255,0.9);
        color: #0f172a;
        box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    }

    /* ============ 3) عناوين الأقسام — تسلسل بصري ============ */
    .section-header {
        margin: 0 0 16px;
        padding: 0 16px;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
    }
    .section-header h2 {
        font-size: 1.15rem;
        font-weight: 800;
        margin: 0;
    }
    .section-header p {
        font-size: 0.75rem;
        color: var(--text-sub, #94a3b8);
        margin: 2px 0 0;
    }

    /* ============ 4) البحث — بارز وواضح ============ */
    .search-section {
        padding: 26px 16px 0;
        margin-bottom: 34px;
    }
    .search-container { margin-bottom: 0; }
    .search-input-main {
        padding: 14px 46px 14px 46px !important;
        font-size: 15px !important;
        border-radius: 16px !important;
        border: 1.5px solid rgba(15,23,42,0.08) !important;
        background: var(--card-bg, #fff) !important;
        box-shadow: 0 2px 10px rgba(15,23,42,0.04) !important;
    }
    .dark-mode .search-input-main { border-color: rgba(255,255,255,0.1) !important; }
    .search-input-main:focus {
        border-color: #d4af37 !important;
        box-shadow: 0 0 0 3px rgba(212,175,55,0.12) !important;
    }
    .search-input-main::placeholder { color: #a8b3c2; }
    .search-icon-main { right: 16px; font-size: 16px; color: #a8b3c2; }
    .search-results-main { font-size: 12px; margin-top: 10px; }

    .search-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin-top: 18px;
    }
    /* بطاقة موحدة لكل المنتجات */
    .search-product-card {
        border-radius: 16px;
        background: var(--card-bg, #fff);
        border: 1px solid rgba(15,23,42,0.05);
        box-shadow: 0 2px 10px rgba(15,23,42,0.05);
        overflow: hidden;
        transition: transform 0.2s ease;
    }
    .search-product-card:active { transform: scale(0.97); }
    .search-product-image { aspect-ratio: 1/1; object-fit: cover; }
    .search-product-info { padding: 12px; }
    .search-product-name {
        font-size: 12.5px;
        font-weight: 700;
        min-height: 34px;
        line-height: 1.4;
        color: var(--text-main, #0f172a);
        margin-bottom: 6px;
    }
    .search-product-category {
        font-size: 10.5px;
        color: #a8b3c2;
        margin-bottom: 8px;
    }
    .search-product-price {
        display: flex;
        align-items: baseline;
        gap: 6px;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }
    .search-price-final { font-size: 14px; font-weight: 800; color: #b8912a; }
    .search-price-original { font-size: 11px; color: #b6bfc9; }
    .search-discount-badge {
        font-size: 9.5px;
        font-weight: 700;
        background: #fee2e2;
        color: #dc2626;
        padding: 2px 7px;
        border-radius: 20px;
    }
    .search-buy-btn {
        width: 100%;
        padding: 9px;
        font-size: 12px;
        font-weight: 700;
        border-radius: 10px;
        background: rgba(15,23,42,0.05);
        color: var(--text-main, #0f172a);
        transition: all 0.2s ease;
    }
    .dark-mode .search-buy-btn { background: rgba(255,255,255,0.08); color: #f1f5f9; }
    .search-buy-btn:active { background: #0f172a; color: #fff; }
    .no-search-results {
        margin-top: 18px;
        padding: 40px 20px;
        border-radius: 16px;
        font-size: 13px;
    }

    /* ============ 5) بطاقات التخفيضات والأكثر مبيعاً — بطاقة موحدة ============ */
    .discounts-section { margin-bottom: 38px; }
    .discounts-slider-wrapper,
    .bestseller-slider-wrapper { padding: 0 12px; }

    .discount-card, .product-card-scroll {
        min-width: 158px;
        width: 158px;
        border-radius: 16px;
        background: var(--card-bg, #fff);
        border: 1px solid rgba(15,23,42,0.05);
        box-shadow: 0 2px 10px rgba(15,23,42,0.05);
        overflow: hidden;
        transition: transform 0.2s ease;
    }
    .discount-card:active, .product-card-scroll:active { transform: scale(0.97); }

    .discount-image-wrapper, .product-image-wrapper { position: relative; }
    .discount-image-wrapper img,
    .product-image-wrapper img {
        width: 158px !important;
        height: 158px !important;
        object-fit: cover;
        display: block;
    }
    /* شارة الخصم — نظيفة وبارزة */
    .discount-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 10.5px;
        font-weight: 800;
        padding: 4px 9px;
        border-radius: 20px;
        background: #dc2626;
        color: #fff;
        box-shadow: 0 3px 8px rgba(220,38,38,0.35);
    }
    .discount-info, .product-info { padding: 12px; }
    .discount-title, .product-title {
        font-size: 12.5px;
        font-weight: 700;
        min-height: 34px;
        line-height: 1.4;
        color: var(--text-main, #0f172a);
        margin-bottom: 6px;
    }
    .discount-price-container, .product-price-container {
        display: flex;
        align-items: baseline;
        gap: 6px;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }
    .discount-final-price, .current-price {
        font-size: 14px;
        font-weight: 800;
        color: #b8912a;
    }
    .discount-original-price, .old-price {
        font-size: 11px;
        color: #b6bfc9;
        text-decoration: line-through;
    }
    .discount-percent {
        font-size: 9.5px;
        font-weight: 700;
        background: #fee2e2;
        color: #dc2626;
        padding: 2px 7px;
        border-radius: 20px;
    }
    .discount-btn, .add-to-cart-btn {
        width: 100%;
        padding: 9px !important;
        font-size: 12px;
        font-weight: 700;
        border-radius: 10px;
        background: rgba(15,23,42,0.05);
        color: var(--text-main, #0f172a);
        transition: all 0.2s ease;
    }
    .dark-mode .discount-btn, .dark-mode .add-to-cart-btn {
        background: rgba(255,255,255,0.08); color: #f1f5f9;
    }
    .discount-btn:active, .add-to-cart-btn:active { background: #0f172a; color: #fff; }

    /* نقاط التنقل أسفل السلايدر */
    .discounts-dots { margin-top: 14px; gap: 6px; }
    .discount-dot {
        width: 6px; height: 6px;
        border-radius: 10px;
        background: #cbd5e1;
        opacity: 0.5;
        transition: all 0.3s ease;
    }
    .discount-dot.active { opacity: 1; width: 20px; background: #d4af37; }

    /* ============ 6) بطاقات التصنيفات — سينمائية ============ */
    .showcase-container { padding: 0 16px; margin-bottom: 38px; }
    .fluid-grid { gap: 12px; grid-template-columns: repeat(2, 1fr); }
    .fluid-card {
        border-radius: 18px;
        overflow: hidden;
        position: relative;
        aspect-ratio: 4/4.5;
        box-shadow: 0 4px 14px rgba(15,23,42,0.08);
        transition: transform 0.2s ease;
    }
    .fluid-card:active { transform: scale(0.97); }
    .fluid-img-wrapper, .fluid-img-wrapper img {
        width: 100%; height: 100%;
        object-fit: cover;
    }
    .fluid-card::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(0deg, rgba(15,23,42,0.65) 0%, transparent 55%);
    }
    .fluid-meta {
        position: absolute;
        bottom: 0; left: 0; right: 0;
        z-index: 2;
        padding: 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: none;
    }
    .fluid-meta h3 {
        font-size: 14px;
        font-weight: 800;
        color: #fff;
        text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }
    .fluid-btn-circle {
        width: 30px; height: 30px;
        font-size: 0.72rem;
        border-radius: 50%;
        background: rgba(255,255,255,0.92);
        color: #0f172a;
        backdrop-filter: blur(4px);
        flex-shrink: 0;
    }

    /* ============ 7) شريط السلة العائم ============ */
    .fluid-cart-pill {
        left: 16px; right: 16px;
        padding: 10px 10px 10px 16px;
        border-radius: 18px;
        background: #0f172a;
        border: 1px solid rgba(212,175,55,0.25);
        box-shadow: 0 12px 32px rgba(15,23,42,0.35);
        backdrop-filter: blur(12px);
    }
    .fluid-cart-pill a {
        padding: 9px 18px;
        font-size: 0.82rem;
        font-weight: 700;
        border-radius: 12px;
        background: #d4af37;
        color: #0f172a;
    }

    /* ============ 8) شريط التنقل السفلي — حبة دواء ============ */
    .bottom-dock {
        left: 16px; right: 16px;
        bottom: max(12px, env(safe-area-inset-bottom, 12px));
        min-height: 60px;
        padding: 6px;
        border-radius: 22px;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(15,23,42,0.07);
        box-shadow: 0 8px 28px rgba(15,23,42,0.14);
    }
    .dark-mode .bottom-dock {
        background: rgba(30,41,59,0.95);
        border-color: rgba(255,255,255,0.08);
    }
    .dock-item {
        font-size: 10px;
        font-weight: 600;
        gap: 3px;
        border-radius: 16px;
        padding: 8px 4px;
        color: #94a3b8;
        transition: all 0.2s ease;
        position: relative;
    }
    .dock-item i { font-size: 1.05rem; }
    .dock-item.active { color: #b8912a; }
    .dock-item.active::before {
        content: "";
        position: absolute;
        bottom: 3px;
        width: 4px; height: 4px;
        border-radius: 50%;
        background: #d4af37;
    }
    .dock-item:active { transform: scale(0.94); }

    /* ============ 9) نافذة المنتج ============ */
    .modal-overlay { background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); }
    .modal-box {
        width: calc(100% - 32px);
        max-width: 400px;
        border-radius: 24px;
        padding: 20px;
        max-height: 86vh;
        overflow-y: auto;
        background: var(--card-bg, #fff);
        box-shadow: 0 24px 64px rgba(15,23,42,0.35);
        border: none;
    }
    .modal-img-container {
        border-radius: 16px;
        overflow: hidden;
        background: rgba(15,23,42,0.03);
    }
    .dark-mode .modal-img-container { background: rgba(255,255,255,0.04); }
    .modal-img-container img { width: 100%; max-height: 220px; object-fit: contain; }
    .modal-title { font-size: 1.05rem; font-weight: 800; margin: 14px 0 8px; }
    #modal-price-area { margin-bottom: 16px !important; }
    #modal-price-area span:first-child { font-size: 1.4rem !important; font-weight: 800; color: #b8912a; }
    .modal-section-label { font-size: 0.8rem; font-weight: 700; margin: 14px 0 8px; color: var(--text-sub, #64748b); }
    .chip-label {
        padding: 8px 14px;
        font-size: 12px;
        font-weight: 600;
        border-radius: 10px;
        border: 1.5px solid rgba(15,23,42,0.1);
        color: var(--text-main, #0f172a);
        transition: all 0.2s ease;
    }
    .dark-mode .chip-label { border-color: rgba(255,255,255,0.12); color: #e2e8f0; }
    .chip-input:checked + .chip-label {
        border-color: #d4af37;
        background: rgba(212,175,55,0.1);
        color: #b8912a;
        font-weight: 700;
    }
    .modal-qty-btn {
        width: 32px; height: 32px;
        border-radius: 10px;
        background: rgba(15,23,42,0.05);
        color: var(--text-main, #0f172a);
    }
    .dark-mode .modal-qty-btn { background: rgba(255,255,255,0.08); color: #e2e8f0; }
    .modal-qty-val { width: 46px; height: 32px; font-size: 14px; font-weight: 700; }
    .modal-submit-btn {
        width: 100%;
        padding: 13px;
        font-size: 0.92rem;
        font-weight: 800;
        border-radius: 14px;
        margin-top: 18px;
        background: #0f172a;
        color: #fff;
        box-shadow: 0 8px 20px rgba(15,23,42,0.22);
        transition: transform 0.2s ease;
    }
    .modal-submit-btn:active { transform: scale(0.97); }
    .modal-close-btn {
        width: 32px; height: 32px;
        border-radius: 50%;
        background: rgba(15,23,42,0.06);
        color: var(--text-main, #0f172a);
        font-size: 0.9rem;
    }
    .dark-mode .modal-close-btn { background: rgba(255,255,255,0.08); color: #e2e8f0; }

    /* ============ 10) التوست ============ */
    #toast {
        padding: 12px 22px;
        font-size: 13px;
        font-weight: 700;
        border-radius: 40px;
        background: #0f172a;
        color: #fff;
        border: 1px solid rgba(212,175,55,0.3);
        bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 10px 28px rgba(15,23,42,0.3);
    }

    /* ============ 11) الفوتر ============ */
    .custom-luxury-footer {
        padding: 36px 16px 0;
        background: linear-gradient(180deg, transparent, rgba(212,175,55,0.05));
    }
    .footer-promo-text { font-size: 0.82rem; line-height: 1.8; }
    .footer-links-grid { gap: 10px; }
    .info-link-item a {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 13px 15px;
        border-radius: 14px;
        background: var(--card-bg, #fff);
        border: 1px solid rgba(15,23,42,0.06);
        box-shadow: 0 2px 8px rgba(15,23,42,0.04);
    }
    .link-label { font-size: 0.78rem; font-weight: 700; color: var(--text-main, #0f172a); }
    .link-text { font-size: 0.72rem; color: var(--text-sub, #94a3b8); }
    .footer-logo-box img { width: 88px; height: auto; }
    .footer-bottom-bar { padding: 16px 10px; background: transparent; }
    .footer-bottom-bar p { font-size: 10.5px; color: #a8b3c2; }

    /* ============ 12) شاشة الانتظار ============ */
    .splash-logo { width: 74px; height: 74px; }
    .splash-brand-name { font-size: 1.15rem; font-weight: 800; }
    .splash-tagline { font-size: 0.85rem; color: #a8b3c2; }
    .splash-loading-text { font-size: 0.85rem; }
}

/* هواتف صغيرة جداً (<= 380px) */
@media (max-width: 380px) {
    html { font-size: 13.5px; }
    .hero-info-card h1 { font-size: 1.2rem; }
    .hero-info-card p  { font-size: 0.78rem; }
    .discount-card, .product-card-scroll { min-width: 146px; width: 146px; }
    .discount-image-wrapper img,
    .product-image-wrapper img { width: 146px !important; height: 146px !important; }
    .search-products-grid { gap: 10px; }
}

/* منع تجاوز عرض الشاشة */
@media (max-width: 768px) {
    img, .fluid-card, .discount-card, .product-card-scroll,
    .search-product-card, .modal-box { max-width: 100%; }
}