@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* Variables globales */
:root {
    --primary-gradient: linear-gradient(135deg, #FF6B6B, #FFB700);
    --secondary-gradient: linear-gradient(135deg, #45B7D1, #4666FF);
    --accent-gradient: linear-gradient(135deg, #FF6B6B, #FFE66D);
    --surface-gradient-dark: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    --surface-gradient-light: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.9));
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --primary: #FFB700;
    --text-1: #FFFFFF;
    --text-2: rgba(255, 255, 255, 0.8);
    --text-3: rgba(255, 255, 255, 0.6);
    --surface: #1f1f1f;
    --border: #292929;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* Thème sombre (par défaut) */
.modern-cart {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-1);
}

.navigation-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
}

.back-link svg {
    transition: var(--transition);
}

.back-link:hover {
    color: #fff;
    transform: translateX(-4px);
}

.back-link:hover svg {
    stroke: #fff;
}

.cart-header {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.cart-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(80px);
}

.cart-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    background: #FFF;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-decoration {
    width: 60px;
    height: 4px;
    background: #FFF;
    margin: 1rem auto 0;
    border-radius: 2px;
    position: relative;
}

.cart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 992px) {
    .cart-grid {
        grid-template-columns: 1.5fr 1fr;
        padding: 0 2rem;
    }
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 200px;
}

.product-card-cart {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--product-primary-rgb), 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    margin-bottom: 1rem;
    position: relative;
    box-shadow: 0 4px 16px rgba(var(--product-primary-rgb), 0.1);
}

.product-card-cart .remove-btn {
    background: rgba(var(--product-primary-rgb), 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

/* Styles pour desktop et tablette */
@media (min-width: 481px) {
    .product-card-cart .remove-btn {
        align-self: start;
    }
}

/* Styles pour mobile */
@media (max-width: 480px) {
    .product-card-cart {
        padding-top: 3rem; /* Espace pour le bouton de suppression */
    }

    .product-card-cart .remove-btn {
        position: absolute;
        top: 0.75rem;
        right: 0;
    }

    .product-card-cart .product-content {
        margin-top: -1rem; /* Compenser l'espace ajouté pour le bouton */
    }
}

.product-card-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(var(--product-primary-rgb), 0.15);
    border-color: rgba(var(--product-primary-rgb), 0.4);
}

.product-card-cart .product-content {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 2rem;
    align-items: center;
    min-height: 200px;
}

.product-card-cart .cart-product-image {
    width: 200px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 2px solid rgba(var(--product-primary-rgb), 0.2);
    transition: all 0.3s ease;
    line-height: 0;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.product-card-cart .cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: calc(var(--radius-md) - 2px);
    display: block;
}

.product-card-cart .product-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 2rem;
}

.product-card-cart .product-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    transition: color 0.3s ease;
}

.product-card-cart .product-price {
    font-size: 1.25rem;
    font-weight: 500;
    color: rgba(var(--product-primary-rgb), 0.9);
    margin: 0;
}

.product-card-cart .product-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(var(--product-primary-rgb), 0.3);
    margin-top: 0.5rem;
}

.product-card-cart .remove-btn svg {
    stroke: var(--product-primary);
    transition: all 0.3s ease;
    width: 16px;
    height: 16px;
    display: block;
}

.product-card-cart .remove-btn:hover {
    background: var(--product-primary);
    transform: rotate(90deg);
}

.product-card-cart .remove-btn:hover svg {
    stroke: #fff;
}

@media (max-width: 768px) {
    .product-card-cart .product-content {
        grid-template-columns: 150px 1fr auto;
        gap: 1rem;
        min-height: 150px;
    }

    .product-card-cart .cart-product-image {
        width: 150px;
    }

    .product-card-cart .product-details {
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .product-card-cart {
        padding: 1.5rem;
    }

    .product-card-cart .product-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        min-height: auto;
    }

    .product-card-cart .cart-product-image {
        width: 180px;
        margin: 0 auto;
    }

    .product-card-cart .product-details {
        text-align: center;
        padding-right: 0;
    }

    .product-card-cart .product-description {
        border-left: none;
        padding-left: 0;
        border-top: 2px solid rgba(var(--product-primary-rgb), 0.3);
        padding-top: 0.75rem;
        margin-top: 0.75rem;
        text-align: left;
    }
}

.cart-sidebar {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 2rem;
}

.promo-section {
    background: var(--surface-gradient-dark);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.promo-section h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    margin: 0 0 1rem 0;
}

.woocommerce-coupon-form {
    margin-top: 1rem;
}

.coupon {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin-top: 1rem;
}

.coupon input[type="text"] {
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-1);
}

.coupon button.button {
    white-space: nowrap;
    background: var(--primary-gradient);
    color: var(--text-1);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.coupon button.button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Message d'erreur et de succès pour les codes promo */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--text-1);
}

.woocommerce-error {
    border-left: 4px solid #dc3545;
}

.woocommerce-message {
    border-left: 4px solid #28a745;
}

.woocommerce-info {
    border-left: 4px solid #17a2b8;
}

@media (max-width: 480px) {
    .coupon {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .coupon input[type="text"] {
        width: 100%;
        min-width: 0;
    }

    .coupon button {
        width: 100%;
    }
}

.applied-coupons {
    margin-bottom: 1rem;
}

.applied-coupon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(var(--product-primary-rgb), 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.applied-coupon .coupon-code {
    font-weight: 500;
    color: var(--text-1);
}

.remove-coupon-form {
    margin: 0;
}

.remove-coupon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-2);
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none; /* Ajouté car c'est maintenant un lien */
}

.remove-coupon:hover {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    transform: rotate(90deg);
}

.remove-coupon:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2);
}

.remove-coupon svg {
    width: 16px;
    height: 16px;
}

.cart-summary {
    background: var(--surface-gradient-dark);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--text-2);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 1.2rem;
    font-weight: 600;
}

.checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--primary-gradient);
    color: var(--text-1);
    text-decoration: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.checkout-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.shipping-info {
    text-align: center;
    color: var(--text-3);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Styles pour le montant du code promo */
.coupon-amount {
    margin-left: 0.5rem;
    color: var(--primary);
    font-size: 0.9em;
}

/* Améliorer l'apparence des messages de WooCommerce */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Styles des messages de notification */
.woocommerce-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
    color: #28a745;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    animation: slideIn 0.3s ease-out;
}

.woocommerce-error {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #dc3545;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Thème clair */
.theme-light .modern-cart {
    color: #333;
}

.theme-light .back-link {
    color: rgba(0, 0, 0, 0.6);
}

.theme-light .back-link:hover {
    color: #000;
}

.theme-light .back-link:hover svg {
    stroke: #000;
}

.theme-light .product-card-cart {
    background: var(--surface-gradient-light);
    border: 1px solid rgba(var(--product-primary-rgb), 0.2);
    box-shadow: 0 4px 16px rgba(var(--product-primary-rgb), 0.08);
}

.theme-light .product-card-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(var(--product-primary-rgb), 0.15);
    border-color: rgba(var(--product-primary-rgb), 0.4);
}

.theme-light .product-card-cart .cart-product-image {
    border: 2px solid rgba(var(--product-primary-rgb), 0.2);
}

.theme-light .product-card-cart .product-details h3 {
    color: #000;
}

.theme-light .product-card-cart .product-price {
    color: rgba(var(--product-primary-rgb), 0.9);
}

.theme-light .product-card-cart .product-description {
    color: #666;
    border-left-color: rgba(var(--product-primary-rgb), 0.3);
}

.theme-light .product-card-cart .remove-btn {
    background: rgba(var(--product-primary-rgb), 0.1);
}

.theme-light .product-card-cart .remove-btn svg {
    stroke: var(--product-primary);
}

.theme-light .product-card-cart .remove-btn:hover {
    background: var(--product-primary);
}

.theme-light .product-card-cart .remove-btn:hover svg {
    stroke: #fff;
}

.theme-light .cart-sidebar {
    background: var(--surface-gradient-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.theme-light .promo-section,
.theme-light .cart-summary {
    background: var(--surface-gradient-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.theme-light .promo-section h2 {
    color: #000;
}

.theme-light .summary-row {
    color: #666;
}

.theme-light .summary-total {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.theme-light .shipping-info {
    color: #666;
}

.theme-light .applied-coupon {
    background: rgba(var(--product-primary-rgb), 0.1);
}

.theme-light .applied-coupon .coupon-code {
    color: #333;
}

.theme-light .remove-coupon {
    color: #666;
}