/**
 * DealFrance Shortcodes CSS
 * AzonPress-inspired styling system
 */

/* ==========================================================================
   Base Shortcode Wrapper
   ========================================================================== */

.dealfrance-shortcode-wrapper {
    margin: 25px 0;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dealfrance-shortcode-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   Product Table Styles
   ========================================================================== */

.dealfrance-product-table {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.dealfrance-product-table .table-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.dealfrance-product-table .table-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.products-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.products-comparison-table th {
    background: #f8f9fa;
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-comparison-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.5;
}

.products-comparison-table tr:hover {
    background: #fafbfc;
    transition: background 0.2s ease;
}

.products-comparison-table .column-image {
    width: 120px;
    text-align: center;
}

.products-comparison-table .column-title {
    min-width: 200px;
}

.products-comparison-table .column-price {
    width: 120px;
    text-align: center;
}

.products-comparison-table .column-rating {
    width: 140px;
    text-align: center;
}

.products-comparison-table .column-button {
    width: 150px;
    text-align: center;
}

.table-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: #6c757d;
    font-size: 12px;
}

/* ==========================================================================
   Product Grid Styles
   ========================================================================== */

.dealfrance-product-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
}

.dealfrance-product-grid.columns-1 { --grid-columns: 1; }
.dealfrance-product-grid.columns-2 { --grid-columns: 2; }
.dealfrance-product-grid.columns-3 { --grid-columns: 3; }
.dealfrance-product-grid.columns-4 { --grid-columns: 4; }
.dealfrance-product-grid.columns-5 { --grid-columns: 5; }

.product-grid-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
    position: relative;
}

.product-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.product-grid-item .product-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.product-grid-item .product-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-grid-item:hover .product-image img {
    transform: scale(1.05);
}

.product-grid-item .product-content {
    padding: 20px;
}

.product-grid-item .product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
    color: #2c3e50;
    height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-grid-item .product-price {
    margin: 12px 0;
    font-size: 18px;
}

.product-grid-item .old-price {
    color: #95a5a6;
    text-decoration: line-through;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.product-grid-item .current-price {
    color: #e74c3c;
    font-weight: 700;
    font-size: 20px;
}

.product-grid-item .product-rating {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-grid-item .star-rating {
    color: #f39c12;
}

.product-grid-item .buy-button {
    display: block;
    width: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-grid-item .buy-button:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a42a0);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ==========================================================================
   Product Box Styles
   ========================================================================== */

.dealfrance-product-box {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    position: relative;
    overflow: hidden;
}

.dealfrance-product-box:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.dealfrance-box-modern {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.dealfrance-product-box .product-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.dealfrance-product-box .product-image {
    flex: 0 0 120px;
    margin-right: 20px;
}

.dealfrance-product-box .product-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dealfrance-product-box .product-info {
    flex: 1;
}

.dealfrance-product-box .product-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #2c3e50;
}

.dealfrance-product-box .product-price {
    font-size: 24px;
    color: #e74c3c;
    font-weight: 700;
    margin: 8px 0;
}

.dealfrance-product-box .product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.dealfrance-product-box .product-features {
    margin: 20px 0;
}

.dealfrance-product-box .product-features h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.dealfrance-product-box .product-features ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dealfrance-product-box .product-features li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: #34495e;
    font-size: 14px;
}

.dealfrance-product-box .product-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.dealfrance-product-box .product-actions {
    text-align: center;
    margin-top: 25px;
}

/* ==========================================================================
   Bestsellers Styles
   ========================================================================== */

.dealfrance-bestsellers {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.bestsellers-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bestsellers-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.period-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bestsellers-list {
    padding: 0;
}

.bestseller-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.2s ease;
}

.bestseller-item:hover {
    background: #fafbfc;
}

.bestseller-item:last-child {
    border-bottom: none;
}

.rank-number {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
    margin-right: 20px;
}

.bestseller-item.rank-1 .rank-number {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.bestseller-item.rank-2 .rank-number {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.bestseller-item.rank-3 .rank-number {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

/* ==========================================================================
   Star Rating System
   ========================================================================== */

.star-rating {
    display: inline-flex;
    align-items: center;
}

.star {
    font-size: 16px;
    margin-right: 2px;
    color: #ddd;
    transition: color 0.2s ease;
}

.star.filled,
.star.half {
    color: #f39c12;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }

.no-margin { margin: 0 !important; }
.no-padding { padding: 0 !important; }

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .dealfrance-product-grid.columns-4,
    .dealfrance-product-grid.columns-5 {
        --grid-columns: 3;
    }
}

@media (max-width: 768px) {
    .dealfrance-product-grid.columns-3,
    .dealfrance-product-grid.columns-4,
    .dealfrance-product-grid.columns-5 {
        --grid-columns: 2;
    }
    
    .products-comparison-table {
        font-size: 12px;
    }
    
    .products-comparison-table th,
    .products-comparison-table td {
        padding: 12px 8px;
    }
    
    .dealfrance-product-box .product-header {
        flex-direction: column;
        text-align: center;
    }
    
    .dealfrance-product-box .product-image {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .bestsellers-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .bestseller-item {
        padding: 15px;
    }
    
    .rank-number {
        width: 35px;
        height: 35px;
        font-size: 16px;
        margin-right: 15px;
    }
}

@media (max-width: 480px) {
    .dealfrance-product-grid {
        --grid-columns: 1;
    }
    
    .dealfrance-shortcode-wrapper {
        margin: 15px 0;
    }
    
    .products-comparison-table {
        font-size: 11px;
    }
    
    .products-comparison-table th,
    .products-comparison-table td {
        padding: 8px 6px;
    }
    
    .product-grid-item .product-content {
        padding: 15px;
    }
    
    .dealfrance-product-box {
        padding: 20px;
    }
}

/* ==========================================================================
   Animation and Effects
   ========================================================================== */

.dealfrance-shortcode-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-grid-item,
.bestseller-item,
.dealfrance-product-box {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .dealfrance-shortcode-wrapper {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .buy-button {
        display: none !important;
    }
    
    .product-grid-item:hover,
    .bestseller-item:hover {
        transform: none !important;
        background: #fff !important;
    }
}
