/**
 * NearMeWigs Custom Theme Stylesheet
 * 专为假发电商设计的现代化主题
 */

/* ==================== 全局变量 ==================== */
:root {
    /* 主色调 - 优雅黑金配色 */
    --primary-color: #1a1a1a;
    --secondary-color: #d4af37;
    --accent-color: #c9a961;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;

    /* 字体 */
    --font-primary: 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Georgia', serif;

    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;

    /* 过渡 */
    --transition: all 0.3s ease;
}

/* ==================== 全局样式重置 ==================== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

/* ==================== 头部导航 ==================== */
#header {
    background: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 0;
    font-size: 13px;
}

.header-nav {
    padding: 15px 0;
}

/* Logo */
.logo {
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.03);
}

/* 主导航 */
#_desktop_top_menu {
    flex: 1;
}

#top-menu > li {
    margin: 0 20px;
}

#top-menu > li > a {
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

#top-menu > li > a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* ==================== 搜索框 ==================== */
#search_widget {
    position: relative;
}

#search_widget input[type="text"] {
    border-radius: 30px;
    border: 2px solid var(--border-color);
    padding: 12px 50px 12px 24px;
    width: 100%;
    transition: var(--transition);
    font-size: 14px;
}

#search_widget input[type="text"]:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

#search_widget button[type="submit"] {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#search_widget button[type="submit"]:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.05);
}

/* ==================== 购物车图标 ==================== */
.cart-preview {
    position: relative;
}

.blockcart {
    background: var(--secondary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    transition: var(--transition);
}

.blockcart:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.cart-products-count {
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* ==================== 首页横幅/轮播 ==================== */
#carousel {
    margin-bottom: var(--spacing-xl);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

.carousel-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    min-height: 400px;
}

.carousel-caption {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 40px;
    bottom: 0;
    left: 0;
    right: 0;
}

.carousel-caption h3 {
    font-size: 42px;
    color: #fff;
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

/* ==================== 产品网格 ==================== */
#products,
.featured-products,
.product-miniature {
    margin-bottom: var(--spacing-lg);
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* 产品卡片 */
.product-miniature {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    position: relative;
}

.product-miniature:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 35px rgba(0,0,0,0.12);
}

/* 产品图片容器 */
.product-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-light);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-miniature:hover .product-thumbnail img {
    transform: scale(1.15);
}

/* 产品标签 */
.product-flags {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-flag {
    background: var(--secondary-color);
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-flag.new {
    background: #4CAF50;
}

.product-flag.on-sale {
    background: #f44336;
}

.product-flag.discount {
    background: #ff9800;
}

/* 产品信息 */
.product-description {
    padding: 20px;
}

.product-title a {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: var(--transition);
}

.product-title a:hover {
    color: var(--secondary-color);
}

.product-price-and-shipping {
    margin: 15px 0;
}

.price {
    color: var(--secondary-color);
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.regular-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 16px;
    margin-left: 10px;
}

.discount-percentage {
    background: #ff5252;
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* 快速查看/添加购物车按钮 */
.product-add-cart {
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.product-miniature:hover .product-add-cart {
    opacity: 1;
    transform: translateY(0);
}

.add-to-cart,
.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    border: none;
    color: #fff;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    cursor: pointer;
    font-size: 14px;
}

.add-to-cart:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.4);
}

/* ==================== 分类列表页 ==================== */
.category-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c2c2c 100%);
    color: #fff;
    padding: 60px 0;
    margin-bottom: var(--spacing-xl);
    border-radius: 15px;
    text-align: center;
}

.category-header h1 {
    font-size: 48px;
    color: #fff;
    margin-bottom: 15px;
}

.category-description {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    max-width: 800px;
    margin: 0 auto;
}

/* 筛选栏 */
#search_filters {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
}

.facet-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.facet label {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: var(--transition);
}

.facet label:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

/* ==================== 产品详情页 ==================== */
.product-cover {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    margin-bottom: var(--spacing-md);
}

.product-cover img {
    width: 100%;
    height: auto;
}

.product-images {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.product-images .thumb-container {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.product-images .thumb-container:hover,
.product-images .thumb-container.selected {
    border-color: var(--secondary-color);
}

.product-information {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
}

.product-information h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

.product-prices {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
}

.product-prices .current-price .price {
    font-size: 42px;
    color: var(--secondary-color);
}

.product-description-short {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-color);
    margin: 25px 0;
}

.product-variants {
    margin: 30px 0;
}

.product-variants select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
}

.product-variants select:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.product-add-to-cart {
    margin: 30px 0;
}

.product-quantity {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty input {
    width: 80px;
    padding: 10px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

/* ==================== 页脚 ==================== */
#footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a0a0a 100%);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 20px;
    margin-top: var(--spacing-xl);
}

.footer-container h3 {
    color: var(--secondary-color);
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-container a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 8px 0;
}

.footer-container a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 992px) {
    .products {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .category-header h1 {
        font-size: 36px;
    }

    .product-information h1 {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .carousel-item img {
        min-height: 250px;
    }

    .carousel-caption h3 {
        font-size: 28px;
    }

    .product-information {
        padding: 25px;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-miniature {
    animation: fadeInUp 0.6s ease-out;
}

/* ==================== 工具类 ==================== */
.section-title {
    font-size: 32px;
    text-align: center;
    margin: var(--spacing-xl) 0 var(--spacing-lg);
    position: relative;
    padding-bottom: 15px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--secondary-color);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: #fff;
}
