/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* 嵌入式页面样式调整 */
.container-fluid {
    padding-top: 0;
}

main.container-fluid {
    padding-top: 20px;
}

/* Hero Section 渐变背景 */
.hero-section {
    background: #667eea; /* 备用背景色 */
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 200px; /* 确保有足够高度 */
}

/* 确保Hero Section文字颜色 */
.hero-section h1,
.hero-section p,
.hero-section {
    color: white !important;
}

/* 添加文字阴影增强可读性 */
.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-section p.lead {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 商品卡片样式 */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

/* 商品图片容器样式 */
.product-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 改为contain确保图片完整显示 */
    object-position: center;
    transition: transform 0.3s ease;
    background-color: #fff;
}

/* 悬停时的缩放效果 */
.product-card:hover .product-image {
    transform: scale(1.05);
}

/* 如果希望图片充满容器（可能裁剪），可以使用这个类 */
.product-image.cover-mode {
    object-fit: cover;
}

/* 图片模式切换按钮 */
.image-mode-toggle {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.product-image-container:hover .image-mode-toggle {
    opacity: 1;
}

/* 加载失败时的样式 */
.product-image[src*="placeholder"] {
    background-color: #e9ecef;
    color: #6c757d;
}

/* 图片加载中的样式 */
.product-image-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

/* 图片加载完成后隐藏加载动画 */
.product-image-container:has(.product-image.loaded)::before,
.product-image-container.loaded::before {
    display: none;
}

/* 价格样式 */
.price-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

/* 品牌筛选容器 */
.brand-filter-container {
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 10px;
    background-color: #f8f9fa;
}

/* 搜索框样式 */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 搜索按钮样式 */
.search-btn {
    background: linear-gradient(45deg, #ffc107, #ff8c00) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(45deg, #ff8c00, #ffc107) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* 按钮悬停效果 */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 粘性侧边栏 */
.sticky-top {
    z-index: 1020;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0 !important;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 移动端图片容器调整 */
    .product-image-container {
        height: 180px; /* 移动端稍微减小高度 */
    }
    
    /* 移动端隐藏图片模式切换按钮 */
    .image-mode-toggle {
        display: none;
    }
}

@media (max-width: 576px) {
    .product-image-container {
        height: 160px; /* 小屏幕进一步减小高度 */
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 功能特色图标 */
.feature-icon {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: inline-block;
    color: white;
}

/* 商品信息区域 */
.product-info {
    font-size: 0.9rem;
}

.product-info .badge {
    font-size: 0.75rem;
}

/* 优惠券样式 */
.coupon-info {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 0.375rem;
    padding: 8px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.coupon-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #28a745, #20c997);
}

/* 最终价格突出显示 */
.final-price {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 价格信息样式（无优惠券时） */
.price-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 0.375rem;
    padding: 6px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 推荐理由样式 */
.recommend-reason {
    background-color: #e7f3ff;
    border-left: 3px solid #007bff;
    padding: 5px 8px;
    border-radius: 0 0.25rem 0.25rem 0;
}

/* 服务信息样式 */
.services-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 100%);
    border: 1px solid #90caf9;
    border-radius: 0.375rem;
    padding: 10px 12px;
    margin-top: 8px;
    border-left: 4px solid #28a745;
}

.services-list {
    font-size: 0.85rem;
    line-height: 1.4;
}

.service-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3px;
}

.service-text {
    color: #495057;
    font-weight: 500;
    display: block;
    word-break: break-word;
}

.service-item .fas.fa-check-circle {
    color: #28a745 !important;
    margin-top: 2px;
    flex-shrink: 0;
}

.service-item .fas.fa-plus-circle {
    color: #6c757d !important;
    margin-top: 2px;
    flex-shrink: 0;
}

/* 移动端搜索框样式 */
.mobile-search-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.mobile-search-form {
    margin: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 3px;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.mobile-search-input {
    border: none;
    background: transparent;
    outline: none;
    box-shadow: none;
    padding: 12px 16px;
    font-size: 1rem;
    flex: 1;
}

.mobile-search-input:focus {
    border: none;
    box-shadow: none;
    background: transparent;
}

.mobile-search-input::placeholder {
    color: #6c757d;
    font-size: 0.9rem;
}

.mobile-search-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ff9500 100%);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.mobile-search-btn:hover {
    background: linear-gradient(135deg, #ff9500 0%, #e8890b 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
}

.mobile-search-btn:active {
    transform: scale(0.98);
}

.mobile-search-btn i {
    font-size: 1rem;
}

/* 移动端筛选器折叠样式 */
.filter-toggle-btn {
    border-radius: 0.375rem;
    position: relative;
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.filter-chevron {
    transition: transform 0.3s ease;
}

.filter-toggle-btn[aria-expanded="true"] .filter-chevron {
    transform: rotate(180deg);
}

.filter-toggle-btn[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 移动端筛选器内容样式 */
#mobileFilterCollapse,
#searchFilterCollapse {
    border-top: none;
}

#mobileFilterCollapse .card-body,
#searchFilterCollapse .card-body {
    border: 1px solid #007bff;
    border-top: none;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    background: #f8f9fa;
}

/* 手机端响应式调整 */
@media (max-width: 768px) {
    /* Hero Section 手机端优化 */
    .hero-section {
        min-height: 150px;
        padding: 20px 15px;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .hero-section p.lead {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    /* 搜索框手机端优化 */
    .search-container {
        padding: 15px;
    }
    
    /* 首页搜索框手机端样式 */
    #heroSearchForm {
        display: block !important;
    }
    
    #heroSearchForm .form-control-lg {
        margin-bottom: 12px !important;
        margin-right: 0 !important;
        padding: 14px 20px;
        font-size: 1rem;
        border: 2px solid #e9ecef;
        transition: all 0.3s ease;
    }
    
    #heroSearchForm .form-control-lg:focus {
        border-color: #ffc107;
        box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    }
    
    #heroSearchForm .search-btn {
        width: 100%;
        padding: 14px;
        font-size: 1.1rem;
        font-weight: 600;
        min-width: auto;
        background: linear-gradient(135deg, #ffc107 0%, #ff9500 100%);
        border: none;
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
        transition: all 0.3s ease;
    }
    
    #heroSearchForm .search-btn:hover {
        background: linear-gradient(135deg, #ff9500 0%, #e8890b 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(255, 149, 0, 0.4);
    }
    
    /* 筛选器手机端优化 */
    .filter-section {
        margin: 10px 0;
    }
    
    .filter-section .card-header {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .filter-section .card-body {
        padding: 15px;
    }
    
    /* 移动端筛选器按钮优化 */
    .filter-toggle-btn {
        font-size: 0.9rem;
        padding: 12px 16px;
        margin-bottom: 0;
    }
    
    .filter-toggle-btn .fas {
        font-size: 0.85rem;
    }
    
    /* 品牌筛选优化 */
    .brand-filter-container {
        max-height: 120px;
        overflow-y: auto;
    }
    
    .form-check {
        margin-bottom: 8px;
        padding-left: 1.2em;
    }
    
    .form-check-label {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* 价格区间手机端优化 */
    .price-range-options .form-check {
        margin-bottom: 6px;
    }
    
    /* 商品卡片手机端优化 */
    .product-card {
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .product-card .card-body {
        padding: 12px;
    }
    
    .product-card .row {
        margin: 0;
    }
    
    .product-card .col-md-3,
    .product-card .col-md-9 {
        padding: 5px;
    }
    
    /* 商品图片手机端优化 */
    .product-image-container {
        height: 120px;
        margin-bottom: 10px;
    }
    
    .image-mode-toggle {
        display: none; /* 手机端隐藏图片模式切换 */
    }
    
    /* 商品信息手机端优化 */
    .product-info h6 {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .brand-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    /* 价格信息手机端优化 */
    .price-section {
        margin: 8px 0;
    }
    
    .original-price {
        font-size: 0.8rem;
    }
    
    .current-price {
        font-size: 1.1rem;
        font-weight: bold;
    }
    
    /* 优惠券信息手机端优化 */
    .coupon-info,
    .price-info {
        padding: 6px 10px;
        margin: 6px 0;
        font-size: 0.8rem;
    }
    
    .final-price {
        font-size: 0.85rem;
        font-weight: bold;
    }
    
    /* 服务信息手机端优化 */
    .services-info {
        padding: 8px 10px;
        margin-top: 6px;
    }
    
    .service-text {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .service-item {
        margin-bottom: 2px;
    }
    
    /* 商品详情手机端优化 */
    .product-details {
        font-size: 0.8rem;
    }
    
    .product-details .text-muted {
        font-size: 0.75rem;
    }
    
    /* 购买按钮手机端优化 */
    .btn-primary {
        padding: 8px 16px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    /* 分页手机端优化 */
    .pagination {
        justify-content: center;
        margin: 20px 0;
    }
    
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    /* 排序下拉框手机端优化 */
    .sort-section select {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    /* 搜索结果头部手机端优化 */
    .search-header {
        padding: 10px 15px;
        margin-bottom: 15px;
    }
    
    .search-header h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
}

/* 超小屏幕优化 (小于576px) */
@media (max-width: 576px) {
    /* 容器内边距调整 */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hero Section 超小屏优化 */
    .hero-section {
        min-height: 120px;
        padding: 15px 10px;
    }
    
    .hero-section h1 {
        font-size: 1.3rem;
    }
    
    .hero-section p.lead {
        font-size: 0.85rem;
    }
    
    /* 商品图片超小屏优化 */
    .product-image-container {
        height: 100px;
    }
    
    /* 商品信息超小屏优化 */
    .product-info h6 {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    /* 价格信息超小屏优化 */
    .current-price {
        font-size: 1rem;
    }
    
    /* 服务信息超小屏优化 */
    .service-text {
        font-size: 0.7rem;
    }
    
    /* 筛选器超小屏优化 */
    .filter-section {
        padding: 10px;
        margin: 8px 0;
    }
    
    .brand-filter-container {
        max-height: 100px;
    }
    
    /* 按钮超小屏优化 */
    .btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    /* 搜索框超小屏优化 */
    .form-control {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    /* 移动端搜索框超小屏优化 */
    .mobile-search-input {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .mobile-search-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .search-input-wrapper {
        padding: 2px;
    }
    
    /* 首页搜索框超小屏优化 */
    #heroSearchForm .form-control-lg {
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
    }
    
    #heroSearchForm .search-btn {
        padding: 12px !important;
        font-size: 1rem !important;
    }
}

/* 分页样式 */
.pagination .page-link {
    color: #007bff;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* 卡片头部样式 */
.card-header {
    font-weight: 600;
}

/* 表单控件间距 */
.form-check {
    padding-left: 1.5em;
}

.form-check-label {
    cursor: pointer;
}

/* 无结果页面样式 */
.text-center i {
    opacity: 0.3;
}

/* 滚动条样式 */
.brand-filter-container::-webkit-scrollbar {
    width: 6px;
}

.brand-filter-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.brand-filter-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.brand-filter-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 