/* Panier Pré-commande - Styles */

.ppc-panier-widget {
    --ppc-primary: #00a298;
    --ppc-secondary: #111f4a;
    --ppc-border: #e0e0e0;
    --ppc-bg-light: #f9f9f9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ppc-panier-titre {
    font-size: 28px;
    font-weight: 700;
    color: var(--ppc-secondary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--ppc-primary);
}

/* Panier vide */
.ppc-panier-vide {
    text-align: center;
    padding: 60px 20px;
    background: var(--ppc-bg-light);
    border-radius: 12px;
}

.ppc-panier-vide p {
    font-size: 18px;
    color: #666;
    margin-bottom: 25px;
}

/* Message de pré-commande */
.ppc-message-precommande {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(17, 31, 74, 0.05) 0%, rgba(0, 162, 152, 0.05) 100%);
    border-left: 4px solid var(--ppc-secondary);
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ppc-secondary);
    box-shadow: 0 2px 10px rgba(17, 31, 74, 0.08);
    animation: fadeInSlide 0.5s ease;
}

.ppc-message-precommande .ppc-message-icon {
    color: var(--ppc-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.ppc-message-precommande .ppc-message-content {
    flex: 1;
}

.ppc-message-precommande .ppc-message-content strong {
    color: var(--ppc-secondary);
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.ppc-message-precommande .ppc-message-content p {
    margin: 0 0 8px 0;
}

.ppc-message-precommande .ppc-message-content p:last-child {
    margin-bottom: 0;
}

/* Animation d'apparition */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Messages de stock */
.ppc-stock-messages {
    margin-bottom: 25px;
}

/* Style pour les notifications WooCommerce (alertes de stock) */
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 162, 152, 0.1) 0%, rgba(0, 162, 152, 0.05) 100%);
    border-left: 4px solid var(--ppc-primary, #00a298);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #111f4a;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 162, 152, 0.08);
    list-style: none;
}

.woocommerce-notices-wrapper .woocommerce-info::before,
.woocommerce-notices-wrapper .woocommerce-message::before,
.woocommerce-notices-wrapper .woocommerce-notice::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2300a298' d='M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Style spécifique pour les messages dans le panier/checkout */
.woocommerce-cart .woocommerce-notices-wrapper,
.woocommerce-checkout .woocommerce-notices-wrapper {
    margin-bottom: 25px;
}

.ppc-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 162, 152, 0.1) 0%, rgba(0, 162, 152, 0.05) 100%);
    border-left: 4px solid var(--ppc-primary);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--ppc-secondary);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 162, 152, 0.08);
}

.ppc-info-icon {
    color: var(--ppc-primary);
    flex-shrink: 0;
}

/* Items du panier */
.ppc-panier-items {
    margin-bottom: 30px;
}

.ppc-panier-item {
    padding: 20px;
    background: white;
    border: 1px solid var(--ppc-border);
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.ppc-panier-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.ppc-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.ppc-item-info {
    flex: 1;
}

.ppc-item-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--ppc-secondary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.ppc-item-variation {
    font-size: 13px;
    color: #666;
}

.ppc-item-variation dl {
    margin: 0;
}

.ppc-item-variation dt {
    display: inline;
    font-weight: 600;
    margin-right: 5px;
}

.ppc-item-variation dd {
    display: inline;
    margin: 0 10px 0 0;
}

.ppc-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Sélecteur de quantité */
.ppc-quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--ppc-border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.ppc-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--ppc-bg-light);
    color: var(--ppc-secondary);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ppc-qty-btn:hover {
    background: var(--ppc-primary);
    color: white;
}

.ppc-qty-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--ppc-border);
    border-right: 1px solid var(--ppc-border);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--ppc-secondary);
    -moz-appearance: textfield;
}

.ppc-qty-input::-webkit-outer-spin-button,
.ppc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ppc-qty-input:focus {
    outline: none;
    background: var(--ppc-bg-light);
}

/* Bouton supprimer */
.ppc-remove-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #dc3545;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ppc-remove-item:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.ppc-remove-item svg {
    flex-shrink: 0;
}

/* Actions du panier */
.ppc-panier-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 2px solid var(--ppc-border);
}

.ppc-btn {
    flex: 1;
    padding: 16px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.ppc-btn-primary {
    background: var(--ppc-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 162, 152, 0.3);
}

.ppc-btn-primary:hover {
    background: #008c84;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 162, 152, 0.4);
}

.ppc-btn-secondary {
    background: white;
    color: var(--ppc-secondary);
    border: 2px solid var(--ppc-secondary);
}

.ppc-btn-secondary:hover {
    background: var(--ppc-secondary);
    color: white;
}

/* États de chargement */
.ppc-panier-item.updating {
    opacity: 0.6;
    pointer-events: none;
}

.ppc-panier-item.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Notifications */
.ppc-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ppc-notification-success {
    background: var(--ppc-primary);
    color: white;
}

.ppc-notification-error {
    background: #dc3545;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Message sur la page checkout */
.ppc-checkout-message {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(17, 31, 74, 0.05) 0%, rgba(0, 162, 152, 0.05) 100%);
    border-left: 4px solid #111f4a;
    border-radius: 10px;
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.6;
    color: #111f4a;
    box-shadow: 0 2px 10px rgba(17, 31, 74, 0.08);
}

.ppc-checkout-message .ppc-message-icon {
    color: #00a298;
    flex-shrink: 0;
    margin-top: 2px;
}

.ppc-checkout-message .ppc-message-content {
    flex: 1;
}

.ppc-checkout-message .ppc-message-content strong {
    color: #111f4a;
    font-weight: 700;
    font-size: 16px;
}

/* Page de confirmation de commande */
.woocommerce-order .ppc-checkout-message {
    margin-top: 20px;
}

/* Masquer les prix WooCommerce */
.woocommerce-Price-amount,
.woocommerce-cart-form__cart-item .product-price,
.woocommerce-cart-form__cart-item .product-subtotal,
.cart-subtotal,
.order-total,
.woocommerce-checkout-review-order-table .product-total,
.woocommerce-checkout-review-order-table tfoot tr {
    display: none !important;
}

.woocommerce-order-overview__total,
.woocommerce-table--order-details tfoot {
    display: none !important;
}

/* Page Checkout - Masquer les prix */
.woocommerce-checkout .woocommerce-Price-amount,
.woocommerce-checkout .amount,
.woocommerce-checkout .product-total,
.woocommerce-checkout .cart-subtotal,
.woocommerce-checkout .order-total,
.woocommerce-checkout-review-order-table .amount {
    display: none !important;
}

.woocommerce-checkout-review-order-table tfoot {
    display: none !important;
}

/* Masquer les notifications WooCommerce en double sur checkout */
.woocommerce-checkout .woocommerce-message:empty,
.woocommerce-checkout .woocommerce-info:empty,
.woocommerce-checkout .woocommerce-error:empty {
    display: none !important;
}

/* Masquer les notifications dans le formulaire checkout (doublons) */
.woocommerce-checkout form.checkout .woocommerce-NoticeGroup-updateOrderReview {
    display: none !important;
}

/* Masquer le message d'approvisionnement coelho (géré séparément) */
.coelho-stock-alert {
    display: none !important;
}

/* Ne garder que les notifications avant le formulaire */
.woocommerce-checkout > .woocommerce-notices-wrapper {
    display: block !important;
}

/* S'assurer qu'on n'affiche pas les doublons dans les notices wrapper */
.woocommerce-notices-wrapper .woocommerce-info:empty,
.woocommerce-NoticeGroup .woocommerce-info:empty {
    display: none !important;
}

/* Page de confirmation */
.woocommerce-order .woocommerce-Price-amount,
.woocommerce-order .amount,
.woocommerce-order-details__total {
    display: none !important;
}

/* Mon compte - Commandes */
.woocommerce-account .woocommerce-Price-amount,
.woocommerce-account .amount,
.woocommerce-order-details .woocommerce-Price-amount {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .ppc-item-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ppc-item-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    .ppc-panier-actions {
        flex-direction: column;
    }
    
    .ppc-btn {
        width: 100%;
    }
    
    .ppc-message-precommande,
    .ppc-checkout-message {
        flex-direction: column;
        gap: 12px;
        padding: 18px 20px;
    }
    
    .ppc-message-precommande .ppc-message-icon,
    .ppc-checkout-message .ppc-message-icon {
        margin-top: 0;
    }
}
