/* ============================================================
   UNEECO UGANDA — RESPONSIVE STYLES
   Breakpoints:
     xl  : 1200px+   (large desktops)
     lg  : 992–1199px (tablets landscape / small laptops)
     md  : 768–991px  (tablets portrait)
     sm  : 576–767px  (large phones)
     xs  : 0–575px    (small phones)
   ============================================================ */

@keyframes banner-scroll {
    0%   { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}


/* ══════════════════════════════════════════════
   ALL MOBILE — Top banner overflow fix
   Below 992px
   ══════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    /* Prevent text from pushing banner wider than viewport */
    .top-banner-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .top-banner-socials {
        flex-shrink: 0;
        margin-left: 0.5rem;
    }

    .top-banner-socials a {
        margin-left: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .top-banner .container {
        overflow: hidden;
        padding-left: 0;
        padding-right: 0;
        display: block !important;
    }

    .top-banner-socials {
        display: none !important;
    }

    .top-banner-text {
        display: inline-block;
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
        text-overflow: clip;
        flex: unset;
        min-width: unset;
        animation: banner-scroll 22s linear infinite;
    }
}


/* ══════════════════════════════════════════════
   LG — Tablets landscape / small laptops
   992px and below
   ══════════════════════════════════════════════ */
@media (max-width: 991.98px) {

    /* Nav collapse dropdown */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(247, 243, 238, 0.98);
        border: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        padding: 16px;
        z-index: 1045;
        margin-top: 0;
    }

    /* Hero adjustments */
    .hero {
        min-height: auto;
        max-height: none;
        padding: 80px 0 60px;
    }

    .hero-visual {
        margin-top: 40px;
    }
}


/* ══════════════════════════════════════════════
   MD — Tablets portrait
   768px to 991px
   ══════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 991.98px) {

    :root {
        --navbar-height: 4.5rem;
    }

    body {
        padding-top: calc(var(--top-banner-height) + var(--navbar-height));
    }

    .top-banner-text {
        font-size: 0.65rem;
    }

    .top-banner-socials a {
        font-size: 0.65rem;
    }

    .navbar {
        top: var(--top-banner-height);
    }

    /* Logo scale */
    .navbar-brand img {
        margin-top: -2.2rem;
        height: 120px;
    }

    .navbar-icons {
        order: 2;
        margin-left: auto;
        margin-right: 0;
        display: none;
        /* hide search/cart on small phones to save space */
    }

        .navbar-toggler {
        margin-top: -2.2rem;
        order: 3;
        margin-left: 0.75rem;
        border: none;
        padding: 2px 6px;
        font-size: 20px;
    }

    /* Hero text */
    .hero-title {
        font-size: clamp(2rem, 4.5vw, 2rem);
    }

    .hero-sub {
        font-size: 0.92rem;
    }

    /* Hero paper stack */
    .hero-stack {
        width: 240px;
        height: 290px;
    }

    .paper-sheet {
        width: 190px;
        height: 240px;
    }

    /* Why visual card */
    .why-visual-card {
        padding: 40px 28px;
        margin-top: 30px;
    }

    /* Chat widget */
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }
}


/* ══════════════════════════════════════════════
   SM — Large phones
   576px to 767px
   ══════════════════════════════════════════════ */
@media (min-width: 576px) and (max-width: 767.98px) {

    :root {
        --navbar-height: 4.5rem;
    }

    body {
        padding-top: calc(var(--top-banner-height) + var(--navbar-height));
    }

    .top-banner-text {
        font-size: 0.65rem;
    }

    .top-banner-socials a {
        font-size: 0.65rem;
    }

    .navbar {
        top: var(--top-banner-height);
    }

    .navbar .container {
        position: relative;
        justify-content: space-between;
    }

    .navbar-brand {
        order: 1;
        width: auto;
        top: 0;
    }

    .navbar-brand img {
        height: 120px;
        margin-top: -2.2rem;
    }

    .navbar-icons {
        order: 2;
        margin-left: auto;
        margin-right: 0;
        display: none;
        /* hide search/cart on small phones to save space */
    }

    .navbar-toggler {
        margin-top: -2.2rem;
        order: 3;
        margin-left: 0.85rem;
        border: none;
        padding: 2px 6px;
        font-size: 18px;
    }

    /* Custom hamburger icon via Font Awesome */
    .navbar-toggler-icon {
        background-image: none !important;
        width: auto;
        height: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 1.5rem;
        color: var(--primary-dark);
    }

    .navbar-toggler.collapsed .navbar-toggler-icon::before {
        content: '\f0c9';
    }

    .navbar-toggler:not(.collapsed) .navbar-toggler-icon::before {
        content: '\f00d';
    }

    /* Dropdown */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(247, 243, 238, 0.98);
        border: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        padding: 16px;
        z-index: 1045;
    }

    /* Search & cart */
    .search-icon,
    .cart-icon {
        font-size: 1rem;
        margin-left: 0.6rem;
    }

    /* Hero */
    .hero {
        min-height: 60vh;
        max-height: none;
        padding: 30px 0 40px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-title {
        font-size: clamp(1.8rem, 5vw, 1.6rem);
        margin-bottom: 0.9rem;
    }

    .hero-sub {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .btn-hero-primary,
    .btn-hero-outline {
        padding: 11px 22px;
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .btn-hero-outline {
        margin-left: 0;
        margin-top: 8px;
    }

    .hero-visual {
        margin-top: 30px;
    }

    .hero-stack {
        width: 230px;
        height: 275px;
    }

    .paper-sheet {
        width: 185px;
        height: 230px;
    }

    /* Sections */
    section {
        padding: 70px 0;
    }

    /* Why visual */
    .why-visual-card {
        margin-top: 30px;
        padding: 36px 24px;
    }

    /* Chat widget */
    .chat-widget {
        bottom: 20px;
        right: 16px;
    }

    .chat-main-btn {
        padding: 11px 16px;
        font-size: 0.9rem;
    }
}


/* ══════════════════════════════════════════════
   XS — Small phones
   575px and below
   ══════════════════════════════════════════════ */
@media (max-width: 575.98px) {

    :root {
        --navbar-height: 4.3rem;
    }

    body {
        padding-top: calc(var(--top-banner-height) + var(--navbar-height));
    }

    .top-banner-text {
        font-size: 0.65rem;
    }

    .top-banner-socials a {
        font-size: 0.65rem;
    }


    /* Navbar */
    .navbar {
        top: var(--top-banner-height);
    }

    .navbar .container {
        position: relative;
        justify-content: space-between;
    }

    .navbar-brand {
        order: 1;
        width: auto;
        top: 0;
    }

    .navbar-brand img {
        margin-top: -2.2rem;
        height: 110px;
    }

    .navbar-icons {
        display: none;
    }

    .navbar-icons {
        order: 2;
        margin-left: auto;
        margin-right: 0;
    }

    .search-icon,
    .cart-icon {
        font-size: 0.95rem;
        margin-left: 0.5rem;
    }

    .cart-count {
        width: 15px;
        height: 15px;
        font-size: 0.55rem;
        top: -5px;
        right: -5px;
    }

    .navbar-toggler {
        order: 3;
        margin-left: 0.5rem;
        border: none;
        padding: 2px 4px;
        margin-top: -2.2rem;
    }

    /* Custom hamburger icon */
    .navbar-toggler-icon {
        background-image: none !important;
        width: auto;
        height: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 1.3rem;
        color: var(--primary-dark);
    }

    .navbar-toggler.collapsed .navbar-toggler-icon::before {
        content: '\f0c9';
    }

    .navbar-toggler:not(.collapsed) .navbar-toggler-icon::before {
        content: '\f00d';
    }

    /* Nav dropdown */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(247, 243, 238, 0.98);
        border: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        padding: 12px;
        z-index: 1045;
    }

    .nav-link {
        font-size: 0.82rem;
        padding: 0.45rem 0.75rem !important;
    }

    /* Hero */
    .hero {
        min-height: 55vh;
        max-height: none;
        padding: 20px 0 30px;
        background-position: center center;
    }

    .hero-content {
        max-width: 100%;
        text-align: left;
    }

    .hero-eyebrow {
        font-size: 0.65rem;
        padding: 5px 12px;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(1.7rem, 7vw, 1.8rem);
        margin-bottom: 0.8rem;
        letter-spacing: -0.5px;
    }

    .hero-sub {
        font-size: 0.8rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .btn-hero-primary,
    .btn-hero-outline {
        padding: 10px 18px;
        font-size: 0.75rem;
        margin-bottom: 10px;
        display: inline-flex;
    }

    .btn-hero-outline {
        margin-left: 0;
        margin-top: 4px;
    }

    /* Hide paper stack entirely on very small screens */
    .hero-visual {
        display: none;
    }

    /* Sections */
    section {
        padding: 55px 0;
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 1.9rem);
    }

    .section-lead {
        font-size: 0.9rem;
    }

    /* Product cards */
    .product-card {
        padding: 24px 20px;
    }

    /* Why section */
    .why-visual-card {
        margin-top: 24px;
        padding: 28px 20px;
    }

    .why-item {
        gap: 16px;
        padding: 20px 0;
    }

    .why-num {
        font-size: 1.8rem;
        min-width: 36px;
    }

    /* Footer */
    footer {
        padding: 40px 0 24px;
    }

    .footer-brand {
        font-size: 1.25rem;
    }

    /* Chat widget — compact on mobile */
    .chat-widget {
        bottom: 16px;
        right: 14px;
    }

    .chat-main-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
        gap: 7px;
    }

    .chat-main-btn i {
        font-size: 1.1rem;
    }

    .chat-label {
        font-size: 0.8rem;
    }

    .chat-option {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    /* Back to top — move above chat button */
    .back-to-top {
        bottom: 80px;
        right: 14px;
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}


/* ══════════════════════════════════════════════
   MOBILE SIDEBAR NAVIGATION
   ══════════════════════════════════════════════ */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 26, 86, 0.45);
    backdrop-filter: blur(3px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(80vw, 300px);
    height: fit-content;
    max-height: 100dvh;
    background: var(--warm-white);
    z-index: 2010;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
}

.mobile-sidebar.open {
    transform: translateX(0);
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}

.mobile-sidebar-logo {
    height: 90px;
    width: auto;
    object-fit: contain;
}

.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--primary-dark);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-close:hover {
    background: var(--accent-pale);
    color: var(--primary-mid);
}

.mobile-sidebar-search {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.mobile-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.78rem;
    pointer-events: none;
}

.mobile-search-input {
    width: 100%;
    padding: 10px 40px 10px 36px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-dark);
    background: var(--accent-pale);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.mobile-search-input:focus {
    border-color: var(--primary-mid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(62, 66, 129, 0.1);
}

.mobile-search-input::placeholder {
    color: #aaa;
}

.mobile-search-clear {
    position: absolute;
    right: 10px;
    width: 22px;
    height: 22px;
    background: var(--text-muted);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.mobile-search-clear:hover {
    background: var(--primary-dark);
}

.mobile-sidebar-nav {
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mobile-sidebar-link {
    display: block;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary-dark);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background 0.2s, color 0.2s, padding-left 0.2s, border-color 0.2s;
}

.mobile-sidebar-link:hover,
.mobile-sidebar-link.active {
    background: var(--accent-pale);
    color: var(--primary-mid);
    padding-left: 1.35rem;
    border-left-color: var(--primary-mid);
}