
/* =========================================================
   AL ASIF TRADERS
   MASTER HEADER CSS
   Premium Fixed / Frozen Header
   ========================================================= */


/* =========================================================
   ROOT VARIABLES
   ========================================================= */

:root {

    /* Header Heights */

    --topbar-height: 44px;

    --middlebar-height: 82px;

    --bottombar-height: 50px;

    --total-header-height:
        calc(
            var(--topbar-height) +
            var(--middlebar-height) +
            var(--bottombar-height)
        );


    /* Main Colors */

    --primary: #16a34a;

    --primary-dark: #15803d;

    --primary-light: #dcfce7;

    --primary-soft: #f0fdf4;


    /* Basic Colors */

    --white: #ffffff;

    --black: #111827;

    --text: #374151;

    --text-light: #6b7280;

    --muted: #9ca3af;

    --border: #e5e7eb;

    --border-light: #eef1f4;

    --background: #fafafa;

    --hover: #f3f4f6;


    /* Shadows */

    --shadow-sm:
        0 2px 10px rgba(0, 0, 0, .05);

    --shadow-md:
        0 8px 25px rgba(0, 0, 0, .08);

    --shadow-lg:
        0 15px 40px rgba(0, 0, 0, .12);


    /* Radius */

    --radius-sm: 8px;

    --radius: 12px;

    --radius-lg: 16px;

    --radius-pill: 50px;


    /* Transition */

    --transition:
        .30s ease;


    /* Container */

    --container: 1380px;

}


/* =========================================================
   GLOBAL RESET
   ========================================================= */

*,
*::before,
*::after {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}


/* =========================================================
   HTML
   ========================================================= */

html {

    scroll-behavior: smooth;

}


/* =========================================================
   BODY
   ========================================================= */

body {

    font-family:
        "Poppins",
        sans-serif;

    background:
        var(--background);

    color:
        var(--text);

    overflow-x: hidden;

    /*
     * Space reserved for fixed desktop header.
     */

    padding-top:
        var(--total-header-height);

}


/* =========================================================
   IMAGES
   ========================================================= */

img {

    max-width: 100%;

    height: auto;

    display: block;

}


/* =========================================================
   LINKS
   ========================================================= */

a {

    text-decoration: none;

    color: inherit;

    transition:
        var(--transition);

}


/* =========================================================
   LISTS
   ========================================================= */

ul,
ol {

    list-style: none;

    margin: 0;

    padding: 0;

}


/* =========================================================
   BUTTON RESET
   ========================================================= */

button {

    font-family: inherit;

}


/* =========================================================
   CONTAINER
   ========================================================= */

.container-xl {

    width: 100%;

    max-width:
        var(--container);

    margin-left: auto;

    margin-right: auto;

    padding-left: 20px;

    padding-right: 20px;

}


/* =========================================================
   MAIN FIXED HEADER
   ========================================================= */

.site-header {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height:
        var(--total-header-height);

    z-index: 9999;

    background:
        var(--white);

    box-shadow:
        0 4px 25px rgba(0, 0, 0, .08);

    transition:
        box-shadow .30s ease,
        transform .30s ease;

}


/* =========================================================
   SCROLLED HEADER
   ========================================================= */

.site-header.scrolled {

    box-shadow:
        var(--shadow-md);

}


/* =========================================================
   HEADER BAR COMMON RULES
   ========================================================= */

.site-header .top-bar,
.site-header .middle-bar,
.site-header .bottom-bar,
.site-header .category-navbar {

    width: 100%;

}


/* =========================================================
   TOP BAR HEIGHT
   ========================================================= */

.site-header .top-bar {

    height:
        var(--topbar-height);

    min-height:
        var(--topbar-height);

}


/* =========================================================
   MIDDLE BAR HEIGHT
   ========================================================= */

.site-header .middle-bar {

    height:
        var(--middlebar-height);

    min-height:
        var(--middlebar-height);

}


/* =========================================================
   BOTTOM BAR HEIGHT
   ========================================================= */

.site-header .bottom-bar,
.site-header .category-navbar {

    height:
        var(--bottombar-height);

    min-height:
        var(--bottombar-height);

}


/* =========================================================
   HEADER INTERNAL CONTAINERS
   ========================================================= */

.site-header .top-bar > .container-xl,
.site-header .middle-bar > .container-xl,
.site-header .bottom-bar > .container-xl {

    height: 100%;

}


/* =========================================================
   PREVENT CONTENT FROM GOING UNDER HEADER
   ========================================================= */

main,
.page-content {

    position: relative;

}


/* =========================================================
   GLOBAL HEADER FOCUS
   ========================================================= */

.site-header a:focus-visible,
.site-header button:focus-visible,
.site-header input:focus-visible {

    outline:
        3px solid
        rgba(22, 163, 74, .25);

    outline-offset: 2px;

}


/* =========================================================
   SEARCH / FORM COMMON
   ========================================================= */

.site-header input,
.site-header button {

    font-family:
        inherit;

}


/* =========================================================
   DISABLED ELEMENT
   ========================================================= */

.site-header .disabled,
.site-header button:disabled {

    opacity: .45;

    cursor: not-allowed;

}


/* =========================================================
   CART BADGE COMMON
   ========================================================= */

.site-header .cart-count,
.site-header .action-badge {

    position: absolute;

    top: -5px;

    right: -5px;

    min-width: 21px;

    height: 21px;

    padding:
        0 5px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        #ef4444;

    color:
        #ffffff;

    border:
        2px solid #ffffff;

    font-size: 10px;

    font-weight: 700;

    line-height: 1;

    z-index: 5;

}


/* =========================================================
   MOBILE SIDEBAR
   ========================================================= */

.mobile-sidebar {

    position: fixed;

    top: 0;

    left: -100%;

    width: min(320px, 88vw);

    height: 100vh;

    background:
        #ffffff;

    overflow-y: auto;

    overflow-x: hidden;

    z-index: 100001;

    box-shadow:
        10px 0 40px rgba(0, 0, 0, .18);

    transition:
        left .35s ease;

    -webkit-overflow-scrolling:
        touch;

}


/* =========================================================
   MOBILE SIDEBAR OPEN
   ========================================================= */

.mobile-sidebar.active {

    left: 0;

}


/* =========================================================
   MOBILE OVERLAY
   ========================================================= */

.mobile-overlay {

    position: fixed;

    inset: 0;

    width: 100%;

    height: 100%;

    background:
        rgba(0, 0, 0, .50);

    z-index: 100000;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .30s ease,
        visibility .30s ease;

}


/* =========================================================
   MOBILE OVERLAY ACTIVE
   ========================================================= */

.mobile-overlay.active {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

}


/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.mobile-menu-btn,
.mobile-toggle {

    width: 46px;

    height: 46px;

    display: none;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius-sm);

    background:
        #f7f8fa;

    color:
        var(--black);

    cursor: pointer;

    font-size: 22px;

    transition:
        var(--transition);

}


/* =========================================================
   MOBILE BUTTON HOVER
   ========================================================= */

.mobile-menu-btn:hover,
.mobile-toggle:hover {

    background:
        var(--primary);

    border-color:
        var(--primary);

    color:
        #ffffff;

}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

.mobile-header {

    min-height: 70px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        15px 18px;

    border-bottom:
        1px solid
        var(--border);

    background:
        #ffffff;

    position: sticky;

    top: 0;

    z-index: 2;

}


/* =========================================================
   MOBILE CLOSE BUTTON
   ========================================================= */

.btn-close-mobile {

    width: 38px;

    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border:
        1px solid
        var(--border);

    border-radius:
        50%;

    background:
        #f8fafc;

    color:
        #374151;

    cursor: pointer;

    transition:
        var(--transition);

}


.btn-close-mobile:hover {

    background:
        #ef4444;

    border-color:
        #ef4444;

    color:
        #ffffff;

}


/* =========================================================
   MOBILE CATEGORY BASE
   ========================================================= */

.mobile-category {

    margin: 0;

    padding:
        10px 15px 30px;

}


.mobile-category li {

    position: relative;

    border-bottom:
        1px solid
        #f1f3f5;

}


/* =========================================================
   MOBILE CATEGORY LINK
   ========================================================= */

.mobile-category li > a {

    min-height: 52px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding:
        13px 7px;

    color:
        #333333;

    font-size: 14px;

    font-weight: 600;

}


/* =========================================================
   MOBILE CATEGORY LINK HOVER
   ========================================================= */

.mobile-category li > a:hover {

    color:
        var(--primary);

}


/* =========================================================
   MOBILE SUBCATEGORY
   ========================================================= */

.mobile-category li ul {

    margin: 0;

    padding:
        0 0 5px 18px;

    background:
        #fafafa;

}


/* =========================================================
   MOBILE SUBCATEGORY LINKS
   ========================================================= */

.mobile-category li ul li > a {

    min-height: 45px;

    padding:
        10px 8px;

    font-size: 13px;

    font-weight: 500;

}


/* =========================================================
   MOBILE CATEGORY ICON
   ========================================================= */

.mobile-category i {

    flex-shrink: 0;

}


/* =========================================================
   BODY LOCK
   ========================================================= */

body.mobile-menu-open {

    overflow: hidden;

}


/* =========================================================
   BACK TO TOP
   ========================================================= */

.back-to-top {

    position: fixed;

    right: 25px;

    bottom: 25px;

    width: 46px;

    height: 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        var(--primary);

    color:
        #ffffff;

    cursor: pointer;

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(15px);

    box-shadow:
        var(--shadow-md);

    z-index: 9998;

    transition:
        var(--transition);

}


.back-to-top.show {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);

}


.back-to-top:hover {

    background:
        var(--primary-dark);

    transform:
        translateY(-3px);

}


/* =========================================================
   CART TOAST
   ========================================================= */

.cart-toast {

    position: fixed;

    right: 25px;

    bottom: 25px;

    width: 340px;

    max-width: calc(100vw - 30px);

    display: flex;

    align-items: center;

    gap: 15px;

    padding: 18px;

    background:
        #ffffff;

    border-radius:
        var(--radius-lg);

    box-shadow:
        var(--shadow-lg);

    z-index: 100002;

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(30px);

    transition:
        .35s ease;

}


.cart-toast.show {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);

}


/* =========================================================
   CART TOAST ICON
   ========================================================= */

.cart-toast-icon {

    width: 52px;

    height: 52px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        var(--primary-light);

    color:
        var(--primary);

    font-size: 22px;

}


/* =========================================================
   CART TOAST CONTENT
   ========================================================= */

.cart-toast-content h5 {

    margin: 0;

    color:
        #222222;

    font-size: 15px;

    font-weight: 700;

}


.cart-toast-content p {

    margin:
        4px 0 0;

    color:
        #777777;

    font-size: 12px;

}


/* =========================================================
   HEADER GLOBAL TRANSITIONS
   ========================================================= */

.site-header a,
.site-header button,
.site-header input,
.site-header .category-menu-item {

    transition:
        var(--transition);

}


/* =========================================================
   SELECTION
   ========================================================= */

.site-header ::selection {

    background:
        rgba(22, 163, 74, .20);

    color:
        var(--black);

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1200px) {

    :root {

        --container: 1140px;

    }

}


/* =========================================================
   TABLET / MOBILE HEADER
   ========================================================= */

@media (max-width: 992px) {

    :root {

        /*
         * Top bar remains visible.
         * Middle bar becomes dynamic.
         * Bottom category navigation is hidden.
         */

        --middlebar-height: auto;

        --total-header-height:
            var(--topbar-height);

    }


    body {

        padding-top:
            var(--topbar-height);

    }


    .site-header {

        height: auto;

    }


    .site-header .middle-bar {

        height: auto;

        min-height: 0;

    }


    .site-header .bottom-bar,
    .site-header .category-navbar {

        display: none;

    }


    .mobile-menu-btn,
    .mobile-toggle {

        display: flex;

    }


    .mobile-sidebar {

        display: block;

    }


    .container-xl {

        padding-left: 16px;

        padding-right: 16px;

    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    :root {

        --topbar-height: 40px;

    }


    body {

        padding-top:
            var(--topbar-height);

    }


    .site-header {

        height: auto;

    }


    .mobile-menu-btn,
    .mobile-toggle {

        width: 42px;

        height: 42px;

        font-size: 20px;

    }


    .cart-toast {

        left: 15px;

        right: 15px;

        bottom: 15px;

        width: auto;

        max-width: none;

    }


    .back-to-top {

        right: 15px;

        bottom: 15px;

        width: 42px;

        height: 42px;

    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 576px) {

    :root {

        --topbar-height: 38px;

    }


    body {

        padding-top:
            var(--topbar-height);

    }


    .container-xl {

        padding-left: 12px;

        padding-right: 12px;

    }


    .mobile-sidebar {

        width:
            min(300px, 90vw);

    }


    .mobile-header {

        min-height: 62px;

        padding:
            12px 15px;

    }


    .mobile-category {

        padding:
            8px 12px 25px;

    }


    .cart-toast {

        padding:
            14px;

    }

}


/* =========================================================
   VERY SMALL DEVICES
   ========================================================= */

@media (max-width: 380px) {

    .mobile-sidebar {

        width:
            92vw;

    }


    .mobile-category li > a {

        font-size: 13px;

    }

}