/* ==========================================================================
   Home Styles (home.css) - نالش
   يحتوي على: البانر الرئيسي، القصص (Stories)، شبكة الاستكشاف (Bento & Discovery)، وتغذية المتاجر
   ========================================================================== */

/* ----------------------------------
   1. البانر الرئيسي (Page Header Banner)
------------------------------------- */
.page-header-banner { 
    background: var(--primary-gradient); 
    padding: 50px 20px; 
    text-align: center; 
    border-radius: 0 0 40px 40px; 
    margin-bottom: 25px; 
    position: relative; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.2); 
    margin-top: 0; 
}

.page-header-banner::after { 
    content: ''; 
    position: absolute; 
    top: -50%; 
    left: -50%; 
    width: 200%; 
    height: 200%; 
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); 
    pointer-events: none; 
}

.page-header-banner .banner-avatar { 
    width: 90px; 
    height: 90px; 
    background: white; 
    color: var(--primary); 
    border-radius: 25px; 
    margin: 0 auto 15px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 3rem; 
    font-weight: 900; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.2); 
    position: relative; 
    z-index: 2; 
}

.page-header-banner h2 { 
    color: white; 
    font-size: 2rem; 
    font-weight: 900; 
    position: relative; 
    z-index: 2; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.2); 
}

/* ----------------------------------
   2. قسم الهيرو والمنتجات المميزة (Hero Section)
------------------------------------- */
.hero-section { 
    padding: 25px 0 35px 0; 
    overflow: hidden; 
}

.hero-title { 
    font-size: 2.2rem; 
    font-weight: 900; 
    padding: 0 20px 20px 20px; 
    text-align: right; 
    background: var(--primary-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

/* ----------------------------------
   3. قصص المتاجر (Stories)
------------------------------------- */
.stories-container {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    background: var(--bg-body);
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}
.stories-container::-webkit-scrollbar { display: none; }

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.story-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

.story-item:hover .story-ring { transform: scale(1.05); }

.story-avatar {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border-radius: 50%;
    border: 3px solid var(--bg-body);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    overflow: hidden;
}

.story-name {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-main);
    max-width: 70px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----------------------------------
   4. شبكة البينتو للاستكشاف (Bento Grid)
------------------------------------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
    gap: 15px;
    padding: 0 20px 30px;
}
@media (min-width: 768px) {
    .bento-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 250px; }
}

.bento-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-card);
    border: none;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.bento-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.bento-card.large { grid-column: span 2; grid-row: span 2; }
.bento-card.tall { grid-row: span 2; }
.bento-card.wide { grid-column: span 2; }

.bento-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.6s ease;
}

.bento-card:hover .bento-img { transform: scale(1.08); }

.bento-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    z-index: 2;
}

.bento-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 15px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bento-store {
    font-size: 0.75rem;
    color: #fff;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    padding: 4px 10px;
    border-radius: 50px;
    width: fit-content;
    font-weight: 800;
}

.bento-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-card.large .bento-title { font-size: 1.5rem; }

.bento-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.bento-price { color: var(--accent); font-size: 1.2rem; font-weight: 900; }
.bento-btn {
    background: var(--primary);
    color: white;
    width: 35px; height: 35px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    border: none; cursor: pointer;
}

/* ----------------------------------
   5. شبكة الاستكشاف السريعة (Discovery Feed & Fast Cards)
------------------------------------- */
.discovery-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
    gap: 12px;
    padding: 15px 20px 100px;
}

@media (min-width: 768px) {
    .discovery-feed { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 16px; }
}

.fast-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    contain: content; 
    content-visibility: auto;
    contain-intrinsic-size: 150px;
    will-change: transform, opacity;
    border: none;
}
.fast-card:active { transform: scale(0.97); background: rgba(0,0,0,0.02); }

.card-standard { grid-column: span 1; grid-row: span 2; }
.card-wide { grid-column: span 2; grid-row: span 1; flex-direction: row; }
.card-wide .card-img-box { width: 40%; height: 100%; border-radius: 0; }
.card-wide .card-info { width: 60%; justify-content: center; }
.card-store-highlight { grid-column: span 2; grid-row: span 1; background: var(--text-main); color: var(--bg-body); display: flex; align-items: center; padding: 15px; gap: 15px; }

.card-img-box { width: 100%; height: 60%; position: relative; background: transparent; }
.card-img-box img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease; }
.card-img-box img.loaded { opacity: 1; }

.card-info { padding: 10px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-title { font-size: 0.95rem; font-weight: 900; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { font-size: 1.15rem; font-weight: 900; color: var(--primary); }

/* ----------------------------------
   6. قسم تغذية المتاجر في الرئيسية (Merchant Feed Section)
------------------------------------- */
.category-section { padding: 25px 0; }
.section-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 20px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }

.merchant-feed-section { padding: 25px 0; border-bottom: 8px solid var(--border); }
.merchant-feed-header { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; margin-bottom: 15px; }

@media (min-width: 768px) {
    .merchant-feed-header { padding: 0 40px; }
}

.merchant-feed-header .m-info { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.merchant-feed-header .m-avatar { 
    width: 45px; height: 45px; border-radius: 14px; 
    background: var(--primary-gradient); color: white; 
    display: flex; justify-content: center; align-items: center; 
    font-weight: 900; font-size: 1.2rem; box-shadow: var(--shadow-sm); 
}
.merchant-feed-header h3 { font-size: 1.4rem; font-weight: 900; margin: 0; color: var(--text-main); }
.merchant-feed-header p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.merchant-feed-header .m-visit-btn { 
    background: rgba(79, 70, 229, 0.1); color: var(--primary); 
    padding: 6px 15px; border-radius: 50px; font-weight: 800; 
    font-size: 0.85rem; border: none; cursor: pointer; transition: 0.3s; 
}
.merchant-feed-header .m-visit-btn:hover { background: var(--primary); color: white; }

/* ----------------------------------
   7. أدوات التمرير العرضية (Horizontal Scrolling & Loader)
------------------------------------- */
.horizontal-scroller {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 5px 20px 20px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}
@media (min-width: 768px) {
    .horizontal-scroller { padding: 5px 40px 20px; }
}

.loading-more-horizontal {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.02);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border);
    color: var(--primary);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}
.loading-more-horizontal:hover { background-color: rgba(79, 70, 229, 0.1); }
.loading-more-horizontal .spinner-icon { font-size: 2rem; animation: spin 1s linear infinite; }
/* =========================================================
   1. تحويل الموقع لمتجر واحد (إخفاء بيانات المتاجر المتعددة)
   ========================================================= */
.compact-merchant,            /* اسم التاجر في كرت المنتج */
.list-item-merchant,          /* اسم التاجر في القائمة الطولية */
.pd-merchant-chip,            /* شريحة التاجر في تفاصيل المنتج */
.hero-merchant,               /* اسم التاجر في الكرت الكبير */
.merchant-modern-chip,        /* اسم التاجر في السلة */
.stories-container,           /* قصص المتاجر في الرئيسية */
.merchant-feed-section,       /* تغذية المتاجر */
.bento-store,                 /* التاجر في كروت البينتو */
.iso-brand,                   /* هيدر التاجر المستقل */
.store-group-title {
    display: none !important;
}

/* =========================================================
   2. تصميم عناوين الأقسام (الفئات) في الصفحة الرئيسية
   ========================================================= */
.category-row-wrapper {
    margin-bottom: 15px; /* المسافة بين كل قسم وقسم */
}

.category-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin: 25px 0 15px 0;
}

.category-row-header h3 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* خط ملون جمالي بجانب اسم القسم */
.category-row-header h3::before {
    content: '';
    width: 6px;
    height: 22px;
    background: var(--primary-gradient);
    border-radius: 10px;
}

/* زر عرض الكل بجانب الفئة */
.category-row-header .view-all {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
    background: rgba(79, 70, 229, 0.1);
    padding: 6px 15px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.category-row-header .view-all:hover {
    background: var(--primary);
    color: white;
}