
/* 全局样式 */
body {
    background-color: #f8f9fa;
    padding-top: 20px; /* 给固定导航栏留出空间 */
}

/* 添加下拉表单样式 */
#suggestion-dropdown {
    max-height: 300px;
    overflow-y: auto;
	z-index: 1100;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
}

#suggestion-list .list-group-item {
    border: none;
    border-bottom: 1px solid #f1f1f1;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.05rem;
}

#suggestion-list .list-group-item:hover {
    background-color: #f8f9fa;
}

#suggestion-list .list-group-item:last-child {
    border-bottom: none;
}
/* 修改搜索建议样式 */
#suggestion-placeholder {
    height: 50px;
    color: #495057; /* 浅灰色 */
	z-index: 3; /* 高于输入框 */
    pointer-events: none; /* 允许点击穿透到输入框 */
}

#current-suggestion {
    height: 100%;
    line-height: 50px; /* 与输入框高度匹配 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 确保输入框有透明背景 */
.search-input {
    background-color: transparent !important;
    position: relative;
    z-index: 2; /* 高于建议文本 */
}
/* Toast消息样式 */
.toast-custom {
	max-width: 350px;
	overflow: hidden;
	font-size: 0.875rem;
	background-clip: padding-box;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 0.25rem;
	box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
	display: none;
	position: relative;
	padding: 1rem;
	margin-bottom: 1rem;
}

.toast-header {
	display: flex;
	align-items: center;
	padding: 0.5rem 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	border-top-left-radius: calc(0.25rem - 1px);
	border-top-right-radius: calc(0.25rem - 1px);
}

.toast-body {
	padding: 1rem;
}

/* 不同状态的颜色 */
.toast-warning {
	background-color: #fff3cd;
	border-color: #ffecb5;
	color: #664d03;
}

.toast-success {
	background-color: #d1e7dd;
	border-color: #badbcc;
	color: #0f5132;
}

.toast-danger {
	background-color: #f8d7da;
	border-color: #f5c2c7;
	color: #842029;
}

.toast-info {
	background-color: #cff4fc;
	border-color: #b6effb;
	color: #055160;
}
/* 新增固定定位样式 */
.sticky-top-section {
    /* position: sticky; */
    top: 0px;
    z-index: 1020; /* 确保在导航栏下方 */
    background-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
/* 导航栏样式 */
.navbar-custom {
    background-color: #2c3e50;
    border-bottom: 3px solid #3498db;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ecf0f1 !important;
}

/* 内容容器 */
.content-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    margin: 10px auto;
}
/* 商品行样式 */
.product-row {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.product-row:hover {
     transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 图片样式 */
.product-img {
    height: 180px;
    object-fit: contain;
    padding: 1rem;
    border-right: 2px solid #dee2e6;
}

/* 商品信息 */
.product-info {
    padding: 1.5rem;
}

.price-tag {
    background: #f8d7da;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #721c24;
}

.product-info .button-group {
    margin-left: auto; /* 将按钮推到右侧 */
    padding: 0 15px 15px 0; /* 右下角留白 */
}
.btn-custom-blue {
    border-color: #007bff !important;
    min-width: 60px; /* 保持按钮宽度一致 */
}
.btn-custom-blue:hover {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
    min-width: 60px; /* 保持按钮宽度一致 */
}
/* 收藏按钮悬停效果 */
.btn-outline-secondary:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}
/* 按钮过渡动画 */
.btn {
    transition: all 0.3s ease;
    transform: scale(1);
}

.btn:active {
    transform: scale(0.95);
}

/* 图标旋转动画 */
.bi-star {
    transition: transform 0.3s ease;
}

.bi-star-fill {
    transition: transform 0.3s ease;
}

/* 收藏成功动画 */
@keyframes collect-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.btn-warning {
    animation: collect-success 0.3s ease-in-out;
}

/* 新增/修改的CSS样式 */
.search-section {
    max-width: 1200px;  /* 限制最大宽度 */
    margin: 0 auto 20px; /* 上下边距 + 水平居中 */
    padding: 15px 25px;
    background: #ffffff;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.search-container {
    width: 100%;
    gap: 15px;  /* 元素间距 */
}

.logo-wrapper {
    flex-shrink: 0;  /* 防止logo被压缩 */
}

.logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    transition: transform 0.3s;
}

.logo-img:hover {
    transform: scale(1.08);
}
/* 确保输入组正确显示 */
.input-group {
    position: relative;
}
.search-input {
    height: 50px;
    border:solid  var(--gold) !important;;
    background: #f8f9fa;
    border-radius: 25px 0 0 25px;
    padding-left: 57px;
    font-size: 1.05rem;
    transition: all 0.3s;
}

.search-input:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.search-btn {
    right: 0; /* 改为0而不是5px */
    top: 50%; /* 改为0而不是50% */
    height: 100%; /* 确保按钮高度与输入框一致 */
    transform: none; /* 移除translateY变换 */
    border-radius: 0 25px 25px 0; /* 只圆角右侧 */
    padding: 13px 20px; /* 调整内边距 */
    display: flex;
    align-items: center;
    justify-content: center;
}


/* 智能搜索提示 */
.search-tips {
  font-size: 0.9em;
  color: #6c757d;
  margin-top: 5px;
}


.spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

/* 结束提示样式 */
#end-of-results {
    font-size: 1.1rem;
    border-top: 1px solid #dee2e6;
    margin-top: 1rem;
}

/* 商品列表动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-row {
    animation: fadeIn 0.5s ease-out;
}

/* 商品卡片样式 */
.product-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 25px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* 调整图片样式 */
.product-card .product-img {
    height: 250px;
    width: 100%;
    object-fit: contain;
    padding: 15px;
    border-bottom: 1px solid #eee;
    border-right: none;
}

/* 卡片标题 */
.product-card .card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 商品详情 */
.product-card .product-details {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

 /* 统一按钮样式 */
.btn-primary {
    background-color: var(--gold) !important;
    border-color: var(--gold) !important;
    color: white !important; /* 确保文字颜色与金色背景对比明显 */
}
.btn-outline-secondary {
    border-color: var(--gold) !important;
    color: var(--gold) !important;
}
.btn-warning {
    background-color: var(--gold) !important;
    border-color: var(--gold) !important;
    color: white !important;
}
/* 悬停效果优化 */
.btn-primary:hover,
.btn-warning:hover {
    background-color: #b8962f !important; /* 稍深的金色作为 hover 效果 */
    border-color: #b8962f !important;
}
.btn-outline-secondary:hover {
    background-color: var(--gold) !important;
    color: white !important;
}

/* 筛选栏输入框和选择框聚焦样式 */
.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: #ffecb5; /* 淡黄色边框 */
    box-shadow: 0 0 0 0.25rem rgba(255, 236, 181, 0.5); /* 淡黄色背景光 */
}
/* 增大收藏按钮 */
.product-card .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}
/* 筛选区域样式 */
.filter-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
}

.filter-section:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.filter-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.filter-toggle {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.filter-toggle:hover {
    background: rgba(212, 175, 55, 0.7);
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.filter-group {
    margin-bottom: 0.5rem;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #555;
    padding-left: 0.2rem;
}

.form-control, .form-select {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    height: auto;
    transition: all 0.2s;
    box-shadow: none !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
}

.form-control::placeholder {
    color: #aaa;
    font-size: 0.9rem;
}

.input-group {
    border-radius: 8px;
}

.input-group .form-control {
    border-radius: 8px 0 0 8px !important;
}

.input-group-text {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #777;
    font-size: 0.9rem;
    padding: 0.65rem 0.75rem;
}

.range-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.range-input-group .form-control {
    flex: 1;
}

.range-divider {
    color: #777;
    font-weight: 500;
}

.form-check {
    display: flex;
    align-items: center;
    padding-left: 0;
    margin-top: 1.8rem;
}

.form-check-input {
    width: 1.35em;
    height: 1.35em;
    margin-right: 0.6rem;
    margin-top: 0;
    border: 1px solid #ddd;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--gold);
    border-color: var(--dark-gold);
}

.form-check-label {
    font-size: 0.95rem;
    color: #444;
    cursor: pointer;
    font-weight: 500;
}

.filter-btn {
    background: var(--gold);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.8rem;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.filter-btn:hover {
    background: var(--light-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.filter-btn:active {
    transform: translateY(0);
}
#colorFilterSwitch{
    margin-left: 10px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.page-input {
    width: 50px; /* 缩小宽度 */
    height: 38px; /* 匹配按钮高度 */
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    text-align: center; /* 居中显示页码 */
}
@media (max-width: 767px) {
    /* 筛选栏初始隐藏 */
    .filter-section .filter-form {
        display: none;
    }

    /* 筛选栏展开状态 */
    .filter-section .filter-form.active {
        display: grid;
    }

    /* 调整筛选按钮样式 */
    .filter-toggle {
        width: 100%;
        padding: 0.75rem;
        background-color: var(--gold);
        color: white;
        border-radius: 8px;
        margin-top: 0.5rem;
    }

    /* 商品列表占满宽度，一行两个商品 */
    #product-list .col-12 {
        flex: 0 0 50%;
        max-width: 50%;
        padding-right: 8px;
        padding-left: 8px;
    }

    /* 调整商品卡片高度，确保一屏显示两行 */
    .product-card .product-img {
        height: 180px;
        width: 100%;
    }

    .product-card .card-body {
        padding: 0px;
    }

    .product-card .card-title {
        font-size: 1rem;
    }

    .product-card .product-details {
        font-size: 0.85rem;
        margin-left: 10px;
    }

    /* 移除侧边栏宽度占用 */
    .container {
        padding-left: 10px;
        padding-right: 10px;
        margin-left: auto;
        margin-right: auto;
    }
    .content-container{
        padding: 1rem 0rem;
    }

    /* 调整分页样式 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-item {
        margin: 0 2px;
    }
    .page-input {
        width: 40px; /* 进一步缩小移动端宽度 */
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}
