/**
 * 手机端分类抽屉样式
 * 参考theresanaiforthat.com的分类抽屉设计
 */

/* 手机端分类按钮容器 */
.mobile-category-button-container {
    display: none; /* 默认隐藏，只在移动端显示 */
    width: 100%;
    margin: 20px 0;
    padding: 0 0px;
}

/* 手机端分类按钮 */
.mobile-category-button {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.mobile-category-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.mobile-category-button:active {
    transform: translateY(0);
}

.mobile-category-button .button-text {
    flex: 1;
    text-align: left;
    font-size: 14px;
}

.mobile-category-button .button-icon {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.mobile-category-button.active .button-icon {
    transform: rotate(90deg);
}

/* 分类抽屉 */
.mobile-category-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-category-drawer.active {
    visibility: visible;
    opacity: 1;
}

/* 抽屉遮罩层 */
.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* 抽屉内容 */
.drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-category-drawer.active .drawer-content {
    transform: translateX(0);
}

/* 抽屉头部 */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #E5E7EB;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.drawer-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F3F4F6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-close:hover {
    background: #E5E7EB;
}

.drawer-close i {
    font-size: 14px;
    color: #6B7280;
}

/* 抽屉主体 */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* 分类列表 */
.drawer-category-list {
    padding: 0;
}

/* 分类项 */
.drawer-category-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.drawer-category-item:hover {
    background: #F9FAFB;
}

.drawer-category-item.active {
    background: #EEF2FF;
    border-right: 3px solid #8B5CF6;
}

/* 分类图标容器 */
.drawer-category-item .icon-container {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.drawer-category-item .icon-container i,
.drawer-category-item .icon-container svg {
    font-size: 16px;
    color: white;
}

/* 分类名称 */
.drawer-category-item .category-name {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    line-height: 1.2;
}

.drawer-category-item.active .category-name {
    font-weight: 600;
    color: #8B5CF6;
}

/* 移动端显示规则 */
@media (max-width: 768px) {
    /* 显示手机端分类按钮 */
    .mobile-category-button-container {
        display: block;
    }
    
    /* 隐藏桌面端分类标签 */
    .desktop-categories {
        display: none !important;
    }
}

/* 桌面端隐藏手机端组件 */
@media (min-width: 769px) {
    .mobile-category-button-container,
    .mobile-category-drawer {
        display: none !important;
    }
}

/* 防止页面滚动（当抽屉打开时） */
body.drawer-open {
    overflow: hidden;
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .drawer-content {
        width: 280px;
        max-width: 90vw;
    }
    
    .drawer-header {
        padding: 16px 16px 12px;
    }
    
    .drawer-category-item {
        padding: 10px 16px;
    }
    
    .drawer-category-item .icon-container {
        width: 28px;
        height: 28px;
        margin-right: 10px;
    }
    
    .drawer-category-item .category-name {
        font-size: 15px;
    }
}
