/**
 * Product Mobile Menu Styles
 * Mobile-specific menu styling for product pages only
 * This menu is designed to work alongside existing menus on mobile devices
 */

/* ===== MOBILE MENU CONTAINER ===== */

.product-mobile-menu-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: none; /* Hidden by default, shown only on mobile */
}

/* ===== HAMBURGER BUTTON ===== */

.product-mobile-menu-toggle {
    background: #007bff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10000;
}

.product-mobile-menu-toggle:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.product-mobile-menu-toggle:active {
    transform: scale(0.95);
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* Hamburger animation when menu is open */
.product-mobile-menu-container.menu-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.product-mobile-menu-container.menu-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.product-mobile-menu-container.menu-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== MOBILE MENU NAVIGATION ===== */

.product-mobile-menu {
    position: absolute;
    bottom: 70px;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.product-mobile-menu-container.menu-open .product-mobile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== MENU LIST STYLING ===== */

.product-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-mobile-menu-list li {
    border-bottom: 1px solid #f8f9fa;
    position: relative;
}

.product-mobile-menu-list li:last-child {
    border-bottom: none;
}

.product-mobile-menu-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    color: #495057;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.product-mobile-menu-list a:hover {
    background: #f8f9fa;
    color: #007bff;
}

.product-mobile-menu-list .current-menu-item > a {
    background: #e3f2fd;
    color: #007bff;
    font-weight: 600;
}

/* ===== DROPDOWN ARROW ===== */

.dropdown-arrow {
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.has-submenu.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* ===== SUBMENU STYLING ===== */

.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-submenu.open .submenu {
    max-height: 500px; /* Adjust based on your needs */
}

.submenu li {
    border-bottom: 1px solid #e9ecef;
}

.submenu li:last-child {
    border-bottom: none;
}

.submenu a {
    padding: 12px 20px 12px 35px;
    font-size: 14px;
    color: #6c757d;
}

.submenu a:hover {
    background: #e9ecef;
    color: #007bff;
}

.submenu .current-menu-item > a {
    background: #e3f2fd;
    color: #007bff;
}

/* ===== MOBILE ONLY DISPLAY ===== */

/* Show only on mobile devices */
@media (min-width: 768px) {
    .product-mobile-menu-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Show on mobile devices */
@media (max-width: 767px) {
    .product-mobile-menu-container {
        display: block;
    }
}

/* ===== SCROLLBAR STYLING ===== */

.product-mobile-menu::-webkit-scrollbar {
    width: 4px;
}

.product-mobile-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.product-mobile-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.product-mobile-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== ANIMATION ENHANCEMENTS ===== */

.product-mobile-menu-list li {
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInLeft 0.3s ease forwards;
}

.product-mobile-menu-list li:nth-child(1) { animation-delay: 0.1s; }
.product-mobile-menu-list li:nth-child(2) { animation-delay: 0.15s; }
.product-mobile-menu-list li:nth-child(3) { animation-delay: 0.2s; }
.product-mobile-menu-list li:nth-child(4) { animation-delay: 0.25s; }
.product-mobile-menu-list li:nth-child(5) { animation-delay: 0.3s; }
.product-mobile-menu-list li:nth-child(6) { animation-delay: 0.35s; }
.product-mobile-menu-list li:nth-child(7) { animation-delay: 0.4s; }
.product-mobile-menu-list li:nth-child(8) { animation-delay: 0.45s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ERROR MESSAGE STYLING ===== */

.mobile-menu-error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-size: 14px;
    text-align: center;
}

/* ===== ACCESSIBILITY ===== */

.product-mobile-menu-toggle:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.product-mobile-menu-list a:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */

@media (prefers-contrast: high) {
    .product-mobile-menu {
        border: 2px solid #000;
    }
    
    .product-mobile-menu-list a {
        border-bottom: 1px solid #000;
    }
    
    .submenu {
        border-left: 3px solid #000;
    }
}

/* ===== REDUCED MOTION SUPPORT ===== */

@media (prefers-reduced-motion: reduce) {
    .product-mobile-menu,
    .product-mobile-menu-toggle,
    .hamburger-line,
    .dropdown-arrow,
    .submenu,
    .product-mobile-menu-list li {
        transition: none;
        animation: none;
    }
}
