/* Modern responsive header + homepage polish */
.almart-header {
    position: relative;
    z-index: var(--almart-z-header);
    box-shadow: var(--almart-shadow-header);
}

.almart-header__main {
    background: var(--almart-color-surface);
    border-bottom: 1px solid var(--almart-color-border-subtle);
}

.almart-header__main-inner {
    min-height: var(--almart-header-main-min-height);
    display: grid;
    grid-template-columns: auto minmax(300px, 1fr) auto;
    align-items: center;
    gap: 1rem;
}

.almart-header__search {
    display: flex;
    align-items: center;
    border: 1px solid var(--almart-color-border-strong);
    border-radius: var(--almart-radius-pill);
    overflow: hidden;
    background: var(--almart-color-surface-tint);
}

.almart-header__search .form-control {
    background: transparent;
    padding: 0.85rem 1rem 0.85rem 1.2rem;
    font-size: 0.95rem;
}

.almart-header__search .btn {
    border-radius: 999px;
    margin: 0.25rem;
    min-width: 54px;
}

.almart-header__actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.almart-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7ddf5;
    color: #34415f;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
}

.almart-icon-btn:hover {
    color: #fff;
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.almart-icon-badge {
    position: absolute;
    top: -6px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ff4d4f;
    color: #fff;
    font-size: 0.65rem;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    font-weight: 700;
}

.almart-header__nav-wrap .navbar .navbar-nav .nav-link {
    font-size: 0.96rem;
    font-weight: 600;
    padding: 14px 14px;
}

.almart-header__search-mobile {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    overflow: hidden;
    margin: 0.75rem 0 1rem;
    background: rgba(255, 255, 255, 0.1);
}

.almart-header__search-mobile .form-control {
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.92rem;
}

.almart-header__search-mobile .btn {
    border-radius: 0;
    min-width: 52px;
}

/* Home section responsive tuning */
@media (max-width: 1199.98px) {
    .header-carousel.owl-carousel .owl-nav .owl-prev {
        right: 82px;
    }
    .header-carousel.owl-carousel .owl-nav .owl-next {
        right: 20px;
    }
}

@media (max-width: 991.98px) {
    .almart-header__main {
        display: none;
    }

    .almart-header__nav-wrap .row {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .nav-bar .navbar .navbar-nav .nav-link {
        padding: 10px 0;
    }

    .carousel .carousel-content {
        padding: 1.25rem !important;
    }

    .header-carousel.owl-carousel .owl-nav .owl-prev,
    .header-carousel.owl-carousel .owl-nav .owl-next {
        top: auto;
        bottom: 14px;
        width: 42px;
        height: 42px;
    }

    .product-item .almart-home-tab-card-caption {
        padding: 1rem !important;
    }
}

@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        --bs-gutter-x: 1.1rem;
    }

    .page-header {
        padding-top: 3.2rem !important;
        padding-bottom: 3.2rem !important;
    }

    .carousel .carousel-banner {
        padding: 1rem;
    }

    .carousel .carousel-banner-content .fs-3 {
        font-size: 1.15rem !important;
    }

    .display-3 {
        font-size: calc(1.55rem + 2.4vw);
    }

    .display-5 {
        font-size: calc(1.25rem + 1.2vw);
    }

    .products-mini-item .products-mini-content {
        padding: 0.85rem !important;
    }

    .footer .rounded.p-4 {
        padding: 1rem !important;
    }
}

@media (max-width: 575.98px) {
    .brand-logo-img {
        height: 40px;
    }

    .navbar .navbar-toggler {
        padding: 4px 10px;
    }

    .almart-icon-btn {
        width: 36px;
        height: 36px;
    }

    .carousel-content .btn,
    .product-item-add .btn,
    .products-mini-add .btn {
        width: 100%;
    }
}

/* Mobile sticky bottom quick nav */
.almart-mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #e6ebff;
    box-shadow: 0 -8px 24px rgba(13, 28, 73, 0.12);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
}

.almart-mobile-bottom-nav a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #4a5675;
    font-size: 0.73rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
}

.almart-mobile-bottom-nav a i {
    font-size: 1rem;
}

.almart-mobile-bottom-nav a.is-active,
.almart-mobile-bottom-nav a:hover {
    color: var(--bs-primary);
}

.almart-nav-badge {
    position: absolute;
    top: 6px;
    right: 12px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ff4d4f;
    color: #fff;
    font-size: 0.62rem;
    line-height: 16px;
    text-align: center;
    padding: 0 4px;
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: 72px;
    }
}

@media (min-width: 992px) {
    .almart-mobile-bottom-nav {
        display: none !important;
    }
}
