/* =========================================================
   NAVBAR
========================================================= */

.navbar {
    position: relative;
    z-index: 10000;

    width: 100%;
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 5%;

    box-sizing: border-box;
}


/* =========================================================
   LOGO
========================================================= */

.logo {
    position: relative;
    z-index: 10001;
    flex-shrink: 0;
}

.logo a {
    position: relative;

    display: flex;
    align-items: center;

    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
}

.logo-icon img {
    display: block;
}

.logo-text {
    display: flex;
    align-items: center;
    margin-right: 15px;
}
.logo-text img {
    display: block;
}


/* =========================================================
   NAV LINKS
========================================================= */

.nav-links {
    display: flex;
    align-items: center;

    gap: 30px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.nav-links > li {
    position: relative;

    list-style: none;
}

.nav-links > li > a {
    display: inline-flex;
    align-items: center;

    color: #e5e7eb;

    text-decoration: none;

    font-family: inherit;
    font-size: 15px;
    font-weight: 500;

    white-space: nowrap;

    transition:
        color .2s ease,
        transform .2s ease;
}

.nav-links > li > a:hover {
    color: #60a5fa;
}


/* =========================================================
   PRODUCTS
========================================================= */

.products-nav-item {
    position: static !important;
    overflow: visible !important;
}

.products-details {
    position: static !important;

    width: auto;

    margin: 0;
    padding: 0;

    overflow: visible !important;
}


/* =========================================================
   SUMMARY
========================================================= */

.products-details > summary {
    list-style: none;
}

.products-details > summary::marker {
    display: none;
}

.products-details > summary::-webkit-details-marker {
    display: none;
}


/* =========================================================
   PRODUCTS BUTTON
========================================================= */

.products-nav-btn {
    display: flex !important;

    align-items: center;
    justify-content: center;

    gap: 7px;

    width: auto;

    margin: 0 !important;
    padding: 0 !important;

    border: none !important;
    outline: none !important;

    background: transparent !important;

    color: #e5e7eb;

    font-family: inherit;
    font-size: 15px;
    font-weight: 500;

    cursor: pointer;

    white-space: nowrap;

    user-select: none;
}

.products-nav-btn:hover {
    color: #60a5fa;
}


/* =========================================================
   ARROW
========================================================= */

.products-arrow {
    display: inline-block;

    font-size: 13px;
    line-height: 1;

    transition: transform .2s ease;
}

.products-details[open] .products-arrow {
    transform: rotate(180deg);
}


/* =========================================================
   DESKTOP DROPDOWN
   این قسمت عمداً همان ظاهر فعلی دسکتاپ است.
========================================================= */

@media (min-width: 901px) {

    .products-dropdown {
        position: fixed !important;

        top: 92px !important;
        right: 7vw !important;
        left: auto !important;

        width: max-content !important;
        min-width: 220px !important;
        max-width: 520px !important;

        height: auto !important;
        max-height: calc(100vh - 110px) !important;

        margin: 0 !important;
        padding: 20px !important;

        box-sizing: border-box;

        background: #0f172a !important;

        border: none !important;
        border-radius: 14px !important;

        box-shadow:
            0 20px 50px
            rgba(0, 0, 0, .35);

        z-index: 999999 !important;

        direction: rtl;

        overflow-y: auto;
        overflow-x: hidden;

        display: flex;
        flex-direction: column;
    }

    .products-dropdown-link {
        display: flex !important;
        align-items: center;

        width: 100% !important;

        margin: 0 0 6px 0 !important;
        padding: 12px 18px !important;

        box-sizing: border-box;

        color: #e5e7eb !important;
        text-decoration: none !important;

        white-space: nowrap;

        border-radius: 10px;

        transition:
            background-color .15s ease,
            color .15s ease,
            transform .15s ease;
    }
}

    .products-dropdown-link:hover {

        background:
            rgba(59, 130, 246, .12) !important;

        color: #60a5fa !important;

        transform:
            translateX(-3px);
    }


    
    

    body.light-mode .products-dropdown {

        background: #ffffff !important;

        border-top-color:
            rgba(15, 23, 42, .08);

        box-shadow:
            0 20px 50px
            rgba(15, 23, 42, .12);
    }

    body.light-mode .products-dropdown-link {
        color: #0f172a !important;
    }

    body.light-mode .products-dropdown-link:hover {

        background:
            rgba(59, 130, 246, .08) !important;

        color: #2563eb !important;
    }
}


/* =========================================================
   NAV ACTIONS
========================================================= */

.nav-actions {

    display: flex;

    align-items: center;

    gap: 10px;

    position: relative;

    z-index: 10001;
}


/* =========================================================
   THEME BUTTON
========================================================= */

.theme-btn {

    width: 50px;
    height: 50px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 15px;

    border:
        1px solid
        rgba(96, 165, 250, .25);

    background:
        rgba(255, 255, 255, .07);

    color: white;

    font-size: 21px;

    cursor: pointer;

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.theme-btn:hover {

    transform:
        translateY(-2px);

    background:
        rgba(59, 130, 246, .20);

    border-color:
        rgba(96, 165, 250, .5);
}

.theme-btn:active {

    transform:
        scale(.95);
}


/* =========================================================
   CART BUTTON
========================================================= */

.cart-btn {

    position: relative;

    width: 50px;
    height: 50px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 15px;

    border:
        1px solid
        rgba(96, 165, 250, .25);

    background:
        rgba(255, 255, 255, .07);

    color: white;

    font-size: 20px;

    cursor: pointer;

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.cart-btn:hover {

    transform:
        translateY(-2px);

    background:
        rgba(59, 130, 246, .20);

    border-color:
        rgba(96, 165, 250, .5);
}


/* =========================================================
   CART COUNT
========================================================= */

.cart-count {

    position: absolute;

    top: -5px;
    right: -5px;

    min-width: 19px;
    height: 19px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0 4px;

    box-sizing: border-box;

    border-radius: 50%;

    background: #2563eb;

    color: white;

    font-size: 11px;

    font-weight: 700;
}


/* =========================================================
   MOBILE MENU BUTTON
========================================================= */

.menu-btn {

    display: none;

    width: 50px;
    height: 50px;

    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 15px;

    border:
        1px solid
        rgba(96, 165, 250, .25);

    background:
        rgba(255, 255, 255, .07);

    color: white;

    font-size: 24px;

    cursor: pointer;
}


/* =========================================================
   MINI CART
========================================================= */
/* =========================================================
   MINI CART
========================================================= */

.mini-cart {
    position: fixed;

    top: 0;
    right: 0;

    width: 380px;
    max-width: calc(100vw - 30px);
    max-height: 600px;

    box-sizing: border-box;
    padding: 25px;

    overflow-y: auto;
    overflow-x: hidden;

    border-radius: 25px;

    background: rgba(17, 24, 39, .97);

    border: 1px solid rgba(255, 255, 255, .10);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, .28);

    z-index: 999999;

    transform: translateY(-10px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        transform .25s ease,
        opacity .2s ease,
        visibility 0s linear .25s;
}

.mini-cart.show {
    transform: translateY(0);

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition:
        transform .25s ease,
        opacity .2s ease,
        visibility 0s linear 0s;
}

.mini-cart-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 20px;
}

.mini-cart-header h4 {

    color: white;

    margin: 0;

    font-size: 20px;
}


#closeCart {

    width: 40px;
    height: 40px;

    border: none;

    background: transparent;

    color: white;

    font-size: 28px;

    cursor: pointer;

    border-radius: 12px;

    transition:
        background-color .15s ease,
        transform .15s ease;
}

#closeCart:hover {

    background:
        rgba(255, 255, 255, .07);

    transform:
        rotate(45deg);
}

#closeCart:active {

    transform:
        scale(.94);
}


.mini-cart-items {
    width: 100%;
}

.cart-product {

    display: flex;

    align-items: center;

    gap: 15px;

    margin-bottom: 18px;

    padding: 12px;

    border-radius: 16px;

    background:
        rgba(255, 255, 255, .035);

    border:
        1px solid
        rgba(255, 255, 255, .05);

    min-width: 0;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}

.cart-product:hover {

    background:
        rgba(59, 130, 246, .07);

    border-color:
        rgba(96, 165, 250, .16);
}


.cart-product img {

    width: 70px;
    height: 70px;

    flex-shrink: 0;

    border-radius: 15px;

    object-fit: cover;
}

.cart-product > div {

    min-width: 0;

    flex: 1;
}

.cart-product h5 {

    color: white;

    margin: 0 0 7px;

    font-size: 14px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.cart-product span {

    min-width: 30px;

    text-align: center;

    font-weight: bold;

    color: #ededed;
}

.cart-product > div:last-child {

    display: flex;

    align-items: center;

    gap: 8px;

    flex-shrink: 0;
}


.qty-minus,
.qty-plus {

    width: 32px;
    height: 32px;

    border: none;

    background: #0f172a;

    color: white;

    font-size: 20px;

    font-weight: bold;

    border-radius: 8px;

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    transition:
        background-color .15s ease,
        transform .12s ease;
}

.qty-minus:hover,
.qty-plus:hover {

    background: #1e3a8a;

    transform:
        scale(1.04);
}

.qty-minus:active,
.qty-plus:active {

    transform:
        scale(.94);
}


.mini-cart-footer {
    margin-top: 15px;
}

.mini-cart-footer h5 {

    color: white;

    margin-bottom: 15px;
}

.cart-page-btn {

    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;

    box-sizing: border-box;

    padding: 13px;

    border-radius: 12px;

    background: #2563eb;

    color: white;

    text-decoration: none;
}


/* =========================================================
   MOBILE NAVBAR
========================================================= */

@media (max-width: 900px) {

    .navbar {

        width: 94% !important;

        min-height: 70px !important;

        padding: 0 18px !important;
    }


    
    

    .navbar .nav-actions {

        display: flex !important;

        align-items: center !important;

        justify-content: flex-end !important;

        flex-direction: row !important;

        flex-wrap: nowrap !important;

        gap: 8px !important;

        flex-shrink: 0 !important;
    }


    
    

    .navbar .menu-btn {

        display: flex !important;

        align-items: center !important;

        justify-content: center !important;

        width: 45px !important;
        height: 45px !important;

        min-width: 45px !important;
        min-height: 45px !important;

        padding: 0 !important;
        margin: 0 !important;

        border:
            1px solid
            rgba(96, 165, 250, .25) !important;

        border-radius: 13px !important;

        background:
            rgba(255, 255, 255, .07) !important;

        color: white !important;

        font-size: 24px !important;

        line-height: 1 !important;

        cursor: pointer;

        position: relative !important;

        z-index: 100001 !important;
    }


    .navbar .menu-btn:hover {

        background:
            rgba(59, 130, 246, .20) !important;

        border-color:
            rgba(96, 165, 250, .5) !important;
    }


    /* =====================================================
       MOBILE NAV LINKS CLOSED
    ===================================================== */

    .navbar .nav-links {

        position: absolute !important;

        top: calc(100% + 10px) !important;

        left: 0 !important;
        right: 0 !important;

        width: 100% !important;

        height: auto !important;

        display: flex !important;

        flex-direction: column !important;

        align-items: stretch !important;

        margin: 0 !important;

        padding: 10px !important;

        gap: 4px !important;

        opacity: 0 !important;

        visibility: hidden !important;

        pointer-events: none !important;

        transform:
            translateY(-10px) !important;

        overflow: visible !important;

        z-index: 100000 !important;

        transition:
            opacity .2s ease,
            transform .2s ease,
            visibility .2s ease;
    }


    
    

    .navbar .nav-links.active {

        opacity: 1 !important;

        visibility: visible !important;

        pointer-events: auto !important;

        transform:
            translateY(0) !important;
    }


    
    

    .navbar .nav-links > li {

        width: 100% !important;

        height: auto !important;

        display: block !important;

        margin: 0 !important;

        padding: 0 !important;
    }


    
    

    .navbar .nav-links > li > a {

        width: 100% !important;

        height: 44px !important;

        display: flex !important;

        align-items: center !important;

        justify-content: center !important;

        margin: 0 !important;

        padding: 0 12px !important;

        box-sizing: border-box !important;
    }


    /* =====================================================
       PRODUCTS MOBILE
    ===================================================== */

    .navbar .products-nav-item {

        width: 100% !important;

        height: auto !important;

        position: relative !important;
    }


    .navbar .products-details {

        width: 100% !important;

        margin: 0 !important;

        padding: 0 !important;
    }


    .navbar .products-nav-btn {

        width: 100% !important;

        height: 44px !important;

        display: flex !important;

        align-items: center !important;

        justify-content: center !important;

        gap: 7px !important;

        margin: 0 !important;

        padding: 0 12px !important;

        box-sizing: border-box !important;
    }


    /*
       خیلی مهم:
       در موبایل Dropdown بسته = display:none
    */

    .navbar .products-dropdown {

        position: static !important;

        width: 100% !important;

        height: auto !important;

        max-height: none !important;

        display: none !important;

        flex-direction: column !important;

        gap: 0 !important;

        margin: 0 !important;

        padding: 5px !important;

        box-sizing: border-box !important;

        overflow: hidden !important;

        background: transparent !important;

        border: none !important;

        box-shadow: none !important;

        z-index: auto !important;
    }


    /*
       فقط وقتی Products باز است
    */

    .navbar .products-details[open] > .products-dropdown {

        display: flex !important;
    }


    .navbar .products-dropdown-link {

        width: 100% !important;

        height: 40px !important;

        min-height: 40px !important;

        display: flex !important;

        align-items: center !important;

        justify-content: center !important;

        margin: 0 !important;

        padding: 0 12px !important;

        box-sizing: border-box !important;

        color: #e5e7eb !important;

        text-decoration: none !important;

        font-size: 14px !important;

        border-radius: 8px !important;

        white-space: nowrap !important;
    }


    .navbar .products-dropdown-link:hover {

        background:
            rgba(59, 130, 246, .12) !important;

        color: #60a5fa !important;
    }


    
    

    body.light-mode .navbar .products-dropdown {

        background: transparent !important;
    }

    body.light-mode .navbar .products-dropdown-link {

        color: #0f172a !important;
    }

    body.light-mode .navbar .products-dropdown-link:hover {

        background:
            rgba(59, 130, 246, .08) !important;

        color: #2563eb !important;
    }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .navbar {

        width: calc(100% - 20px) !important;

        padding: 0 10px !important;
    }


    .navbar .nav-actions {

        gap: 5px !important;
    }


    .navbar .menu-btn {

        width: 42px !important;
        height: 42px !important;

        min-width: 42px !important;
        min-height: 42px !important;

        font-size: 22px !important;
    }


    .navbar .theme-btn,
    .navbar .cart-btn {

        width: 42px !important;
        height: 42px !important;
    }


    .logo-text {
        left: 8px !important;
    }
}
/* =========================================================
   FIX NAVBAR STICKING TO LEFT EDGE
========================================================= */

.navbar {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;

    padding-left: 5% !important;
    padding-right: 5% !important;

    box-sizing: border-box !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}
@media (max-width: 900px) {

    .navbar {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .navbar .nav-links {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;

        padding-left: 12px !important;
        padding-right: 12px !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .navbar .nav-links li {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .navbar .nav-links li > a,
    .navbar .nav-links .products-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .navbar .nav-actions {
        flex-shrink: 0 !important;
        max-width: 100% !important;
    }
}
@media (max-width: 900px) {

    .navbar {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 12px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    
    
    .navbar .logo {
        flex: 0 1 auto !important;
        min-width: 0 !important;
    }

    .navbar .logo img {
        max-width: 100% !important;
    }

    
    
    .navbar .nav-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;

        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        margin-right: 0 !important;

        gap: 6px !important;
    }

    .navbar .nav-actions button {
        flex: 0 0 auto !important;
        width: 40px !important;
        height: 40px !important;

        margin: 0 !important;
        padding: 0 !important;

        box-sizing: border-box !important;
    }

    
    
    .navbar .menu-btn {
        position: relative !important;
        right: auto !important;
        left: auto !important;

        margin-right: 0 !important;
        margin-left: 0 !important;

        flex-shrink: 0 !important;
    }

    
    
    .navbar .nav-links {
        left: 0 !important;
        right: 0 !important;

        width: 100% !important;
        max-width: 100% !important;

        box-sizing: border-box !important;

        padding-left: 12px !important;
        padding-right: 12px !important;

        overflow-x: hidden !important;
    }
}
.dropdown-menu {
    height: auto;
    max-height: none;
}
@media (min-width: 901px) {

    .products-nav-item {
        position: relative !important;
    }

    .products-details {
        position: relative !important;
    }

    .products-dropdown {
        position: absolute !important;

        top: calc(100% + 15px) !important;
        right: 0 !important;
        left: auto !important;

        width: max-content !important;
        min-width: 220px !important;
        max-width: 520px !important;

        height: auto !important;
        max-height: calc(100vh - 110px) !important;

        margin: 0 !important;
        padding: 20px !important;

        box-sizing: border-box;

        background: #0f172a !important;

        border: none !important;
        border-radius: 14px !important;

        box-shadow:
            0 20px 50px
            rgba(0, 0, 0, .35);

        z-index: 999999 !important;

        direction: rtl;

        overflow-y: auto;
        overflow-x: hidden;

        display: flex;
        flex-direction: column;
    }

    .products-dropdown-link {
        display: flex !important;
        align-items: center;

        width: 100% !important;

        margin: 0 0 6px 0 !important;
        padding: 12px 18px !important;

        box-sizing: border-box;

        color: #e5e7eb !important;
        text-decoration: none !important;

        white-space: nowrap;

        border-radius: 10px;

        transition:
            background-color .15s ease,
            color .15s ease,
            transform .15s ease;
    }
}


body.light-mode .products-nav-btn {
    color: #111827 !important;
}

body.light-mode .products-nav-btn .products-arrow {
    color: #111827 !important;
}
