/**
 * IASCOM Mobile Menu CSS v1.6
 */

:root {
    --imm-red: #d32f2f;
    --imm-header: 56px;
    --imm-width: 280px;
}

/* Hide on desktop */
.iascom-mm-header-bar,
.iascom-mm-overlay,
.iascom-mm-panel,
.iascom-mm-search-bar {
    display: none;
}

@media (max-width: 1024px) {
    
    body {
        padding-top: var(--imm-header) !important;
    }
    
    /* ===== HEADER BAR ===== */
    .iascom-mm-header-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--imm-header);
        padding: 0 8px;
        z-index: 99000;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    
    .iascom-mm-open {
        width: 48px;
        height: 48px;
        background: none;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
    }
    
    .iascom-mm-open span {
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 1px;
        transition: transform 0.25s ease, opacity 0.25s ease;
        transform-origin: center;
    }

    .iascom-mm-open.is-open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .iascom-mm-open.is-open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .iascom-mm-open.is-open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .iascom-mm-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .iascom-mm-logo img {
        height: 32px;
        width: auto;
    }
    
    .iascom-mm-cart {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        position: relative;
    }
    
    .iascom-mm-cart svg {
        width: 24px;
        height: 24px;
    }
    
    .iascom-mm-cart-count {
        position: absolute;
        top: 6px;
        right: 6px;
        background: #fff;
        color: var(--imm-red);
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* ===== OVERLAY ===== */
    .iascom-mm-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 99500;
    }
    
    .iascom-mm-overlay.active {
        display: block;
    }
    
    /* ===== PANEL ===== */
    .iascom-mm-panel {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--imm-width);
        max-width: 85vw;
        background: #fff;
        z-index: 99900;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .iascom-mm-panel.active {
        transform: translateX(0);
    }
    
    /* ===== PANEL HEADER ===== */
    .iascom-mm-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--imm-header);
        padding: 0 8px;
        flex-shrink: 0;
    }
    
    .iascom-mm-close {
        width: 48px;
        height: 48px;
        background: none;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    .iascom-mm-close svg {
        width: 26px;
        height: 26px;
    }
    
    .iascom-mm-panel-logo {
        height: 28px;
        width: auto;
    }
    
    .iascom-mm-panel-cart {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
    }
    
    .iascom-mm-panel-cart svg {
        width: 22px;
        height: 22px;
    }
    
    /* ===== NAVIGATION ===== */
    .iascom-mm-nav {
        flex: 1;
        overflow-y: auto;
        padding: 8px 0;
    }
    
    .iascom-mm-item {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 16px 20px;
        color: #333;
        font-size: 16px;
        font-weight: 500;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .iascom-mm-item:active {
        background: #f5f5f5;
    }
    
    .iascom-mm-item:last-child {
        border-bottom: none;
        color: var(--imm-red);
        font-weight: 600;
    }
    
    .iascom-mm-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }
    
    .iascom-mm-item:last-child .iascom-mm-icon {
        stroke: var(--imm-red);
    }
    
    /* ===== FOOTER ===== */
    .iascom-mm-footer {
        display: flex;
        gap: 12px;
        padding: 16px;
        border-top: 1px solid #eee;
        background: #f8f8f8;
        flex-shrink: 0;
    }
    
    .iascom-mm-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .iascom-mm-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .iascom-mm-btn-register {
        background: var(--imm-red);
        color: #fff;
        border: 2px solid var(--imm-red);
    }
    
    .iascom-mm-btn-login {
        background: #fff;
        color: var(--imm-red);
        border: 2px solid var(--imm-red);
    }
    
    .iascom-mm-btn-logout {
        background: #fff;
        color: #666;
        border: 2px solid #ccc;
        width: 100%;
    }
    
    .iascom-mm-btn:active {
        opacity: 0.8;
    }
    
    /* ===== HEADER RIGHT (search + cart) ===== */
    .iascom-mm-header-right {
        display: flex;
        align-items: center;
    }

    .iascom-mm-search-btn {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        text-decoration: none;
        position: relative;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    .iascom-mm-search-btn svg {
        width: 24px;
        height: 24px;
    }

    /* ===== SEARCH BAR (below header) ===== */
    .iascom-mm-search-bar {
        position: fixed;
        top: var(--imm-header);
        left: 0;
        right: 0;
        background: #fff;
        padding: 10px 12px;
        z-index: 99001;
        box-shadow: 0 4px 12px rgba(0,0,0,0.18);
        align-items: center;
        gap: 8px;
    }

    .iascom-mm-search-bar.active {
        display: flex;
    }

    .iascom-mm-search-bar input {
        flex: 1;
        height: 44px;
        padding: 0 18px;
        font-size: 16px;
        border: 2px solid #e0e0e0;
        border-radius: 22px;
        outline: none;
        font-family: Arial, sans-serif;
    }

    .iascom-mm-search-bar input:focus {
        border-color: var(--imm-red);
    }

    .iascom-mm-search-close-btn {
        background: none;
        border: none;
        color: var(--imm-red);
        font-size: 14px;
        font-weight: 600;
        padding: 0 4px;
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
        font-family: Arial, sans-serif;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    /* ===== BODY LOCK ===== */
    body.iascom-mm-locked {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    /* Raise header bar above panel/overlay when panel open */
    body.iascom-mm-locked .iascom-mm-header-bar {
        z-index: 100000;
    }
}
