/**
 * DealFrance Product Layouts CSS
 * Multiple layout styles inspired by AzonPress
 */

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.dealfrance-products {
    margin: 20px 0;
}

.products-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.products-grid.columns-1 { grid-template-columns: 1fr; }
.products-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.products-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.products-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.products-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }

.product-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.product-content {
    padding: 15px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
    height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-price {
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.product-price .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-right: 8px;
}

.product-price .current-price {
    color: #e47911;
    font-weight: bold;
}

.product-rating {
    margin: 10px 0;
    font-size: 14px;
}

.rating-stars {
    color: #ffa500;
    margin-right: 5px;
}

.rating-text {
    font-weight: 600;
}

.rating-count {
    color: #666;
    font-size: 12px;
}

.product-actions {
    margin-top: 15px;
}

.buy-button {
    display: inline-block;
    background: #ff9900;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.buy-button:hover {
    background: #e88a00;
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   List Layout
   ========================================================================== */

.products-list {
    margin: 20px 0;
}

.products-list .product-card {
    display: flex;
    margin-bottom: 20px;
    padding: 0;
}

.products-list .product-image {
    flex: 0 0 200px;
}

.products-list .product-image img {
    width: 200px;
    height: 150px;
    object-fit: cover;
}

.products-list .product-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.products-list .product-title {
    height: auto;
    font-size: 18px;
    margin-bottom: 15px;
}

.products-list .buy-button {
    width: auto;
    align-self: flex-start;
}

/* ==========================================================================
   Box Layout
   ========================================================================== */

.products-boxes {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.products-boxes.columns-1 { grid-template-columns: 1fr; }
.products-boxes.columns-2 { grid-template-columns: repeat(2, 1fr); }
.products-boxes.columns-3 { grid-template-columns: repeat(3, 1fr); }
.products-boxes.columns-4 { grid-template-columns: repeat(4, 1fr); }

.products-boxes .product-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    text-align: center;
}

.products-boxes .product-image img {
    height: 150px;
    padding: 10px;
    box-sizing: border-box;
}

.products-boxes .product-title {
    font-size: 14px;
    height: 2.8em;
    -webkit-line-clamp: 2;
}

/* ==========================================================================
   Table Layout
   ========================================================================== */

.products-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e1e1e1;
}

.products-table th,
.products-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: top;
}

.products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.products-table .product-info {
    min-width: 250px;
}

.products-table .product-info img {
    border-radius: 4px;
}

.products-table .product-price {
    min-width: 120px;
}

.products-table .product-rating {
    min-width: 120px;
}

.products-table .product-actions {
    min-width: 150px;
    text-align: center;
}

.products-table .button {
    background: #007cba;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.products-table .button:hover {
    background: #005a87;
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Widget Layout
   ========================================================================== */

.products-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.products-widgets .product-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
}

.products-widgets .product-image {
    position: relative;
    overflow: hidden;
}

.products-widgets .product-image img {
    height: 120px;
    filter: brightness(0.9);
}

.products-widgets .product-content {
    position: relative;
}

.products-widgets .product-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    height: 2.6em;
    -webkit-line-clamp: 2;
}

.products-widgets .product-price {
    color: #fff;
    font-size: 16px;
}

.products-widgets .product-price .old-price {
    color: rgba(255,255,255,0.7);
}

.products-widgets .buy-button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    backdrop-filter: blur(10px);
}

.products-widgets .buy-button:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

/* ==========================================================================
   Star Rating
   ========================================================================== */

.star {
    font-size: 16px;
    margin-right: 1px;
}

.star.filled {
    color: #ffa500;
}

.star.half {
    color: #ffa500;
}

.star.empty {
    color: #ddd;
}

/* ==========================================================================
   Comparison Table
   ========================================================================== */

.dealfrance-comparison-table {
    overflow-x: auto;
    margin: 20px 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e1e1e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid #e1e1e1;
    vertical-align: top;
}

.comparison-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
}

.comparison-table th:first-child {
    background: #2c3e50;
    text-align: left;
}

.comparison-table td:first-child {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
}

.comparison-table img {
    max-width: 80px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.comparison-table .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    display: block;
}

.comparison-table .current-price {
    color: #e47911;
    font-weight: bold;
    font-size: 16px;
}

.comparison-table .rating {
    color: #ffa500;
    font-weight: bold;
}

.comparison-table .rating-count {
    color: #666;
    font-size: 12px;
}

.comparison-table ul {
    text-align: left;
    margin: 0;
    padding-left: 15px;
}

.comparison-table li {
    margin-bottom: 5px;
    font-size: 14px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .products-grid.columns-3,
    .products-grid.columns-4,
    .products-grid.columns-5,
    .products-boxes.columns-3,
    .products-boxes.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-list .product-card {
        flex-direction: column;
    }
    
    .products-list .product-image {
        flex: none;
    }
    
    .products-list .product-image img {
        width: 100%;
        height: 200px;
    }
    
    .products-widgets {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .products-grid.columns-2,
    .products-boxes.columns-2 {
        grid-template-columns: 1fr;
    }
    
    .products-widgets {
        grid-template-columns: 1fr;
    }
    
    .comparison-table {
        font-size: 12px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px;
    }
}
