/**
 * ShopXO 风格商城模板 - 统一样式文件
 * 仿照 ShopXO 设计风格
 */

/* ==================== 颜色变量 ==================== */
:root {
    /* 主色调 - ShopXO 风格 */
    --shopxo-primary: #ff6c37;
    --shopxo-primary-dark: #e55a2b;
    --shopxo-primary-light: #ff8c5a;
    
    /* 辅助色 */
    --shopxo-success: #52c41a;
    --shopxo-warning: #faad14;
    --shopxo-danger: #ff4d4f;
    --shopxo-info: #1890ff;
    
    /* 中性色 */
    --shopxo-text-primary: #333333;
    --shopxo-text-secondary: #666666;
    --shopxo-text-disabled: #999999;
    --shopxo-border: #e8e8e8;
    --shopxo-bg: #f5f5f5;
    --shopxo-bg-light: #fafafa;
    --shopxo-white: #ffffff;
    
    /* 阴影 */
    --shopxo-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shopxo-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shopxo-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    
    /* 圆角 */
    --shopxo-radius-sm: 4px;
    --shopxo-radius-md: 8px;
    --shopxo-radius-lg: 12px;
    
    /* 间距 */
    --shopxo-spacing-xs: 8px;
    --shopxo-spacing-sm: 12px;
    --shopxo-spacing-md: 16px;
    --shopxo-spacing-lg: 24px;
    --shopxo-spacing-xl: 32px;
}

/* ==================== 基础样式 ==================== */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--shopxo-text-primary);
    background-color: var(--shopxo-bg);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--shopxo-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--shopxo-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==================== 容器 ==================== */
.shopxo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--shopxo-spacing-md);
}

@media (max-width: 768px) {
    .shopxo-container {
        padding: 0 var(--shopxo-spacing-sm);
    }
}

/* ==================== 头部导航 ==================== */
.shopxo-header {
    background: var(--shopxo-white);
    box-shadow: var(--shopxo-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.shopxo-header-top {
    background: var(--shopxo-bg-light);
    padding: var(--shopxo-spacing-sm) 0;
    border-bottom: 1px solid var(--shopxo-border);
}

.shopxo-header-main {
    padding: var(--shopxo-spacing-md) 0;
}

.shopxo-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--shopxo-primary);
    display: flex;
    align-items: center;
    gap: var(--shopxo-spacing-sm);
}

.shopxo-logo img {
    height: 40px;
}

.shopxo-search-box {
    position: relative;
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}

.shopxo-search-input {
    width: 100%;
    height: 40px;
    padding: 0 50px 0 16px;
    border: 2px solid var(--shopxo-primary);
    border-radius: var(--shopxo-radius-md);
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.shopxo-search-input:focus {
    border-color: var(--shopxo-primary-dark);
}

.shopxo-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    padding: 0 20px;
    background: var(--shopxo-primary);
    color: var(--shopxo-white);
    border: none;
    border-radius: var(--shopxo-radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.shopxo-search-btn:hover {
    background: var(--shopxo-primary-dark);
}

.shopxo-header-actions {
    display: flex;
    align-items: center;
    gap: var(--shopxo-spacing-md);
}

.shopxo-cart-btn {
    position: relative;
    padding: var(--shopxo-spacing-sm) var(--shopxo-spacing-md);
    background: var(--shopxo-bg-light);
    border-radius: var(--shopxo-radius-md);
    color: var(--shopxo-text-primary);
    display: flex;
    align-items: center;
    gap: var(--shopxo-spacing-xs);
    transition: background 0.3s ease;
}

.shopxo-cart-btn:hover {
    background: var(--shopxo-border);
}

.shopxo-cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--shopxo-danger);
    color: var(--shopxo-white);
    border-radius: 9px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 导航菜单 ==================== */
.shopxo-nav {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #4a5568 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.shopxo-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0.5;
}

.shopxo-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 108, 55, 0.5), transparent);
}

.shopxo-nav-container {
    position: relative;
    z-index: 1;
}

.shopxo-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.shopxo-nav-item {
    position: relative;
}

.shopxo-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    border-radius: 10px;
    margin: 6px 2px;
    overflow: hidden;
}

.shopxo-nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 10px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.shopxo-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--shopxo-primary), transparent);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.shopxo-nav-link:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.shopxo-nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

.shopxo-nav-link i {
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.shopxo-nav-link:hover i {
    transform: scale(1.15) rotate(5deg);
    color: var(--shopxo-primary);
    filter: drop-shadow(0 0 4px rgba(255, 108, 55, 0.5));
}

.shopxo-nav-link span {
    display: inline-block;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.shopxo-nav-link:hover span {
    transform: translateX(2px);
}

.shopxo-nav-link:hover {
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 108, 55, 0.2);
}

.shopxo-nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 108, 55, 0.25) 0%, rgba(255, 108, 55, 0.15) 100%);
    box-shadow: 0 4px 16px rgba(255, 108, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 108, 55, 0.3);
}

.shopxo-nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
    background: linear-gradient(90deg, transparent, var(--shopxo-primary), transparent);
}

.shopxo-nav-link.active i {
    color: var(--shopxo-primary);
    filter: drop-shadow(0 0 6px rgba(255, 108, 55, 0.6));
}

/* 移动端菜单按钮 */
.shopxo-nav-toggle {
    display: none;
    position: absolute;
    right: var(--shopxo-spacing-md);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    transition: all 0.3s ease;
}

.shopxo-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .shopxo-nav-container {
        position: relative;
    }
    
    .shopxo-nav-toggle {
        display: block;
    }
    
    .shopxo-nav-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        z-index: 100;
    }
    
    .shopxo-nav-list.mobile-open {
        max-height: 500px;
        opacity: 1;
        padding: 8px 0;
    }
    
    .shopxo-nav-item {
        margin: 0;
        width: 100%;
    }
    
    .shopxo-nav-link {
        padding: 16px 24px;
        justify-content: flex-start;
        border-radius: 0;
        margin: 0;
        border-left: 4px solid transparent;
    }
    
    .shopxo-nav-link::before {
        display: none;
    }
    
    .shopxo-nav-link:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.1);
        border-left-color: rgba(255, 255, 255, 0.3);
    }
    
    .shopxo-nav-link.active {
        background: rgba(255, 108, 55, 0.2);
        border-left-color: var(--shopxo-primary);
        box-shadow: none;
    }
    
    .shopxo-nav-link.active::after {
        display: none;
    }
    
    .shopxo-nav-link i {
        width: 24px;
        text-align: center;
    }
}

/* 平板响应式 */
@media (min-width: 769px) and (max-width: 1024px) {
    .shopxo-nav-link {
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .shopxo-nav-link i {
        font-size: 16px;
    }
}

/* ==================== 轮播图 ==================== */
.shopxo-banner {
    margin: var(--shopxo-spacing-lg) 0;
}

.shopxo-banner-item {
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: var(--shopxo-radius-lg);
    overflow: hidden;
    position: relative;
}

.shopxo-banner-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
}

@media (max-width: 768px) {
    .shopxo-banner-item {
        height: 200px;
    }
}

/* ==================== 分类导航 ==================== */
.shopxo-category-section {
    background: var(--shopxo-white);
    border-radius: var(--shopxo-radius-lg);
    padding: var(--shopxo-spacing-lg);
    margin: var(--shopxo-spacing-lg) 0;
    box-shadow: var(--shopxo-shadow-sm);
}

.shopxo-section-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--shopxo-text-primary);
    margin-bottom: var(--shopxo-spacing-lg);
    padding-bottom: var(--shopxo-spacing-sm);
    border-bottom: 2px solid var(--shopxo-primary);
    display: flex;
    align-items: center;
    gap: var(--shopxo-spacing-sm);
}

.shopxo-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--shopxo-spacing-md);
}

.shopxo-category-item {
    text-align: center;
    padding: var(--shopxo-spacing-md);
    border-radius: var(--shopxo-radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.shopxo-category-item:hover {
    background: var(--shopxo-bg-light);
    transform: translateY(-4px);
}

.shopxo-category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--shopxo-spacing-sm);
    border-radius: var(--shopxo-radius-md);
    overflow: hidden;
    background: var(--shopxo-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shopxo-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shopxo-category-name {
    font-size: 14px;
    color: var(--shopxo-text-primary);
    margin: 0;
}

/* ==================== 商品卡片 ==================== */
.shopxo-goods-section {
    margin: var(--shopxo-spacing-lg) 0;
}

.shopxo-goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--shopxo-spacing-md);
}

@media (max-width: 768px) {
    .shopxo-goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--shopxo-spacing-sm);
    }
}

.shopxo-goods-item {
    background: var(--shopxo-white);
    border-radius: var(--shopxo-radius-md);
    overflow: hidden;
    box-shadow: var(--shopxo-shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.shopxo-goods-item:hover {
    box-shadow: var(--shopxo-shadow-md);
    transform: translateY(-4px);
}

.shopxo-goods-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: var(--shopxo-bg-light);
}

.shopxo-goods-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.shopxo-goods-item:hover .shopxo-goods-image img {
    transform: scale(1.05);
}

.shopxo-goods-badge {
    position: absolute;
    top: var(--shopxo-spacing-xs);
    left: var(--shopxo-spacing-xs);
    padding: 4px 8px;
    background: var(--shopxo-danger);
    color: var(--shopxo-white);
    border-radius: var(--shopxo-radius-sm);
    font-size: 12px;
    font-weight: bold;
}

.shopxo-goods-info {
    padding: var(--shopxo-spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shopxo-goods-title {
    font-size: 14px;
    color: var(--shopxo-text-primary);
    margin: 0 0 var(--shopxo-spacing-sm) 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.shopxo-goods-title a {
    color: inherit;
}

.shopxo-goods-title a:hover {
    color: var(--shopxo-primary);
}

.shopxo-goods-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: var(--shopxo-spacing-xs);
}

.shopxo-goods-price-current {
    font-size: 20px;
    font-weight: bold;
    color: var(--shopxo-danger);
}

.shopxo-goods-price-current::before {
    content: '¥';
    font-size: 14px;
}

.shopxo-goods-price-original {
    font-size: 12px;
    color: var(--shopxo-text-disabled);
    text-decoration: line-through;
}

.shopxo-goods-sales {
    font-size: 12px;
    color: var(--shopxo-text-secondary);
    margin-top: var(--shopxo-spacing-xs);
}

/* ==================== 按钮 ==================== */
.shopxo-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--shopxo-radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.shopxo-btn-primary {
    background: var(--shopxo-primary);
    color: var(--shopxo-white);
}

.shopxo-btn-primary:hover {
    background: var(--shopxo-primary-dark);
    color: var(--shopxo-white);
}

.shopxo-btn-block {
    display: block;
    width: 100%;
}

/* ==================== 页脚 ==================== */
.shopxo-footer {
    background: var(--shopxo-white);
    margin-top: var(--shopxo-spacing-xl);
    padding: var(--shopxo-spacing-xl) 0;
    border-top: 1px solid var(--shopxo-border);
}

.shopxo-footer-content {
    text-align: center;
    color: var(--shopxo-text-secondary);
    font-size: 14px;
}

.shopxo-footer-links {
    display: flex;
    justify-content: center;
    gap: var(--shopxo-spacing-lg);
    margin-bottom: var(--shopxo-spacing-md);
    flex-wrap: wrap;
}

.shopxo-footer-links a {
    color: var(--shopxo-text-secondary);
}

.shopxo-footer-links a:hover {
    color: var(--shopxo-primary);
}

/* ==================== 工具类 ==================== */
.shopxo-text-center {
    text-align: center;
}

.shopxo-mt-sm {
    margin-top: var(--shopxo-spacing-sm);
}

.shopxo-mt-md {
    margin-top: var(--shopxo-spacing-md);
}

.shopxo-mt-lg {
    margin-top: var(--shopxo-spacing-lg);
}

.shopxo-mb-sm {
    margin-bottom: var(--shopxo-spacing-sm);
}

.shopxo-mb-md {
    margin-bottom: var(--shopxo-spacing-md);
}

.shopxo-mb-lg {
    margin-bottom: var(--shopxo-spacing-lg);
}

