/*
Theme Name: 成人主题
Theme URI: https://example.com
Author: Developer
Author URI: https://example.com
Description: 移动端WooCommerce主题，包含热门推荐、已购买、已收藏功能
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chengren
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: white;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* 顶部标签区域 */
.top-header {
    background: url('assets/images/top_bg1.png') center/cover no-repeat;
    padding: 10px 15px;
}

/* 分类横向滚动 */
.category-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    padding: 6px 12px;
    background: transparent;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-item.active,
.category-item:hover {
    background: #e74c3c;
    color: white;
}

/* 搜索区域 */
.search-area {
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    padding: 8px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    cursor: pointer;
}

/* 左侧悬浮按钮 */
.side-float-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 8px;
    border-radius: 0 10px 10px 0;
    writing-mode: vertical-lr;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    text-decoration: none;
    letter-spacing: 2px;
}

.side-float-btn:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
}

/* 内容区域 */
.main-content {
    padding: 8px;
    min-height: calc(100vh - 200px);
}

/* 产品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.product-card {
    background: transparent;
    overflow: hidden;
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-card {
    cursor: pointer;
}

.product-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.product-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0,0,0,0.5);
}

.video-duration {
    color: white;
    font-size: 11px;
}

.product-fav {
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.product-fav.favorited {
    color: #e74c3c;
}

.product-info {
    padding: 8px;
}

.product-title {
    font-size: 13px;
    font-weight: normal;
    color: #333;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    height: 2.8em;
}

.product-price {
    color: #f5576c;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
}

.product-price del {
    color: #999;
    font-size: 11px;
    margin-left: 5px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state img {
    width: 120px;
    margin-bottom: 20px;
}

.empty-state .icon {
    font-size: 80px;
    color: #667eea;
    margin-bottom: 20px;
}

.empty-state p {
    color: #f5576c;
    font-size: 14px;
    cursor: pointer;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: url('assets/images/top_bg1.png') center/cover no-repeat;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    text-decoration: none;
    color: white;
    font-size: 14px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-item span {
    padding: 6px 16px;
    border-radius: 15px;
    transition: all 0.3s;
}

.nav-item.active span {
    background: #e74c3c;
    color: white;
}

/* 登录提示弹窗 */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.login-modal.show {
    display: flex;
}

.login-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.login-modal-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.login-modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.login-btn {
    display: inline-block;
    padding: 12px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin-right: 10px;
}

.cancel-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #eee;
    color: #666;
    text-decoration: none;
    border-radius: 25px;
    border: none;
    cursor: pointer;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 分类筛选样式 */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* WooCommerce覆盖样式 */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.woocommerce ul.products li.product {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0;
    width: 100%;
    float: none;
}

.woocommerce ul.products li.product a img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    margin: 0;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px;
    padding: 10px 10px 5px;
}

.woocommerce ul.products li.product .price {
    color: #f5576c;
    padding: 0 10px 10px;
}

/* 移除产品列表所有链接下划线 */
.woocommerce ul.products li.product a {
    text-decoration: none;
}

.woocommerce ul.products li.product a:hover {
    text-decoration: none;
}

.product-title,
.product-price,
.product-title a,
.product-price a {
    text-decoration: none !important;
}

/* 全局移除产品相关链接下划线 */
.products-grid a,
.product-card a,
.woocommerce-loop-product__title,
.woocommerce-Price-amount {
    text-decoration: none !important;
}

/* 分类侧边栏 */
.category-sidebar {
    display: none;
}

.category-sidebar.show {
    display: block;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}

.sidebar-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 80%;
    height: 100%;
    background: white;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.sidebar-tag-btn {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    background: #f5f5f5;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-tag-btn:hover,
.sidebar-tag-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

#categoryToggleBtn {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 响应式 */
@media (min-width: 768px) {
    .products-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(4, 1fr);
    }
}
