/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

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

/* Header */
header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-weight: 700;
    font-size: 1.8rem;
    color: #fff;
}

.logo span {
    font-size: 0.9rem;
    color: #bdc3c7;
    display: block;
}

.cart-link {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    background: #34495e;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    transition: background 0.3s;
    position: relative;
}

.cart-link:hover {
    background: #2c3e50;
}

.cart-badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Alertes */
.alert {
    padding: 1rem 2rem;
    border-radius: 5px;
    margin: 1rem 0;
    text-align: center;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Grid Produits */
.products {
    padding: 2rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder {
    font-size: 4rem;
    color: #bdc3c7;
}

.product-info {
    padding: 1.2rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    min-height: 2.8rem;
}

.product-ref {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stock-available {
    color: #27ae60;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 0.8rem;
}

.stock-unavailable {
    color: #e74c3c;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 0.8rem;
}

.btn-add-cart {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    transition: background 0.3s;
    margin-bottom: 0.5rem;
}

.btn-add-cart:hover:not(:disabled) {
    background: #2980b9;
}

.btn-add-cart:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-detail {
    display: inline-block;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    text-align: center;
    transition: background 0.3s;
    width: 100%;
}

.btn-detail:hover {
    background: #d5dbdb;
}

.no-products {
    text-align: center;
    padding: 3rem 0;
    color: #7f8c8d;
}

/* Page Détail Produit */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 3rem 0;
}

.product-detail-image {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.product-detail-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.product-placeholder-large {
    font-size: 6rem;
    color: #bdc3c7;
}

.product-detail-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.product-price-large {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 1rem 0;
}

.product-description {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.product-description h3 {
    margin-bottom: 0.5rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.quantity-selector input {
    width: 70px;
    padding: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn-add-cart-large {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-add-cart-large:hover:not(:disabled) {
    background: #2980b9;
}

.btn-add-cart-large:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-back {
    display: inline-block;
    margin-top: 1rem;
    color: #3498db;
    text-decoration: none;
}

/* Panier */
.page-title {
    margin: 2rem 0;
    font-size: 2rem;
}

.empty-cart {
    text-align: center;
    padding: 4rem 0;
}

.btn-continue-shopping {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    transition: background 0.3s;
}

.btn-continue-shopping:hover {
    background: #2980b9;
}

.cart-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-table th {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: left;
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.cart-table tfoot td {
    font-weight: bold;
    border-top: 2px solid #2c3e50;
}

.quantity-input {
    width: 60px;
    padding: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.btn-remove {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-remove:hover {
    text-decoration: underline;
}

.cart-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-update {
    background: #f39c12;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-update:hover {
    background: #e67e22;
}

.btn-clear {
    background: #e74c3c;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-clear:hover {
    background: #c0392b;
}

.btn-checkout {
    background: #27ae60;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-checkout:hover {
    background: #229954;
}

/* Checkout */
.checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

.checkout-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.checkout-form h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn-submit-order {
    background: #27ae60;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
    margin-top: 1rem;
}

.btn-submit-order:hover {
    background: #229954;
}

.checkout-summary {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

.checkout-summary h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.summary-table {
    width: 100%;
}

.summary-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.total-row td {
    border-top: 2px solid #2c3e50;
    padding-top: 1rem;
    font-size: 1.1rem;
}

/* Confirmation */
.success-container {
    text-align: center;
    padding: 4rem 2rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-container h1 {
    color: #27ae60;
    margin-bottom: 0.5rem;
}

.order-details {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 600px;
    text-align: left;
}

.order-details h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.order-details p {
    margin-bottom: 0.5rem;
}

.order-items {
    width: 100%;
    margin-top: 1rem;
}

.order-items th {
    text-align: left;
    padding: 0.5rem;
    background: #f8f9fa;
}

.order-items td {
    padding: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-link {
        margin-top: 0.5rem;
    }
    
    .cart-table {
        font-size: 0.9rem;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .cart-actions a,
    .cart-actions button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
}