/* Start Menu */
/* Container for menu */
.menu-container {  
  position: fixed;
  left: 0;
}

.menu-category-mask-bg {
    position: fixed;
	width: 100vw;
	height: 100vh;    
    inset: 0;               
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.menu-category-mask-bg.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Level 1 UL */
.menu-category {
    width: 300px;
    direction: ltr;
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #ffffff;
    border: 1px solid #ededed;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative; /* Set as anchor for Level 2 */
    z-index: 1001;
}




.menu-category .menu-title {
    border-left: 3px solid transparent;
    width: 300px;
}

.menu-category .menu-title:hover {
    border-left: 3px solid var(--accent); 
    transition: border-color 0.3s ease; 
}
.menu-category .menu-title:hover > a {
    color: var(--accent); 
    
}


/* Level 1 LI */
.menu-category > .menu-title {
    position: static; /* Must be static so Level 2 aligns with the main UL */
    display: block;
    border-bottom: 1px solid #f5f5f5;
}

.menu-category > .menu-title:last-child {
    border-bottom: none;
}

/* Level 2 Submenu Container */
.menu-category > .menu-title > ul.menu-category {
    display: none; 
    position: absolute;
    top: -1px; 
    left: 100%; 
    width: max-content; 
    max-width: 600px; /* Max 2 columns */
    height: calc(100% + 2px); 
    z-index: 100;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.1);
    padding-bottom: 120px; 
    background-color: #ffffff; 
}

/* Use CSS Columns instead of flex on hover */
.menu-category > .menu-title:hover > ul.menu-category {
    display: block; /* Remove display: flex */
    column-width: 300px; /* Create 300px columns dynamically */
    column-gap: 0; /* No extra gap between columns */
    column-fill: auto; /* Fill columns vertically first */
}

/* تنظیمات پایه کانتینر منوی سطح 2 */
.menu-category > .menu-title > ul.menu-category {
    display: none; 
    position: absolute;
    top: -1px; 
    left: 100%; 
    height: calc(100% + 2px); 
    z-index: 100;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    /* این دو خط مهم هستند: */
    width: max-content; 
    padding: 0; 
}

.menu-category > .menu-title > ul.menu-category > .menu-title > a{
    padding: 11.5px 16px;
}

/* استفاده از Grid به جای Flex یا Columns در زمان هاور */
.menu-category > .menu-title:hover > ul.menu-category {
    display: grid;
    grid-auto-flow: column; 
    /* Use min-content for rows to prevent stretching */
    grid-template-rows: repeat(10, min-content); 
    grid-auto-columns: 300px; 
    /* This forces the grid rows to pack at the top */
    align-content: start; 
}


/* تنظیمات آیتم‌های داخل منو */
.menu-category > .menu-title > ul.menu-category > .menu-title {
    position: static;
    
    
}



/* Links appearance */
.menu-title > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: #4a4a4a;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* Hover effect on links */
.menu-title > a:hover {
    background-color: #fafafa;
    color: var(--accent); /* Used your primary site color */
}

/* Count badge */
.menu-count {
    background-color: blue;
    color: #f5f5f5;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* Icon style */
.menu-icon {
    color: #dbdbdb;
    font-size: 0.85rem;
}

.menu-title > a:hover .menu-icon {
    color: var(--accent); /* Used your primary site color */
}




/* 2. Styling and positioning for level 3 submenu */
.menu-category > .menu-title > ul.menu-category > .menu-title > ul.menu-category {
    display: none;
    position: absolute;
    /* Use right: 100% for RTL or left: 100% for LTR */
    
    top: -1px;
    width: 300px;
    height: 100%; 
    min-height: 40px;
    max-height: 500px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 1002;
    padding: 0px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #a3091f #f1f1f1;  

    padding: 0;
    box-sizing: border-box;
}

.menu-category > .menu-title > ul.menu-category > .menu-col-1 > ul.menu-category {
    left: 300px; 
}
.menu-category > .menu-title > ul.menu-category > .menu-col-2 > ul.menu-category {
    left: 599px; 
}

/* Chrome, Edge, Safari */
.menu-category > .menu-title > ul.menu-category > .menu-title > ul.menu-category::-webkit-scrollbar {
  width: 8px;
}

.menu-category > .menu-title > ul.menu-category > .menu-title > ul.menu-category::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.menu-category > .menu-title > ul.menu-category > .menu-title > ul.menu-category::-webkit-scrollbar-thumb {
  background: #a3091f;
  border-radius: 10px;
  transition: background 0.3s;
}

.menu-category > .menu-title > ul.menu-category > .menu-title > ul.menu-category::-webkit-scrollbar-thumb:hover {
  background: #7d0717;
}

/* 3. Show level 3 on hover of level 2 item */
.menu-category > .menu-title > ul.menu-category > .menu-title:hover > ul.menu-category {
    display: block !important;
    column-width: auto; 
}

.menu-category > .menu-title > ul.menu-category::after {
	content: "";
	position: absolute;
	bottom: 0;
	right: 0;
	width: 100%;
	height: 200px;
	background-repeat: no-repeat;
	background-position: bottom right;
	background-size: contain;
	opacity: 0.9;
	z-index: -1;
	pointer-events: none;
}

.menu-title > a .menu-text {
    flex: 1 1 auto;
    min-width: 0; /* برای اینکه ellipsis داخل flex کار کند */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* End Menu */

.main-home-page{
  padding-left: 280px;
}

#header_cart_count {
    padding-left:0.2rem;
}



/* desktop-h-menu Container */
.nav-links {
    font-size: 0.85rem;
    color: var(--accent);
}
.nav-links i {
    font-size: 0.85rem;
}
.desktop-h-menu{
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Custom Desktop Horizontal Menu */
.desktop-h-menu a {
    display: flex;
    align-items: center;
    gap: 8px; /* spacing between icon and text */
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
    font-weight: 500;
}

/* Icon specific styling */
.desktop-h-menu a span:first-child {
    color: var(--accent); /* Default icon color */
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

/* Hover state */
.desktop-h-menu a:hover {
    color: var(--brand);
}

.desktop-h-menu a:hover span:first-child {
    color: var(--brand); /* Optional: icon changes color on hover */
}

/* Active state */
.desktop-h-menu a.is-active {
    color: var(--brand);
    border-bottom: 1px solid var(--brand);
}

/* Phone ringing animation */
.contact-link i {
    animation: phone-ring 2s infinite;
    transform-origin: 50% 0%;
}

/* Keyframes */
@keyframes phone-ring {
    0% { transform: rotate(0deg); }
    5% { transform: rotate(-20deg); }
    10% { transform: rotate(20deg); }
    15% { transform: rotate(-15deg); }
    20% { transform: rotate(15deg); }
    25% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}


.header-cart-shopping {
    color: var(--accent) !important;
}

/* cart icon animation */
.header-cart-shopping i{
    animation: cart-shake 2.5s infinite;
}

/* keyframes */
@keyframes cart-shake {

    0%{
        transform: translateX(0);
    }

    10%{
        transform: translateX(-4px);
    }

    20%{
        transform: translateX(4px);
    }

    30%{
        transform: translateX(-3px);
    }

    40%{
        transform: translateX(3px);
    }

    50%{
        transform: translateX(0);
    }

    100%{
        transform: translateX(0);
    }

}

