/**
 * Mobile Menu Styles
 * HTML-based collapsible menu for mobile devices
 * Version: 1.0
 */

/* ===== Toggle Button ===== */
.mobile-menu-toggle {
    position: fixed;
    width: 54px;
    height: 54px;
    background: #FE3700;
    border: 3px solid #A41B00;
    border-radius: 12px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mobile-menu-toggle:hover {
    background: #E63200;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
    background: #CC2D00;
}

.mobile-menu-toggle .menu-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-menu-toggle .menu-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* Hamburger to X animation */
.mobile-menu-toggle.active .menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .menu-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== Menu Container ===== */
.mobile-menu-container {
    position: fixed;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu-container.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ===== Menu Grid ===== */
.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 3px solid #DA3732;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ===== Menu Button ===== */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Button Icon - image only */
.mobile-menu-btn .btn-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

/* Hide label - image already has it */
.mobile-menu-btn .btn-label {
    display: none;
}

/* ===== Single button in last row ===== */
.mobile-menu-btn.single {
    grid-column: 1 / -1;
    justify-self: center;
}

/* ===== Responsive adjustments ===== */
@media screen and (max-height: 600px) {
    .mobile-menu-btn .btn-icon {
        width: 55px;
        height: 55px;
    }

    .mobile-menu-grid {
        gap: 5px;
        padding: 8px;
    }
}

@media screen and (max-width: 380px) {
    .mobile-menu-btn .btn-icon {
        width: 60px;
        height: 60px;
    }

    .mobile-menu-grid {
        gap: 6px;
        padding: 8px;
    }
}

/* ===== Animation for buttons ===== */
@keyframes menuBtnPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.mobile-menu-container.active .mobile-menu-btn {
    animation: menuBtnPop 0.2s ease forwards;
}

.mobile-menu-container.active .mobile-menu-btn:nth-child(1) { animation-delay: 0ms; }
.mobile-menu-container.active .mobile-menu-btn:nth-child(2) { animation-delay: 30ms; }
.mobile-menu-container.active .mobile-menu-btn:nth-child(3) { animation-delay: 60ms; }
.mobile-menu-container.active .mobile-menu-btn:nth-child(4) { animation-delay: 90ms; }
.mobile-menu-container.active .mobile-menu-btn:nth-child(5) { animation-delay: 120ms; }
.mobile-menu-container.active .mobile-menu-btn:nth-child(6) { animation-delay: 150ms; }
.mobile-menu-container.active .mobile-menu-btn:nth-child(7) { animation-delay: 180ms; }
.mobile-menu-container.active .mobile-menu-btn:nth-child(8) { animation-delay: 210ms; }
