/* 永春特产商城 - 精美样式 */

/* 商城头部 */
.shop-header {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.shop-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.shop-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.shop-brand .back-link {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.shop-brand .back-link:hover {
    color: white;
    gap: 10px;
}

.shop-brand h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.shop-brand p {
    opacity: 0.9;
    font-size: 15px;
}

.shop-search {
    width: 400px;
}

.shop-search .search-box {
    position: relative;
    width: 100%;
}

.shop-search input {
    width: 100%;
    padding: 14px 24px;
    padding-right: 120px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    background: rgba(255,255,255,0.95);
    transition: var(--transition);
}

.shop-search input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.3);
}

.shop-search button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 24px;
    background: var(--gradient-warm);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.shop-search button:hover {
    transform: translateY(-50%) scale(1.02);
}

/* 商城导航 */
.shop-nav {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.shop-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-nav .nav-menu {
    display: flex;
}

.shop-nav .nav-menu li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 18px 24px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.shop-nav .nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transition: var(--transition);
}

.shop-nav .nav-menu li a:hover,
.shop-nav .nav-menu li.active a {
    color: var(--primary);
}

.shop-nav .nav-menu li a:hover::after,
.shop-nav .nav-menu li.active a::after {
    width: 50%;
}

.cart-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.cart-icon:hover {
    background: var(--primary);
    color: white;
}

.cart-icon .icon {
    font-size: 22px;
}

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

/* 商城主体 */
.shop-main {
    padding: 40px 0;
    background: var(--bg);
    min-height: calc(100vh - 300px);
}

.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* 左侧栏 */
.shop-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.category-list,
.price-filter,
.hot-products {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.category-list h3,
.price-filter h3,
.hot-products h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-list ul li {
    margin-bottom: 4px;
}

.category-list ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    transition: var(--transition);
}

.category-list ul li a:hover,
.category-list ul li.active a {
    background: rgba(26, 95, 42, 0.08);
    color: var(--primary);
}

.category-list .count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 12px;
}

/* 价格筛选 */
.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.price-range input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.price-range span {
    color: var(--text-muted);
}

.btn-filter {
    width: 100%;
    padding: 12px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 热销商品 */
.hot-product-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.hot-product-item:last-child {
    border-bottom: none;
}

.hot-product-item:hover {
    padding-left: 8px;
}

.hot-product-item img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.hot-product-info {
    flex: 1;
}

.hot-product-info h4 {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.hot-product-info .price {
    font-size: 15px;
    font-weight: 700;
    color: var(--warm);
}

/* 商品区域 */
.shop-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 筛选栏 */
.shop-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tabs span {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 20px;
    transition: var(--transition);
    font-weight: 500;
}

.filter-tabs span.active,
.filter-tabs span:hover {
    color: white;
    background: var(--primary);
}

.filter-options {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-options select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.result-count {
    font-size: 14px;
    color: var(--text-muted);
}

.result-count strong {
    color: var(--warm);
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: var(--gradient-warm);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.product-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

.product-actions button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.product-actions button:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.product-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: var(--warm);
}

.price-original {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-sales {
    font-size: 12px;
    color: var(--text-muted);
}

/* 购物车侧边栏 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    z-index: 10001;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.cart-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-cart:hover {
    background: var(--bg);
    color: var(--text);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: var(--transition);
}

.cart-item:hover {
    box-shadow: var(--shadow);
}

.cart-item img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.cart-item-info .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--warm);
    margin-bottom: 10px;
}

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

.quantity-control button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.quantity-control button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quantity-control span {
    font-size: 14px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.remove-item {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.remove-item:hover {
    color: var(--warm);
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.cart-empty .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.cart-empty p {
    font-size: 16px;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-total span {
    font-size: 14px;
    color: var(--text-light);
}

.cart-total .total-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--warm);
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: var(--gradient-warm);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(199, 91, 57, 0.3);
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(199, 91, 57, 0.4);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
}

.cart-overlay.open {
    display: block;
}

/* 响应式 */
@media (max-width: 1200px) {
    .shop-layout {
        grid-template-columns: 220px 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    
    .shop-sidebar {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .shop-header .container {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .shop-search {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .shop-nav .nav-menu {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}
