/**
 * 买家指南前台样式
 * 基于 Bootstrap 5
 */

.buyer-guide-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 进度条导航 */
.buyer-guide-progress-nav {
    margin-bottom: 2rem;
}

.progress-nav-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.progress-step-counter {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
}

.progress-step-counter .current-step {
    color: #20c997;
    font-weight: 600;
}

/* Bootstrap 5 Progress 组件样式覆盖 */
.buyer-guide-progress-nav .progress {
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.buyer-guide-progress-nav .progress-bar {
    background-color: #20c997 !important;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.progress-step {
    flex: 1;
    display: flex !important; /* 确保始终显示 */
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease;
    visibility: visible !important; /* 确保始终可见 */
}

/* 强制显示所有进度步骤，不能被隐藏 */
.buyer-guide-progress-nav .progress-step {
    display: flex !important;
    visibility: visible !important;
    opacity: 0.5;
}

.buyer-guide-progress-nav .progress-step.d-none {
    display: flex !important;
    visibility: visible !important;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
}

.step-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: #6c757d;
    transition: all 0.3s ease;
}

.progress-step.active .step-icon {
    background-color: #20c997;
    color: #ffffff;
}

.progress-step.completed .step-icon {
    background-color: #20c997;
    color: #ffffff;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: #6c757d;
    transition: color 0.3s ease;
}

.progress-step.active .step-label {
    color: #20c997;
}

.progress-step.completed .step-label {
    color: #20c997;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .progress-steps {
        gap: 5px;
    }
    
    .step-icon {
        width: 40px;
        height: 40px;
    }
    
    .step-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
}

/* 卡片样式 */
.buyer-guide-card {
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 2px solid var(--bs-border-color) !important;
    user-select: none;
    padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x);
}

/* 卡片图片样式 */
.buyer-guide-card-image {
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.buyer-guide-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.buyer-guide-card:hover .buyer-guide-card-image img {
    transform: scale(1.05);
}

/* 可点击的卡片 */
.buyer-guide-card.buyer-guide-selectable {
    cursor: pointer;
}

.buyer-guide-card.buyer-guide-selectable:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-color: #0d6efd;
}

.buyer-guide-card.selected {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

/* 选择提示 */
.buyer-guide-select-hint {
    color: #0d6efd;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.buyer-guide-selectable:hover .buyer-guide-select-hint {
    opacity: 1;
}

/* 步骤容器 */
.step-container {
    animation: fadeIn 0.3s ease-in;
}

/* PC端步骤卡片最大宽度限制 */
@media (min-width: 768px) {
    .step-container[data-step="category"] .row .col,
    .step-container[data-step="subcategory"] .row .col {
        max-width: 320px;
    }
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 产品网格 */
.products-grid .card {
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.products-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.products-grid .card-img-top {
    height: 200px;
    object-fit: contain;
    padding: 15px;
    background: #f8f9fa;
}

.products-grid .card-body {
    display: flex;
    flex-direction: column;
}

.products-grid .card-title {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.products-grid .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.products-grid .price {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-decoration: none;
}
.products-grid .price del {
    color: var(--bs-gray);
    font-size: 0.875rem;
}
.products-grid .price ins {
    text-decoration:none !important;
}

/* 变体选择样式 */

.products-grid .form-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* 产品图片容器 */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.products-grid .product-image {
    transition: opacity 0.3s ease;
}

/* 加入购物车按钮样式 */
.btn-add-to-cart {
    position: relative;
}

.btn-add-to-cart .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
}

.btn-add-to-cart.adding {
    pointer-events: none;
}

.btn-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 产品操作区域 */
.product-actions {
    margin-top: 0;
}

/* 加载和空状态 */
.buyer-guide-loading,
.buyer-guide-empty {
    padding: 40px 20px;
}

/* 步骤标题和导航栏 */
.buyer-guide-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    min-height: 60px;
}

.step-header-left {
    flex: 0 0 auto;
    width: 120px;
}

.step-header-center {
    flex: 1;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
}

.step-header-right {
    flex: 0 0 auto;
    width: 120px;
    text-align: right;
}

.step-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #000;
}

.step-indicator {
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
}

.step-indicator-current {
    color: #cfcfcf;
    font-weight: 700;
    font-size: 2.5rem;
}

.btn-back-header {
    border: 1px solid #20c997;
    background-color: #fff;
    color: #000;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-back-header:hover {
    background-color: #f8f9fa;
    border-color: #20c997;
    color: #000;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .buyer-guide-container {
        padding: 15px;
    }
    
    .buyer-guide-step-header {
        min-height: 50px;
        margin-bottom: 1.5rem;
    }
    
    .step-header-left,
    .step-header-right {
        width: 80px;
    }
    
    .step-title {
        font-size: 1.25rem;
    }
    
    .btn-back-header {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    .buyer-guide-card .card-body {
        padding: 1rem;
    }
    
    .products-grid .card-img-top {
        height: 150px;
    }
}

/* 手机端样式优化 (小于576px) */
@media (max-width: 575.98px) {
    .buyer-guide-container {
        padding: 10px;
    }
    
    /* 产品网格在手机端显示两个一行 */
    .products-grid .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .products-grid .row > [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .products-grid .card {
        margin-bottom: 10px;
    }
    
    .products-grid .card-img-top {
        height: 120px;
        padding: 10px;
    }
    
    .products-grid .card-body {
        padding: 0.75rem;
    }
    
    .products-grid .card-title {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
        line-height: 1.3;
        /* 限制标题显示行数 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 2.6em;
    }
    
    .products-grid .price {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* 变体选择下拉菜单 */
    .products-grid .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .products-grid .variation-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* 按钮样式 */
    .products-grid .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
    }
    
    .products-grid .btn-add-to-cart {
        margin-bottom: 0.3rem;
    }
    
    .products-grid .product-actions {
        margin-top: 0.5rem;
    }
    
    /* 步骤标题和导航栏在手机端重新布局 */
    .buyer-guide-step-header {
        flex-wrap: wrap;
        flex-direction: row;
        align-items: center;
        min-height: auto;
        gap: 0;
    }
    
    /* 第一行：返回按钮和步骤数字左右分布 */
    .step-header-left {
        width: auto;
        flex: 0 0 auto;
        order: 1;
        margin-bottom: 0;
        margin-right: auto;
    }
    
    .step-header-right {
        width: auto;
        flex: 0 0 auto;
        order: 2;
        text-align: right;
        margin-left: 0;
    }
    
    /* 第二行：标题占满整行 */
    .step-header-center {
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        order: 3;
        text-align: center;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #e9ecef;
    }
    
    .step-title {
        font-size: 1.1rem;
        margin: 0;
        line-height: 1.3;
    }
    
    .step-header-left .btn-back-header {
        padding: 0.35rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .step-indicator-current {
        font-size: 2rem;
    }
    
    /* 进度步骤在手机端 */
    .progress-steps {
        gap: 3px;
    }
    
    .step-icon {
        width: 36px;
        height: 36px;
    }
    
    .step-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .step-label {
        font-size: 0.65rem;
    }
}