/**
 * Fichier: css/cart-commandes.css
 * Styles pour la page panier
 */

/* ===== VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===== */
body.cart-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f5f9;
    color: var(--dark-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.cart-header {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.cart-header .container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-back {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-back:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cart-header-info h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 0.25rem 0;
}

.cart-header-info p {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin: 0;
}

/* ===== LAYOUT ===== */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* ===== CART ITEMS ===== */
.cart-items-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.cart-items-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 1.25rem 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-items-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
}

.cart-items-body {
    padding: 0;
}

/* ===== CART ITEM ===== */
.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.cart-item:hover {
    background: var(--light-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--light-color);
}

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

.cart-item-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 0.25rem 0;
}

.cart-item-options {
    font-size: 0.8125rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    font-size: 0.9375rem;
    color: var(--primary-color);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.cart-item-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* ===== QUANTITY SELECTOR ===== */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--light-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.quantity-selector button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--dark-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector button:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-selector button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-selector span {
    width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9375rem;
}

/* ===== DELETE BUTTON ===== */
.btn-delete {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-delete:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* ===== EMPTY CART ===== */
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.cart-empty-icon {
    width: 100px;
    height: 100px;
    background: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.cart-empty-icon i {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.cart-empty h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 0.5rem 0;
}

.cart-empty p {
    color: var(--secondary-color);
    margin: 0 0 1.5rem 0;
}

.btn-start-shopping {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-start-shopping:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: white;
}

/* ===== CART FOOTER ===== */
.cart-items-footer {
    padding: 1rem 1.5rem;
    background: var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-continue {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.btn-continue:hover {
    color: var(--primary-color);
}

.btn-clear {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-clear:hover {
    background: var(--danger-color);
    color: white;
}

/* ===== SIDEBAR ===== */
.cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== DELIVERY OPTIONS ===== */
.delivery-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.delivery-card-header {
    background: var(--dark-color);
    padding: 1rem 1.25rem;
    color: white;
}

.delivery-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delivery-card-body {
    padding: 1.25rem;
}

.delivery-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.75rem;
}

.delivery-option:last-child {
    margin-bottom: 0;
}

.delivery-option:hover {
    border-color: var(--primary-color);
}

.delivery-option.active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.delivery-option input {
    display: none;
}

.delivery-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.delivery-option.active .delivery-option-radio {
    border-color: var(--primary-color);
}

.delivery-option.active .delivery-option-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

.delivery-option-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 0.25rem 0;
}

.delivery-option-content p {
    font-size: 0.8125rem;
    color: var(--secondary-color);
    margin: 0;
}

.delivery-disabled {
    padding: 1rem;
    background: #fef3c7;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delivery-disabled i {
    color: var(--warning-color);
}

.delivery-disabled span {
    font-size: 0.8125rem;
    color: #92400e;
}

/* ===== SUMMARY CARD ===== */
.summary-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.summary-card-header {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
    padding: 1rem 1.25rem;
    color: white;
}

.summary-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-card-body {
    padding: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.summary-row span {
    font-size: 0.9375rem;
    color: var(--secondary-color);
}

.summary-row.total {
    border-top: 2px solid var(--border-color);
    margin-top: 0.75rem;
    padding-top: 1rem;
}

.summary-row.total span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* ===== MINIMUM ORDER WARNING ===== */
.minimum-warning {
    background: #fef3c7;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-top: 1rem;
}

.minimum-warning p {
    font-size: 0.8125rem;
    color: #92400e;
    margin: 0 0 0.75rem 0;
}

.minimum-progress {
    height: 6px;
    background: #fde68a;
    border-radius: 3px;
    overflow: hidden;
}

.minimum-progress-bar {
    height: 100%;
    background: var(--warning-color);
    border-radius: 3px;
}

/* ===== CHECKOUT BUTTON ===== */
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    margin-top: 1rem;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        order: -1;
    }
}

@media (max-width: 575.98px) {
    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 0.5rem;
    }
    
    .cart-items-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
}