/* shared/css/products.css */
/* 产品页面特定样式 */

/* 面包屑导航增强 */
.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

/* 页面标题区域 */
.page-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 产品分类区域 */
.product-category-section {
    padding-top: 30px;
    margin-bottom: 50px;
    border-top: 1px solid #eee;
}

.product-category-section:first-of-type {
    border-top: none;
}

.category-header {
    border-bottom: 2px solid #0066CC;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

/* 产品卡片 */
.product-item {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #0066CC;
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* 产品规格标签 */
.product-specs {
    margin: 10px 0;
}

.product-specs .badge {
    font-size: 11px;
    padding: 4px 8px;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 侧边导航 */
.side-nav {
    position: sticky;
    top: 100px;
    margin-bottom: 20px;
}

.side-nav .card-header {
    padding: 15px 20px;
}

.side-nav .list-group-item {
    border-left: none;
    border-right: none;
    border-color: #f1f1f1;
    padding: 12px 20px;
    color: #495057;
    transition: all 0.2s ease;
}

.side-nav .list-group-item:first-child {
    border-top: none;
}

.side-nav .list-group-item:hover {
    background-color: #f8f9fa;
    color: #0066CC;
    padding-left: 25px;
}

.side-nav .list-group-item.active {
    background-color: #e8f4ff;
    color: #0066CC;
    font-weight: 600;
    border-left: 3px solid #0066CC;
}

/* 产品筛选按钮组 */
.filter-btn-group {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.filter-btn {
    margin-right: 10px;
    margin-bottom: 10px;
    border-radius: 20px;
    padding: 8px 20px;
}

.filter-btn.active {
    background: linear-gradient(135deg, #0066CC 0%, #00A859 100%);
    border-color: transparent;
}

/* 移动端筛选器 */
.mobile-filter .accordion-button {
    background-color: #f8f9fa;
    color: #495057;
}

.mobile-filter .accordion-body {
    background-color: white;
}

/* 产品比较部分 */
.compare-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.compare-table {
    background: white;
}

.compare-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
}

.compare-table td {
    vertical-align: middle;
}

.feature-check {
    color: #00A859;
    font-size: 18px;
    text-align: center;
}

/* 产品详情按钮 */
.view-detail-btn {
    position: relative;
    overflow: hidden;
}

.view-detail-btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.view-detail-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .product-image {
        height: 150px;
    }
    
    .product-item .card-body {
        padding: 15px;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .category-header h2 {
        margin-bottom: 10px;
    }
    
    .filter-btn-group {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        padding-bottom: 15px;
    }
    
    .filter-btn {
        flex-shrink: 0;
    }
    
    .side-nav {
        position: static;
        margin-bottom: 20px;
    }
}

/* 产品加载动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-item {
    animation: fadeIn 0.5s ease;
}

/* 产品分类图标 */
.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.category-icon.feed {
    background-color: rgba(0, 128, 0, 0.1);
    color: #008000;
}

.category-icon.water {
    background-color: rgba(0, 102, 204, 0.1);
    color: #0066CC;
}

.category-icon.herb {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}
/* 添加Directus集成相关的样式 */

/* 产品卡片图片容器 */
.product-image {
    height: 200px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* 模态框样式增强 */
.modal-product-image {
    max-height: 400px;
    object-fit: contain;
    width: 100%;
}

/* 加载状态 */
.loading-state {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

/* 响应式表格 */
.table-responsive {
    overflow-x: auto;
}

/* 产品特征标签 */
.product-features .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* 模态框内容样式 */
.modal-body h6 {
    color: #0066CC;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .product-image {
        height: 150px;
    }
}