/* =============================================
   Zahrlib Header Styles
   Colors: #E91E63 | #9C27B0 | #3F51B5
   ============================================= */

:root {
    --zl-pink:    #E91E63;
    --zl-purple:  #9C27B0;
    --zl-blue:    #3F51B5;
    --zl-white:   #ffffff;
    --zl-text:    #2d2d2d;
    --zl-gray:    #f5f5f5;
    --zl-border:  #eeeeee;
    --zl-shadow:  0 2px 20px rgba(63, 81, 181, 0.12);
    --zl-gradient: linear-gradient(135deg, #E91E63 0%, #9C27B0 50%, #3F51B5 100%);
    --zl-header-h: 72px;
    --zl-sidebar-w: 380px;
    --zl-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    margin: 0;
    padding-top: var(--zl-header-h) !important;
    color: var(--zl-text);
}

/* Hide Elementor's original header section to avoid duplication */
.elementor-location-header {
    display: none !important;
}

/* ── Header Shell ── */
.zl-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: var(--zl-header-h);
    background: var(--zl-white);
    border-bottom: 1px solid var(--zl-border);
    box-shadow: var(--zl-shadow);
    transition: box-shadow var(--zl-transition);
}

.zl-header.is-scrolled {
    box-shadow: 0 4px 30px rgba(63, 81, 181, 0.18);
}

.zl-header__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ── Logo ── */
.zl-header__logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.zl-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.zl-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--zl-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Navigation ── */
.zl-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.zl-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zl-nav__list li a {
    display: block;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--zl-text);
    text-decoration: none;
    border-radius: 8px;
    position: relative;
    transition: color var(--zl-transition), background var(--zl-transition);
}

.zl-nav__list li a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 16px;
    left: 16px;
    height: 2px;
    background: var(--zl-gradient);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform var(--zl-transition);
}

.zl-nav__list li a:hover,
.zl-nav__list li.current-menu-item a {
    color: var(--zl-blue);
    background: rgba(63, 81, 181, 0.06);
}

.zl-nav__list li a:hover::after,
.zl-nav__list li.current-menu-item a::after {
    transform: scaleX(1);
}

/* ── Header Actions ── */
.zl-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Cart Button ── */
.zl-cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 2px solid var(--zl-border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--zl-text);
    transition: all var(--zl-transition);
}

.zl-cart-btn:hover {
    border-color: var(--zl-blue);
    color: var(--zl-blue);
    background: rgba(63, 81, 181, 0.06);
}

.zl-cart-icon {
    width: 22px;
    height: 22px;
}

.zl-cart-count {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--zl-gradient);
    color: var(--zl-white);
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform var(--zl-transition);
}

.zl-cart-count.bump {
    transform: scale(1.4);
}

/* ── Hamburger ── */
.zl-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: 2px solid var(--zl-border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color var(--zl-transition);
}

.zl-hamburger:hover {
    border-color: var(--zl-blue);
}

.zl-hamburger__line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--zl-text);
    border-radius: 2px;
    transition: transform var(--zl-transition), opacity var(--zl-transition), background var(--zl-transition);
    transform-origin: center;
}

.zl-hamburger.is-open .zl-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--zl-pink);
}

.zl-hamburger.is-open .zl-hamburger__line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.zl-hamburger.is-open .zl-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--zl-pink);
}

/* ── Overlay ── */
.zl-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--zl-transition);
}

.zl-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Cart Sidebar ── */
.zl-cart-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    width: var(--zl-sidebar-w);
    max-width: 100vw;
    height: 100vh;
    background: var(--zl-white);
    box-shadow: 4px 0 40px rgba(63, 81, 181, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform var(--zl-transition);
}

.zl-cart-sidebar.is-open {
    transform: translateX(0);
}

.zl-cart-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--zl-border);
    background: var(--zl-gray);
}

.zl-cart-sidebar__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--zl-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.zl-cart-sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 2px solid var(--zl-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--zl-text);
    transition: all var(--zl-transition);
}

.zl-cart-sidebar__close:hover {
    border-color: var(--zl-pink);
    color: var(--zl-pink);
}

.zl-cart-sidebar__close svg {
    width: 16px;
    height: 16px;
}

.zl-cart-sidebar__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.zl-cart-sidebar__body .woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 0;
}

.zl-cart-sidebar__body .woocommerce-mini-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--zl-border);
}

.zl-cart-sidebar__body .woocommerce-mini-cart-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.zl-cart-sidebar__body .woocommerce-mini-cart-item a {
    color: var(--zl-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.zl-cart-sidebar__body .woocommerce-mini-cart-item a:hover {
    color: var(--zl-blue);
}

.zl-cart-sidebar__body .quantity {
    font-size: 0.85rem;
    color: #666;
}

.zl-cart-sidebar__body .woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 8px;
    font-weight: 700;
    font-size: 1rem;
}

.zl-cart-sidebar__body .woocommerce-mini-cart__total .amount {
    background: var(--zl-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
}

.zl-cart-sidebar__body .woocommerce-mini-cart__buttons,
.zl-cart-sidebar__body p.woocommerce-mini-cart__buttons {
    display: none;
}

.zl-cart-sidebar__footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--zl-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Buttons ── */
.zl-btn {
    display: block;
    width: 100%;
    padding: 13px 24px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all var(--zl-transition);
}

.zl-btn--gradient {
    background: var(--zl-gradient);
    color: var(--zl-white);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.zl-btn--gradient:hover {
    box-shadow: 0 6px 25px rgba(233, 30, 99, 0.45);
    transform: translateY(-1px);
    color: var(--zl-white);
}

.zl-btn--outline {
    background: transparent;
    color: var(--zl-blue);
    border: 2px solid var(--zl-blue);
}

.zl-btn--outline:hover {
    background: var(--zl-blue);
    color: var(--zl-white);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .zl-hamburger {
        display: flex;
    }

    .zl-nav {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 999;
        width: 280px;
        height: 100vh;
        background: var(--zl-white);
        box-shadow: -4px 0 40px rgba(63, 81, 181, 0.2);
        flex-direction: column;
        justify-content: flex-start;
        padding: calc(var(--zl-header-h) + 16px) 0 24px;
        transform: translateX(100%);
        transition: transform var(--zl-transition);
    }

    .zl-nav.is-open {
        transform: translateX(0);
    }

    .zl-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 0 16px;
    }

    .zl-nav__list li a {
        padding: 14px 16px;
        font-size: 1.05rem;
        border-radius: 10px;
    }

    .zl-nav__list li a::after {
        display: none;
    }

    .zl-nav__list li a:hover,
    .zl-nav__list li.current-menu-item a {
        background: rgba(63, 81, 181, 0.08);
    }

    .zl-cart-sidebar {
        width: 100vw;
    }

    :root {
        --zl-sidebar-w: 100vw;
    }
}

@media (max-width: 400px) {
    .zl-header__container {
        padding: 0 16px;
    }

    .zl-logo-img {
        height: 38px;
    }
}
