/* 
Component: Ringo Modern Header
Description: Redesigned with modern UI/UX trends (soft shadows, rounded elements, animated hovers).
*/

.ringo-desktop-header { 
    display: block; 
    position: sticky; /* چسبیدن هدر به بالا با اسکرول */
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.ringo-mobile-header { display: none; }

/* متغیرهای رنگی مدرن‌تر و زنده‌تر */
:root {
    --modern-navy: #0f172a; /* سرمه‌ای بسیار شیک و عمیق */
    --modern-orange: #f97316; /* نارنجی زنده و دیجیتال */
    --surface-light: #f8fafc;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; width: 100%; box-sizing: border-box; }

/* آیکون فلش برای منوهای دسکتاپ که زیرمنو دارند */
.main-nav .nav-list > li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 6px; /* فاصله بین متن و آیکون */
}

.main-nav .nav-list > li.menu-item-has-children > a::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23e2e8f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* تغییر رنگ فلش و چرخش ملایم هنگام Hover در دسکتاپ */
.main-nav .nav-list > li.menu-item-has-children:hover > a::before {
    transform: rotate(180deg);
    filter: invert(54%) sepia(87%) saturate(2250%) hue-rotate(346deg) brightness(101%) contrast(97%); /* تغییر رنگ به نارنجی */
}

/* --- Top Bar: مدرن، مینیمال و شیشه‌ای --- */
.header-top { 
    background-color: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px); /* افکت شیشه‌ای مدرن */
    padding: 12px 0; 
    border-bottom: 1px solid rgba(0,0,0,0.03); 
}
.top-bar-wrapper { display: flex; justify-content: space-between; align-items: center; }
.logo img { max-height: 45px; transition: transform 0.3s ease; }
.logo a:hover img { transform: scale(1.05); }

.header-actions { display: flex; align-items: center; gap: 1.5rem; }
.wallet-box { 
    display: flex; gap: 8px; font-weight: 700; font-size: 14px; 
    background: var(--surface-light); padding: 8px 16px; 
    border-radius: 50px; color: var(--modern-navy);
    border: 1px solid #e2e8f0;
}

/* دکمه‌های کپسولی (Pill-shape) مدرن */
.btn { 
    padding: 10px 28px; 
    border-radius: 50px; /* طراحی کپسولی */
    text-decoration: none; 
    font-weight: 600; 
    font-size: 14px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}
.btn-navy { background-color: var(--modern-navy); color: #fff; box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15); }
.btn-navy:hover { background-color: #1e293b; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(15, 23, 42, 0.25); }
.btn-orange { background-color: var(--modern-orange); color: #fff; box-shadow: 0 4px 10px rgba(249, 115, 22, 0.2); }
.btn-orange:hover { background-color: #ea580c; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(249, 115, 22, 0.3); }

/* --- Bottom Bar: یکپارچه و جذاب --- */
.header-bottom { background-color: var(--modern-navy); }
.bottom-bar-wrapper { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.main-nav .nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; }

/* افکت Hover لاین زیر منوها */
.main-nav .nav-list > li > a { 
    color: #e2e8f0; text-decoration: none; font-size: 14px; 
    font-weight: 500; padding: 22px 0; display: block; 
    position: relative; transition: color 0.3s; 
}
.main-nav .nav-list > li > a::after {
    content: ''; position: absolute; bottom: 15px; left: 50%;
    width: 0; height: 3px; background: var(--modern-orange);
    transition: all 0.3s ease; border-radius: 4px;
    transform: translateX(-50%);
}
.main-nav .nav-list > li:hover > a { color: #fff; }
.main-nav .nav-list > li:hover > a::after { width: 100%; }

/* زیرمنوی دسکتاپ: طراحی Card مدرن */
.main-nav .nav-list li.menu-item-has-children { position: relative; }
.main-nav .nav-list .sub-menu { 
    display: block; position: absolute; top: 120%; right: 0; 
    background: #fff; min-width: 240px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
    z-index: 100; padding: 10px; margin: 0; list-style: none; 
    border-radius: 12px; opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: all 0.3s ease; 
}
.main-nav .nav-list li:hover .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); top: 100%; }
.main-nav .nav-list .sub-menu li a { 
    padding: 12px 16px; color: #475569; border-radius: 8px;
    display: block; text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.2s; 
}
.main-nav .nav-list .sub-menu li:hover > a { color: var(--modern-orange); background: var(--surface-light); padding-right: 22px; }

/* دکمه‌های آیکون‌دار حساب و سبد خرید (هاور جذاب) */
.user-actions { display: flex; gap: 1rem; align-items: center; }
.account-link, .cart-link { 
    color: #fff; text-decoration: none; display: flex; align-items: center; 
    gap: 8px; font-size: 14px; font-weight: 500;
    padding: 8px 16px; border-radius: 50px; background: rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}
.account-link:hover, .cart-link:hover { 
    background: var(--modern-orange); color: #fff; 
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* --- استایل‌های موبایل: تم اپلیکیشنی --- */
@media (max-width: 991px) {
    .ringo-desktop-header { display: none; }
    .ringo-mobile-header { display: block; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
    
    /* تغییر فقط در خط زیر انجام شد: پدینگ چپ و راست 0 شد تا با container تداخل نکند */
    .header-mobile-inner { background-color: var(--modern-navy); padding: 15px 0; }
    .mobile-top-bar { display: flex; justify-content: space-between; align-items: center; }
    
    .hamburger-btn, .cart-link-mobile { 
        background: rgba(255,255,255,0.1); border: none; color: #fff; 
        cursor: pointer; padding: 8px; border-radius: 8px; 
        display: flex; align-items: center; transition: 0.3s;
    }
    .hamburger-btn:hover, .cart-link-mobile:hover { background: var(--modern-orange); }
    
    .logo-mobile h2, .logo-mobile a { color: #fff; text-decoration: none; margin: 0; font-size: 22px; font-weight: 800; }
    .logo-mobile img { max-height: 40px; filter: brightness(0) invert(1); }
    
    .mobile-overlay { position: fixed; top: 0; right: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 998; opacity: 0; visibility: hidden; transition: 0.4s ease; }
    .mobile-overlay.active { opacity: 1; visibility: visible; }
    
    /* منوی کشویی مدرن با گوشه‌های گرد شده */
    .mobile-offcanvas { position: fixed; top: 0; right: -340px; width: 320px; max-width: 85vw; height: 100vh; background: #fff; z-index: 999; transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; border-radius: 20px 0 0 20px; box-shadow: -10px 0 30px rgba(0,0,0,0.1); }
    .mobile-offcanvas.active { right: 0; }
    
    .offcanvas-header { display: flex; justify-content: space-between; align-items: center; padding: 25px 20px; background: #fff; border-bottom: 1px solid #f1f5f9; border-radius: 20px 0 0 0; }
    .offcanvas-title { font-weight: 800; color: var(--modern-navy); font-size: 18px; }
    .close-menu-btn { background: #f1f5f9; border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; color: #64748b; transition: 0.3s; }
    .close-menu-btn:hover { background: #e2e8f0; color: #0f172a; }
    
    .offcanvas-body { position: relative; flex-grow: 1; overflow-x: hidden; overflow-y: auto; background: #fff; padding: 10px 0; }
    .drilldown-menu { list-style: none; padding: 0; margin: 0; width: 100%; }
    .drilldown-menu li { margin: 4px 15px; }
    .drilldown-menu li a { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; color: #334155; text-decoration: none; font-size: 14px; font-weight: 600; border-radius: 12px; transition: 0.2s; }
    .drilldown-menu li > a:hover { background: var(--surface-light); color: var(--modern-orange); }
    .drilldown-menu li.menu-item-has-children > a::after { content: "❮"; font-size: 12px; color: #94a3b8; }
    
    .drilldown-menu .sub-menu { list-style: none; padding: 0; margin: 0; position: absolute; top: 0; right: 0; width: 100%; min-height: 100%; background: #fff; transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); z-index: 10; visibility: hidden; }
    .drilldown-menu .sub-menu.is-active { transform: translateX(0); visibility: visible; }
    
    .drilldown-back-btn { background: var(--surface-light); color: var(--modern-orange); font-weight: 700; padding: 16px 20px; border-radius: 12px; margin: 10px 15px 20px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 10px; }
    .drilldown-back-btn::before { content: "❯"; font-size: 14px; }
}