/* Amazon-Style Category Menu */
.amazon-category-wrapper {
    position: relative;
    display: inline-block;
}

.amazon-category-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ed5233 0%, #f16540 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(237, 82, 51, 0.2);
}

.amazon-category-trigger:hover {
    background: linear-gradient(135deg, #d94829 0%, #e05536 100%);
    box-shadow: 0 4px 8px rgba(237, 82, 51, 0.3);
    transform: translateY(-1px);
}

.amazon-category-trigger i {
    font-size: 18px;
}

/* Overlay */
.amazon-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.amazon-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Menu Panel */
.amazon-category-menu {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.amazon-category-menu.active {
    left: 0;
}

/* Menu Header */
.amazon-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ed5233 0%, #f16540 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(237, 82, 51, 0.15);
}

.amazon-menu-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.amazon-menu-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.amazon-menu-close:hover {
    opacity: 0.7;
}

/* Main Categories List */
.amazon-main-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.amazon-category-item {
    border-bottom: 1px solid #e7e7e7;
}

.amazon-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: #0f1111;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.amazon-category-link:hover {
    background: #fff5f2;
    color: #ed5233;
}

.amazon-category-link i {
    color: #565959;
    font-size: 12px;
}

/* Subcategory Panel */
.amazon-subcategory-panel {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100%;
    background: #fff;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.amazon-subcategory-panel.active {
    left: 350px;
}

/* Subcategory Header */
.amazon-submenu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f7f7f7;
    border-bottom: 1px solid #e7e7e7;
    position: sticky;
    top: 0;
    z-index: 10;
}

.amazon-back-btn {
    background: none;
    border: none;
    color: #0f1111;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.amazon-back-btn:hover {
    opacity: 0.7;
}

.amazon-submenu-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f1111;
}

/* Subcategories List */
.amazon-subcategories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.amazon-subcategory-item {
    border-bottom: 1px solid #e7e7e7;
}

.amazon-subcategory-link {
    display: block;
    padding: 14px 20px;
    color: #0f1111;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.amazon-subcategory-link:hover {
    background: #fff5f2;
    color: #ed5233;
}

/* View All Link */
.amazon-view-all {
    display: block;
    padding: 14px 20px;
    color: #ed5233;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: #fff5f2;
    border-bottom: 1px solid #e7e7e7;
}

.amazon-view-all:hover {
    color: #d94829;
    background: #ffe8e0;
    text-decoration: underline;
}

/* Scrollbar Styling */
.amazon-category-menu::-webkit-scrollbar,
.amazon-subcategory-panel::-webkit-scrollbar {
    width: 10px;
}

.amazon-category-menu::-webkit-scrollbar-track,
.amazon-subcategory-panel::-webkit-scrollbar-track {
    background: #f7f7f7;
    border-left: 1px solid #e7e7e7;
}

.amazon-category-menu::-webkit-scrollbar-thumb,
.amazon-subcategory-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
    border: 2px solid #f7f7f7;
}

.amazon-category-menu::-webkit-scrollbar-thumb:hover,
.amazon-subcategory-panel::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Firefox Scrollbar */
.amazon-category-menu,
.amazon-subcategory-panel {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f7f7f7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .amazon-category-menu,
    .amazon-subcategory-panel {
        width: 280px;
    }
    
    .amazon-subcategory-panel.active {
        left: 280px;
    }
    
    .amazon-category-trigger {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .amazon-category-trigger i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .amazon-category-menu,
    .amazon-subcategory-panel {
        width: 85vw;
        max-width: 320px;
    }
    
    .amazon-subcategory-panel.active {
        left: 85vw;
        max-width: 320px;
    }
}

/* Animation */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}
