/* ============================================
   Panier - Volyma
   ============================================ */

/* Alerte stock */
.stock-alert {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 24px;
    color: #991b1b;
}
.stock-alert svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #dc2626;
}
.stock-alert strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 6px;
}
.stock-alert ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #b91c1c;
}

/* Header cart link */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-count:empty,
.cart-count[data-count="0"] {
    display: none;
}

/* Panier Section */
.panier-section {
    padding: 120px 0 60px;
    min-height: 60vh;
}

.panier-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 40px;
}

.panier-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
}

.panier-total-items {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Panier vide */
.panier-vide {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.panier-vide svg {
    color: var(--primary);
    opacity: 0.25;
}

.panier-vide h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    color: var(--text);
}

.panier-vide p {
    color: var(--text-light);
    max-width: 400px;
}

/* Grid panier + recap */
.panier-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* Items */
.panier-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panier-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid rgba(30, 66, 148, 0.06);
    transition: box-shadow 0.2s;
}

.panier-item:hover {
    box-shadow: 0 4px 16px rgba(30, 66, 148, 0.06);
}

.item-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(30, 66, 148, 0.06);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-placeholder {
    color: var(--primary);
    opacity: 0.3;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.item-category {
    display: block;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.item-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.3;
}

.item-name:hover {
    color: var(--primary);
}

.item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.item-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(30, 66, 148, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.item-quantity button {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.item-quantity button:hover:not(:disabled) {
    background: var(--surface);
    color: var(--primary);
}

.item-quantity button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qte-value {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    padding: 0 4px;
}

.item-price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.item-unit-price {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Recap */
.recap-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid rgba(30, 66, 148, 0.08);
    position: sticky;
    top: 100px;
}

.recap-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
}

.recap-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.recap-line.recap-total {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
}

.recap-free {
    color: #16a34a;
    font-weight: 500;
}

.recap-divider {
    height: 1px;
    background: rgba(30, 66, 148, 0.1);
    margin: 12px 0;
}

.btn-checkout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Lexend', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.btn-checkout:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 66, 148, 0.25);
    text-decoration: none !important;
}

.btn-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.recap-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-light);
}

.btn-vider {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 16px;
    width: 100%;
    text-align: center;
    transition: color 0.2s;
}

.btn-vider:hover {
    color: #ef4444;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: 12px;
    font-family: 'Lexend', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.toast-success {
    background: #16a34a;
    color: white;
}

.toast-error {
    background: #dc2626;
    color: white;
}

/* Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* ============================================
   Livraison
   ============================================ */

.livraison-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid rgba(30, 66, 148, 0.08);
    margin-bottom: 16px;
}

.livraison-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.livraison-card h3 svg {
    color: var(--primary);
}

.livraison-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.livraison-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid rgba(30, 66, 148, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: white;
    position: relative;
}

.livraison-option:hover {
    border-color: rgba(30, 66, 148, 0.2);
    background: #f8faff;
}

.livraison-option.selected {
    border-color: var(--primary);
    background: #f0f4ff;
    box-shadow: 0 2px 12px rgba(30, 66, 148, 0.1);
}

.livraison-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.livraison-option-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 66, 148, 0.06);
    border-radius: 12px;
    flex-shrink: 0;
    color: var(--primary);
    transition: all 0.25s ease;
}

.livraison-option.selected .livraison-option-icon {
    background: var(--primary);
    color: white;
}

.livraison-option-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.livraison-option-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.livraison-option-delai {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 500;
}

.livraison-option-desc {
    font-size: 0.75rem;
    color: var(--text-light);
}

.livraison-option-prix {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.livraison-option-prix.gratuit {
    color: #16a34a;
}

.livraison-poids {
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-light);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid rgba(30, 66, 148, 0.06);
}

.recap-pending {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.85rem;
}

.btn-checkout.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #94a3b8;
}

.btn-checkout.disabled:hover {
    background: #94a3b8;
    transform: none;
    box-shadow: none;
}

/* ============================================
   Code Promo
   ============================================ */

.promo-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(30, 66, 148, 0.08);
}

.promo-input-group {
    display: flex;
    gap: 8px;
}

.promo-input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid rgba(30, 66, 148, 0.12);
    border-radius: 10px;
    font-family: 'Lexend', sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    background: white;
    transition: border-color 0.2s;
    letter-spacing: 0.05em;
}

.promo-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 66, 148, 0.08);
}

.promo-input-group input::placeholder {
    color: var(--text-light);
    letter-spacing: 0;
}

.promo-input-group button {
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Lexend', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.promo-input-group button:hover {
    background: var(--primary-light);
}

.promo-input-group button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.08);
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
}

.promo-applied-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #059669;
    font-size: 0.85rem;
}

.promo-applied-info svg {
    flex-shrink: 0;
}

.promo-remove {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.promo-remove:hover {
    color: #ef4444;
}

.promo-message {
    font-size: 0.78rem;
    margin-top: 6px;
    min-height: 0;
    transition: all 0.2s;
}

.promo-message.promo-success {
    color: #059669;
}

.promo-message.promo-error {
    color: #dc2626;
}

.recap-discount {
    color: #059669;
    font-weight: 600;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .panier-grid {
        grid-template-columns: 1fr 320px;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .panier-section {
        padding: 90px 0 40px;
    }

    .panier-header h1 {
        font-size: 1.5rem;
    }

    .panier-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .recap-card {
        position: static;
    }

    .panier-item {
        flex-direction: column;
        gap: 14px;
    }

    .item-image {
        width: 100%;
        height: 140px;
    }

    .cta-card {
        padding: 36px 24px;
    }

    .cta-card h2 {
        font-size: 24px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .cta-buttons .btn-primary,
    .cta-buttons .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .panier-section {
        padding: 80px 0 30px;
    }

    .panier-header h1 {
        font-size: 1.3rem;
    }

    .panier-item {
        padding: 16px;
    }

    .item-info h3 {
        font-size: 15px;
    }

    .item-price {
        font-size: 17px;
    }

    .quantite-selector button {
        width: 32px;
        height: 32px;
    }

    .quantite-selector input {
        width: 40px;
        font-size: 14px;
    }

    .item-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .recap-card {
        padding: 24px 20px;
    }

    .recap-card h2 {
        font-size: 17px;
    }

    .recap-total .total-price {
        font-size: 22px;
    }

    .btn-checkout {
        padding: 14px 24px;
        font-size: 14px;
    }

    .cta-card {
        padding: 28px 20px;
    }

    .cta-card h2 {
        font-size: 20px;
    }

    .cta-card p {
        font-size: 13px;
    }
}
