/* Enhanced Display Goods Frontend Styles */

/* 基础容器样式 */
.dp-goods-container {
    margin: 30px 0;
}

.dp-goods-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

/* 网格布局 */
.dp-goods-container.dp-goods-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dp-goods-container.dp-columns-2 .dp-goods-grid {
    grid-template-columns: repeat(2, 1fr);
}

.dp-goods-container.dp-columns-3 .dp-goods-grid {
    grid-template-columns: repeat(3, 1fr);
}

.dp-goods-container.dp-columns-4 .dp-goods-grid {
    grid-template-columns: repeat(4, 1fr);
}

.dp-goods-container.dp-columns-5 .dp-goods-grid {
    grid-template-columns: repeat(5, 1fr);
}

/* 列表布局 */
.dp-goods-container.dp-goods-list .dp-goods-grid {
    grid-template-columns: 1fr;
}

/* 轮播布局 */
.dp-goods-container.dp-goods-carousel .dp-goods-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding: 10px 0;
}

.dp-goods-container.dp-goods-carousel .dp-goods-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

/* 瀑布流布局 */
.dp-goods-container.dp-goods-masonry .dp-goods-grid {
    column-count: 3;
    column-gap: 25px;
}

.dp-goods-container.dp-goods-masonry .dp-goods-item {
    break-inside: avoid;
    margin-bottom: 25px;
}

@media (max-width: 1200px) {
    .dp-goods-container.dp-goods-masonry .dp-goods-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .dp-goods-container.dp-goods-masonry .dp-goods-grid {
        column-count: 1;
    }
}

/* 商品卡片样式 */
.dp-goods-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/* 卡片样式变体 */
.dp-goods-container.dp-card-default .dp-goods-item {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dp-goods-container.dp-card-minimal .dp-goods-item {
    border: none;
    box-shadow: none;
}

.dp-goods-container.dp-card-bordered .dp-goods-item {
    border: 2px solid #e0e0e0;
    box-shadow: none;
}

.dp-goods-container.dp-card-shadow .dp-goods-item {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 悬停效果 */
.dp-goods-container.dp-hover-fade .dp-goods-item:hover {
    opacity: 0.9;
}

.dp-goods-container.dp-hover-scale .dp-goods-item:hover {
    transform: scale(1.02);
}

.dp-goods-container.dp-hover-lift .dp-goods-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.dp-goods-container.dp-hover-none .dp-goods-item:hover {
    transform: none;
    box-shadow: none;
}

/* 商品图片 */
.dp-goods-image {
    position: relative;
    overflow: hidden;
    padding-top: 75%;
}

.dp-goods-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dp-goods-item:hover .dp-goods-image img {
    transform: scale(1.05);
}

/* 商品标签 */
.dp-goods-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    z-index: 2;
}

.dp-goods-badge.dp-featured {
    background: linear-gradient(135deg, #ff6b35, #ff8f65);
}

.dp-goods-badge.dp-sale {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* 商品内容 */
.dp-goods-content {
    padding: 20px;
}

.dp-goods-category {
    margin-bottom: 8px;
}

.dp-goods-category a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.dp-goods-category a:hover {
    color: #ff6b35;
}

.dp-goods-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.dp-goods-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dp-goods-title a:hover {
    color: #ff6b35;
}

.dp-goods-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dp-goods-sku {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

/* 评分系统 */
.dp-goods-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.dp-stars {
    display: flex;
    gap: 2px;
}

.dp-star {
    width: 14px;
    height: 14px;
    background-size: cover;
}

.dp-star-filled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffc107'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
}

.dp-star-empty {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ddd'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
}

.dp-rating-count {
    font-size: 13px;
    color: #888;
}

/* 价格样式 */
.dp-goods-price {
    margin-bottom: 12px;
}

.dp-current-price {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b35;
}

.dp-original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.dp-sale-price {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
}

/* 库存状态 */
.dp-goods-stock {
    font-size: 13px;
    margin-bottom: 12px;
}

.dp-goods-stock.in-stock {
    color: #27ae60;
}

.dp-goods-stock.out-of-stock {
    color: #e74c3c;
}

/* 操作按钮 */
.dp-goods-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.dp-button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    flex: 1;
}

.dp-view-details {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e0e0e0;
}

.dp-view-details:hover {
    background: #e9ecef;
    color: #333;
    text-decoration: none;
}

.dp-add-to-cart {
    background: #ff6b35;
    color: white;
}

.dp-add-to-cart:hover {
    background: #e55a2b;
    color: white;
}

/* 列表布局特殊样式 */
.dp-goods-container.dp-goods-list .dp-goods-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    padding: 20px;
}

.dp-goods-container.dp-goods-list .dp-goods-image {
    padding-top: 0;
    height: 200px;
    border-radius: 8px;
}

.dp-goods-container.dp-goods-list .dp-goods-image img {
    position: static;
    border-radius: 8px;
}

.dp-goods-container.dp-goods-list .dp-goods-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dp-goods-container.dp-goods-list .dp-goods-title {
    font-size: 22px;
    margin-bottom: 15px;
}

.dp-goods-container.dp-goods-list .dp-goods-price {
    font-size: 28px;
    margin-bottom: 15px;
}

.dp-goods-container.dp-goods-list .dp-goods-excerpt {
    font-size: 15px;
    margin-bottom: 20px;
    -webkit-line-clamp: 3;
}

/* 搜索区域 */
.dp-search-section {
    margin-bottom: 30px;
}

.dp-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.dp-search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dp-search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.dp-search-input:focus {
    outline: none;
    border-color: #ff6b35;
}

.dp-search-button {
    padding: 12px 25px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dp-search-button:hover {
    background: #e55a2b;
}

/* 筛选和排序区域 */
.dp-filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 20px;
}

.dp-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.dp-filter-group,
.dp-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dp-filter-group label,
.dp-sort label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.dp-filter-select,
.dp-sort-select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

.dp-filter-select:focus,
.dp-sort-select:focus {
    outline: none;
    border-color: #ff6b35;
}

/* 分页样式 */
.dp-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.dp-pagination-list {
    display: flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.dp-pagination-list li {
    display: inline-block;
}

.dp-pagination-list a,
.dp-pagination-list span {
    display: inline-block;
    padding: 10px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.dp-pagination-list a:hover {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.dp-pagination-list span.current {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.dp-pagination-list span.dots {
    background: transparent;
    border: none;
    color: #999;
}

/* 无商品提示 */
.dp-no-goods {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #666;
    font-size: 18px;
}

/* 加载状态 */
.dp-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.dp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: dp-spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .dp-goods-container.dp-columns-5 .dp-goods-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .dp-goods-container.dp-columns-4 .dp-goods-grid,
    .dp-goods-container.dp-columns-5 .dp-goods-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dp-filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dp-filters {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .dp-goods-container.dp-columns-2 .dp-goods-grid,
    .dp-goods-container.dp-columns-3 .dp-goods-grid,
    .dp-goods-container.dp-columns-4 .dp-goods-grid,
    .dp-goods-container.dp-columns-5 .dp-goods-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dp-goods-container.dp-goods-list .dp-goods-item {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dp-goods-container.dp-goods-list .dp-goods-image {
        height: 250px;
    }
    
    .dp-search-input-group {
        flex-direction: column;
    }
    
    .dp-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .dp-filter-group,
    .dp-sort {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .dp-goods-container.dp-columns-2 .dp-goods-grid,
    .dp-goods-container.dp-columns-3 .dp-goods-grid,
    .dp-goods-container.dp-columns-4 .dp-goods-grid,
    .dp-goods-container.dp-columns-5 .dp-goods-grid {
        grid-template-columns: 1fr;
    }
    
    .dp-goods-content {
        padding: 15px;
    }
    
    .dp-goods-title {
        font-size: 16px;
    }
    
    .dp-goods-price {
        font-size: 20px;
    }
    
    .dp-goods-actions {
        flex-direction: column;
    }
    
    .dp-button {
        width: 100%;
    }
}

/* 动画效果 */
.dp-goods-item {
    animation: dp-fadeIn 0.5s ease-in-out;
}

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

/* 轮播导航按钮 */
.dp-goods-container.dp-goods-carousel .dp-goods-grid::before,
.dp-goods-container.dp-goods-carousel .dp-goods-grid::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    z-index: 3;
    pointer-events: none;
}

.dp-goods-container.dp-goods-carousel .dp-goods-grid::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.dp-goods-container.dp-goods-carousel .dp-goods-grid::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

/* 滚动条样式 */
.dp-goods-container.dp-goods-carousel .dp-goods-grid::-webkit-scrollbar {
    height: 8px;
}

.dp-goods-container.dp-goods-carousel .dp-goods-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dp-goods-container.dp-goods-carousel .dp-goods-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.dp-goods-container.dp-goods-carousel .dp-goods-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}