/**
 * Hamta Page Builder — Enhanced layout styles (header/footer)
 */

.hpb-header.hpb-lb,
.hpb-footer.hpb-fb,
#hpb-site-header,
#hpb-site-footer {
    direction: rtl;
    --hpb-lb-accent: #2563eb;
    --hpb-lb-surface: #ffffff;
    --hpb-lb-border: rgba(15, 23, 42, 0.08);
    --hpb-lb-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    background: var(--hpb-lb-surface);
}

.hpb-header.hpb-lb--mobile-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    box-shadow: var(--hpb-lb-shadow);
    background: #fff;
}

.hpb-lb--mobile-fixed .hpb-lb-row--middle .hpb-lb-row-inner {
    min-height: 52px;
}

.hpb-lb--mobile-fixed .hpb-lb-logo-img {
    max-height: 38px;
}

.hpb-lb--mobile-fixed .woocommerce.widget_shopping_cart .widget_shopping_cart_content {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* عرض row-inner: site-container.css */

.hpb-lb-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

.hpb-lb-logo-img {
    max-height: 52px;
    width: auto;
    display: block;
}

.hpb-footer.hpb-fb {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #e5e7eb;
    padding-block: 2.5rem;
}

.hpb-fb-contact-title {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.hpb-fb-contact-list {
    list-style: none;
}

.hpb-fb-contact-item + .hpb-fb-contact-item {
    margin-top: 0.35rem;
}

.hpb-fb-copy {
    opacity: 0.85;
    font-size: 0.92rem;
}

.hpb-lb-cell-align-center {
    text-align: center;
}

.hpb-lb-cell-align-end,
.hpb-lb-cell-align-left {
    text-align: left;
}

.hpb-lb-cell-align-start,
.hpb-lb-cell-align-right {
    text-align: right;
}

@media (max-width: 991px) {
    .hpb-lb--mobile .hpb-lb-cols--3 > .col-4,
    .hpb-fb--mobile .hpb-fb-cols--3 > .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* viewport باریک — حتی با UA دسکتاپ (Chrome Responsive) */
@media (max-width: 991.98px) {
    :root {
        --hpb-mobile-header-h: 56px;
    }

    /* sticky-bottom-host و top دسکتاپ — نه top شاخه موبایل HPB */
    .hpb-lb-sticky-bottom-host {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    body.hpb-has-site-header .hd-mobile-top-spacer,
    body.hpb-has-site-header .hpb-lb-mobile-spacer,
    body:has(#hpb-site-header) .hd-mobile-top-spacer,
    body:has(#hpb-site-header) .hpb-lb-mobile-spacer {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    #hpb-site-header .mobile_top_bar,
    .mobile_top_bar {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
    }

    #hpb-site-header.hpb-lb--desktop .hpb-lb-row--top {
        display: none !important;
    }

    #hpb-site-header.hpb-lb--mobile .hpb-lb-row--top {
        display: block !important;
        min-height: var(--hpb-mobile-header-h);
        border-bottom: 1px solid var(--hpb-lb-border);
        background: #fff;
    }

    #hpb-site-header.hpb-lb--mobile .hpb-lb-row--middle,
    #hpb-site-header.hpb-lb--mobile .hpb-lb-row--bottom {
        display: none !important;
    }

    header.elementor-location-header,
    .elementor-location-header,
    .elementor.elementor-location-header {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #hpb-site-header.hpb-header-builder,
    .hpb-header.hpb-header-builder:not(.hpb-lb-sticky-bottom-host) {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        z-index: 9990;
        background: #fff;
        box-shadow: 0 2px 14px rgba(15, 23, 42, 0.08);
        transform: none !important;
    }

    #hpb-site-header.hpb-lb--desktop .hpb-lb-row--middle {
        display: block !important;
        border: none;
        min-height: var(--hpb-mobile-header-h);
    }

    #hpb-site-header .hpb-lb-row--middle .hpb-lb-logo-img,
    #hpb-site-header.hpb-lb--mobile .hpb-lb-row--top .hpb-lb-logo-img {
        max-height: 38px !important;
    }

    #hpb-site-header .hamta-shop-search-desktop {
        display: none !important;
    }

    #hpb-site-header .hpb-lb-row--middle .hpb-lb-cols--2 {
        justify-content: space-between;
        gap: 8px;
    }

    #hpb-site-header .hpb-lb-row--middle .hpb-lb-cell--1 {
        flex: 0 1 auto !important;
        width: auto !important;
        max-width: 42% !important;
    }

    #hpb-site-header .hpb-lb-row--middle .hpb-lb-cell--2 {
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: 58% !important;
        justify-content: flex-end;
        gap: 6px;
    }

    #hpb-site-header .b2blinks_parent,
    #hpb-site-header .nshmc_con,
    #hpb-site-header .ns_home_menu {
        display: none !important;
    }

    #hpb-site-header .woocommerce-mini-cart__empty-message,
    #hpb-site-header .widget_shopping_cart_content .woocommerce-mini-cart {
        display: none !important;
    }

    body.admin-bar #hpb-site-header.hpb-header-builder {
        top: 32px !important;
    }

    @media screen and (max-width: 782px) {
        body.admin-bar #hpb-site-header.hpb-header-builder {
            top: 46px !important;
        }
    }

    body.hpb-has-site-header,
    body:has(#hpb-site-header),
    body.hpb-has-sticky-bottom-nav {
        padding-top: calc(var(--hpb-mobile-header-h) + env(safe-area-inset-top, 0)) !important;
    }

    body.admin-bar.hpb-has-site-header,
    body.admin-bar:has(#hpb-site-header) {
        padding-top: calc(var(--hpb-mobile-header-h) + 32px + env(safe-area-inset-top, 0)) !important;
    }

    @media screen and (max-width: 782px) {
        body.admin-bar.hpb-has-site-header,
        body.admin-bar:has(#hpb-site-header) {
            padding-top: calc(var(--hpb-mobile-header-h) + 46px + env(safe-area-inset-top, 0)) !important;
        }
    }

    .hpb-lb--mobile-fixed .hpb-lb-row--top .hpb-lb-row-inner,
    .hpb-lb--mobile-fixed .hpb-lb-row--middle .hpb-lb-row-inner {
        min-height: var(--hpb-mobile-header-h);
    }
}
