
/* =========================================
   SRI MADHURI GHEE - RESPONSIVE HEADER FIX
========================================= */

/* Desktop: Hide all mobile-only menu elements */
.sm-menu-toggle,
.sm-mobile-overlay,
.sm-mobile-drawer {
    display: none;
}

/* Keep desktop navigation clean */
@media (min-width: 992px) {
    .sm-menu-toggle {
        display: none !important;
    }

    .sm-mobile-overlay,
    .sm-mobile-drawer {
        display: none !important;
    }

    .sm-main-navbar .sm-navbar-collapse {
        display: flex !important;
        visibility: visible !important;
    }

    .sm-main-navbar .sm-nav-list {
        display: flex;
        align-items: center;
    }
}

/* Mobile and tablet */
@media (max-width: 991.98px) {

    /* Header layout */
    .sm-main-navbar .sm-navbar-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .sm-main-navbar .sm-brand {
        margin-right: auto;
        max-width: calc(100% - 65px);
    }

    .sm-main-navbar .brand-logo {
        max-width: 100%;
        height: auto;
        max-height: 65px;
        object-fit: contain;
    }

    /* Hamburger button: mobile only */
    .sm-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 46px;
        height: 44px;
        flex-shrink: 0;
        padding: 8px;
        margin-left: 12px;
        border: 1px solid #e3e3e3;
        border-radius: 6px;
        background: #fff;
        cursor: pointer;
        position: relative;
        z-index: 10;
    }

    .sm-menu-toggle .sm-toggle-line {
        display: block;
        width: 23px;
        height: 2px;
        background: #754719;
        border-radius: 2px;
        transition: transform .25s ease, opacity .25s ease;
    }

    .sm-menu-toggle[aria-expanded="true"] .sm-toggle-line:first-child {
        transform: translateY(7px) rotate(45deg);
    }

    .sm-menu-toggle[aria-expanded="true"] .sm-toggle-line:nth-child(2) {
        opacity: 0;
    }

    .sm-menu-toggle[aria-expanded="true"] .sm-toggle-line:last-child {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Disable Bootstrap's collapsed desktop links on mobile */
    .sm-main-navbar .sm-navbar-collapse {
        display: none !important;
    }

    /* Full-screen dim overlay */
    .sm-mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background: rgba(0, 0, 0, .52);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .sm-mobile-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Slide-in drawer */
    .sm-mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 9999;
        width: min(88vw, 380px);
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        padding: 18px;
        padding-bottom: max(18px, env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        box-shadow: 8px 0 30px rgba(0, 0, 0, .15);
        transform: translateX(-105%);
        visibility: hidden;
        pointer-events: none;
        transition: transform .28s ease, visibility .28s ease;
    }

    .sm-mobile-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    /* Drawer header */
    .sm-mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 18px;
        border-bottom: 1px solid #eee;
    }

    .sm-mobile-drawer-header img {
        display: block;
        width: auto;
        max-width: 190px;
        max-height: 65px;
        object-fit: contain;
    }

    .sm-mobile-drawer-header button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: 0;
        border-radius: 5px;
        background: #f5f1ec;
        color: #754719;
        font-size: 30px;
        line-height: 1;
        cursor: pointer;
    }

    /* Search field */
    .sm-mobile-search {
        display: flex;
        width: 100%;
        margin: 20px 0 12px;
        border: 1px solid #e4e4e4;
        border-radius: 6px;
        overflow: hidden;
    }

    .sm-mobile-search input {
        flex: 1;
        width: 0;
        min-width: 0;
        padding: 12px;
        border: 0;
        outline: none;
        background: #fff;
        color: #333;
    }

    .sm-mobile-search button {
        width: 45px;
        flex-shrink: 0;
        border: 0;
        background: #754719;
        color: #fff;
        cursor: pointer;
    }

    /* Mobile navigation links */
    .sm-mobile-links {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .sm-mobile-links > a,
    .sm-mobile-submenu-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        padding: 13px 4px;
        border: 0;
        border-bottom: 1px solid #eee;
        background: transparent;
        color: #333;
        font-family: inherit;
        font-size: 15px;
        font-weight: 500;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    .sm-mobile-links > a:hover,
    .sm-mobile-submenu-toggle:hover {
        color: #754719;
    }

    /* Products submenu */
    .sm-mobile-arrow {
        display: inline-block;
        transition: transform .2s ease;
    }

    .sm-mobile-submenu-toggle[aria-expanded="true"] .sm-mobile-arrow {
        transform: rotate(180deg);
    }

    .sm-mobile-submenu {
        display: none;
        flex-direction: column;
        padding: 5px 0 5px 15px;
        background: #faf8f5;
    }

    .sm-mobile-submenu.is-open {
        display: flex;
    }

    .sm-mobile-submenu a {
        display: block;
        padding: 12px 10px;
        border-bottom: 1px solid #eee;
        color: #555;
        font-size: 14px;
        text-decoration: none;
    }

    .sm-mobile-submenu a:hover {
        color: #754719;
    }

    /* Mobile action buttons */
    .sm-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 22px;
    }

    .sm-mobile-actions a {
        display: block;
        width: 100%;
        padding: 13px 10px;
        border-radius: 5px;
        font-size: 13px;
        font-weight: 600;
        text-align: center;
        text-decoration: none;
    }

    .sm-mobile-enquiry {
        background: #754719;
        color: #fff !important;
    }

    .sm-mobile-whatsapp {
        background: #198754;
        color: #fff !important;
    }

    /* Contact information */
    .sm-mobile-contact {
        margin-top: 18px;
        padding-top: 14px;
        border-top: 1px solid #eee;
    }

    .sm-mobile-contact p {
        margin: 0 0 12px;
        color: #555;
        font-size: 13px;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

    .sm-mobile-contact p i {
        color: #754719;
    }

    .sm-mobile-contact a {
        color: #444;
        text-decoration: none;
    }

    /* Prevent page scrolling when drawer is open */
    body.sm-menu-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .sm-mobile-drawer,
    .sm-mobile-overlay,
    .sm-menu-toggle .sm-toggle-line {
        transition: none !important;
    }
}
