/**
 * WC Product Configurator - Frontend Styles
 */

/* CSS Variables - Ces valeurs sont écrasées par les réglages du plugin */
:root {
    --wcpc-primary: #2563eb;
    --wcpc-primary-hover: #1d4ed8;
    --wcpc-secondary: #64748b;
    --wcpc-success: #16a34a;
    --wcpc-error: #dc2626;
    --wcpc-warning: #f59e0b;
    --wcpc-text: #1e293b;
    --wcpc-text-light: #64748b;
    --wcpc-bg: #ffffff;
    --wcpc-bg-alt: #f8fafc;
    --wcpc-border: #e2e8f0;
    --wcpc-price: #2563eb;
    --wcpc-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --wcpc-shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --wcpc-radius: 8px;
    --wcpc-radius-sm: 4px;
    --wcpc-transition: 0.2s ease;
    
    /* Boutons */
    --wcpc-button-bg: #2563eb;
    --wcpc-button-text: #ffffff;
    --wcpc-button-hover-bg: #1d4ed8;
    --wcpc-secondary-button-bg: #f1f5f9;
    --wcpc-secondary-button-text: #475569;
    
    /* Options sélectionnées */
    --wcpc-selected-bg: #eff6ff;
    --wcpc-selected-border: #2563eb;
    
    /* Barre de progression */
    --wcpc-progress-bg: #e2e8f0;
    --wcpc-progress-fill: #2563eb;
    
    /* Accordéons (Étapes) */
    --wcpc-step-bg: #ffffff;
    --wcpc-step-text: #1e293b;
    --wcpc-step-border: #e2e8f0;
    --wcpc-step-number-bg: #2563eb;
    --wcpc-step-number-text: #ffffff;
    --wcpc-step-active-bg: #f8fafc;
    
    /* Boutons d'action (zoom/info) */
    --wcpc-action-btn-bg: #ffffff;
    --wcpc-action-btn-icon: #1e293b;
    --wcpc-action-btn-hover-bg: #2563eb;
    --wcpc-action-btn-hover-icon: #ffffff;
    
    /* Bouton popup */
    --wcpc-popup-btn-bg: #2563eb;
    --wcpc-popup-btn-text: #ffffff;
    --wcpc-popup-btn-hover: #1d4ed8;
    --wcpc-popup-max-width: 60%;
}

/* Base */
.wcpc-configurator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--wcpc-text);
    line-height: 1.5;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.wcpc-configurator * {
    box-sizing: border-box;
}

/* Header */
.wcpc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.wcpc-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--wcpc-text);
}

.wcpc-description {
    color: var(--wcpc-text-light);
    font-size: 15px;
}

.wcpc-header-actions {
    display: flex;
    gap: 8px;
}

.wcpc-header-actions button {
    background: var(--wcpc-bg);
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius);
    padding: 10px;
    cursor: pointer;
    color: var(--wcpc-text-light);
    transition: var(--wcpc-transition);
}

.wcpc-header-actions button:hover {
    background: var(--wcpc-bg-alt);
    color: var(--wcpc-primary);
    border-color: var(--wcpc-primary);
}

/* Progress bar */
.wcpc-progress {
    margin-bottom: 32px;
}

.wcpc-progress-bar {
    height: 4px;
    background: var(--wcpc-progress-bg);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.wcpc-progress-fill {
    height: 100%;
    background: var(--wcpc-progress-fill);
    transition: width 0.3s ease;
}

.wcpc-progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.wcpc-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--wcpc-bg);
    border: 1px solid var(--wcpc-border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--wcpc-transition);
    white-space: nowrap;
}

.wcpc-progress-step:hover {
    border-color: var(--wcpc-primary);
}

.wcpc-progress-step.active {
    background: var(--wcpc-primary);
    border-color: var(--wcpc-primary);
    color: white;
}

.wcpc-progress-step.completed {
    background: var(--wcpc-success);
    border-color: var(--wcpc-success);
    color: white;
}

.wcpc-progress-step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.wcpc-progress-step-title {
    font-size: 13px;
    font-weight: 500;
}

/* Main layout */
.wcpc-main {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

.wcpc-layout-vertical .wcpc-main {
    grid-template-columns: 300px 1fr 380px;
}

/* Steps */
.wcpc-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wcpc-step {
    background: var(--wcpc-step-bg, var(--wcpc-bg));
    border: 1px solid var(--wcpc-step-border, var(--wcpc-border));
    border-radius: var(--wcpc-radius);
    overflow: hidden;
    transition: var(--wcpc-transition);
}

.wcpc-step.wcpc-step-active {
    border-color: var(--wcpc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wcpc-step.wcpc-step-completed .wcpc-step-header {
    background: linear-gradient(135deg, var(--wcpc-success), #15803d);
}

.wcpc-step.wcpc-step-completed .wcpc-step-number,
.wcpc-step.wcpc-step-completed .wcpc-step-title {
    color: white;
}

.wcpc-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--wcpc-step-bg, var(--wcpc-bg-alt));
    cursor: pointer;
    transition: var(--wcpc-transition);
}

.wcpc-step.wcpc-step-active .wcpc-step-header {
    background: var(--wcpc-step-active-bg, var(--wcpc-bg-alt));
}

.wcpc-step-header:hover {
    background: var(--wcpc-step-active-bg, #f1f5f9);
}

.wcpc-step-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wcpc-step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wcpc-step-number-bg, var(--wcpc-primary));
    color: var(--wcpc-step-number-text, white);
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
}

.wcpc-step-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--wcpc-step-text, var(--wcpc-text));
}

.wcpc-required {
    color: var(--wcpc-error);
}

.wcpc-step-toggle {
    color: var(--wcpc-text-light);
    transition: transform 0.2s ease;
}

.wcpc-step.wcpc-step-active .wcpc-step-toggle {
    transform: rotate(180deg);
}

.wcpc-step-content {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--wcpc-border);
}

.wcpc-step.wcpc-step-active .wcpc-step-content {
    display: block;
}

.wcpc-step-description {
    color: var(--wcpc-text-light);
    margin-bottom: 16px;
    font-size: 14px;
}

/* Selection info for multiple selection steps */
.wcpc-selection-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border-radius: var(--wcpc-radius);
    font-size: 14px;
}

.wcpc-selection-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--wcpc-primary);
}

.wcpc-selected-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--wcpc-primary);
    color: white;
    border-radius: 12px;
    font-weight: 600;
}

.wcpc-selection-min {
    color: var(--wcpc-text-light);
    font-size: 13px;
}

.wcpc-selection-info.wcpc-valid .wcpc-selected-count {
    background: var(--wcpc-success);
}

.wcpc-selection-info.wcpc-invalid .wcpc-selected-count {
    background: var(--wcpc-error);
}

/* Subcategories */
.wcpc-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.wcpc-subcategory-btn {
    padding: 6px 14px;
    background: var(--wcpc-bg);
    border: 1px solid var(--wcpc-border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--wcpc-transition);
}

.wcpc-subcategory-btn:hover,
.wcpc-subcategory-btn.active {
    background: var(--wcpc-primary);
    border-color: var(--wcpc-primary);
    color: white;
}

/* Options grid */
.wcpc-options-grid {
    display: grid;
    grid-template-columns: repeat(var(--wcpc-columns, 3), 1fr);
    gap: 16px;
}

/* Fallback responsive si pas de colonnes définies */
@media (max-width: 1200px) {
    .wcpc-options-grid {
        grid-template-columns: repeat(min(var(--wcpc-columns, 3), 3), 1fr);
    }
}

@media (max-width: 768px) {
    .wcpc-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wcpc-options-grid {
        grid-template-columns: 1fr;
    }
}

.wcpc-option {
    background: var(--wcpc-bg);
    border: 2px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius);
    padding: 12px;
    cursor: pointer;
    transition: var(--wcpc-transition);
    position: relative;
}

.wcpc-option:hover {
    border-color: var(--wcpc-primary);
    transform: translateY(-2px);
    box-shadow: var(--wcpc-shadow);
}

.wcpc-option.selected {
    border-color: var(--wcpc-selected-border);
    background: var(--wcpc-selected-bg);
}

.wcpc-option.selected .wcpc-option-check {
    opacity: 1;
    transform: scale(1);
}

.wcpc-option-image {
    position: relative;
    aspect-ratio: 1;
    margin-bottom: 12px;
    border-radius: var(--wcpc-radius-sm);
    overflow: hidden;
    background: var(--wcpc-bg-alt);
}

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

.wcpc-option-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wcpc-border);
}

/* Boutons d'action sur l'image */
.wcpc-option-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: var(--wcpc-transition);
}

.wcpc-option:hover .wcpc-option-actions {
    opacity: 1;
}

.wcpc-option-zoom,
.wcpc-option-detail {
    width: 38px;
    height: 38px;
    background: var(--wcpc-action-btn-bg, rgba(255,255,255,0.95));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--wcpc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wcpc-action-btn-icon, var(--wcpc-text));
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.wcpc-option-zoom svg,
.wcpc-option-detail svg {
    width: 18px;
    height: 18px;
}

.wcpc-option-zoom:hover,
.wcpc-option-detail:hover {
    background: var(--wcpc-action-btn-hover-bg, var(--wcpc-primary));
    color: var(--wcpc-action-btn-hover-icon, white);
    transform: scale(1.1);
}

.wcpc-option-detail {
    color: var(--wcpc-action-btn-icon, var(--wcpc-primary));
}

/* Produits hors stock */
.wcpc-option.wcpc-out-of-stock {
    pointer-events: none;
    opacity: 0.6;
}

.wcpc-option.wcpc-out-of-stock .wcpc-option-image {
    position: relative;
}

.wcpc-option.wcpc-out-of-stock .wcpc-option-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.4);
}

.wcpc-out-of-stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    background: var(--wcpc-error, #dc2626);
    color: white;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    z-index: 10;
}

.wcpc-option.wcpc-out-of-stock .wcpc-option-actions {
    display: none;
}

.wcpc-option.wcpc-out-of-stock .wcpc-option-check {
    display: none;
}

.wcpc-option-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 38px;
    height: 38px;
    background: var(--wcpc-check-badge-bg, var(--wcpc-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wcpc-check-badge-icon, white);
    opacity: 0;
    transform: scale(0.5);
    transition: var(--wcpc-transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.wcpc-option-check svg {
    width: 20px;
    height: 20px;
    stroke: var(--wcpc-check-badge-icon, white);
}

.wcpc-option-info {
    text-align: center;
}

.wcpc-option-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--wcpc-text);
}

.wcpc-option-description {
    font-size: 12px;
    color: var(--wcpc-text-light);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wcpc-option-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--wcpc-price);
}

.wcpc-price-included {
    color: var(--wcpc-success);
    font-weight: 500;
}

/* Variations */
.wcpc-option-variations {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--wcpc-border);
}

.wcpc-variation-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--wcpc-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.wcpc-variation-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius-sm);
    font-size: 13px;
    background: var(--wcpc-bg);
    cursor: pointer;
    transition: var(--wcpc-transition);
}

.wcpc-variation-select:hover {
    border-color: var(--wcpc-primary);
}

.wcpc-variation-select:focus {
    outline: none;
    border-color: var(--wcpc-primary);
    box-shadow: 0 0 0 3px rgba(var(--wcpc-primary-rgb), 0.15);
}

.wcpc-option.selected .wcpc-variation-select {
    border-color: var(--wcpc-primary);
}

/* Prix variable "à partir de" */
.wcpc-option-price.wcpc-price-variable {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wcpc-price-from {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wcpc-muted);
    font-weight: 500;
}

.wcpc-price-amount {
    font-weight: 700;
    color: var(--wcpc-price);
}

/* Quantity */
.wcpc-option-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    gap: 4px;
}

.wcpc-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--wcpc-border);
    background: var(--wcpc-bg);
    border-radius: var(--wcpc-radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--wcpc-transition);
}

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

.wcpc-qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius-sm);
    padding: 4px;
    font-size: 14px;
}

/* Summary */
.wcpc-summary {
    position: sticky;
    top: 20px;
}

.wcpc-summary-inner {
    background: var(--wcpc-bg);
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius);
    padding: 24px;
    box-shadow: var(--wcpc-shadow);
}

.wcpc-summary-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wcpc-border);
}

.wcpc-summary-items {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.wcpc-summary-empty {
    text-align: center;
    color: var(--wcpc-text-light);
    padding: 32px 16px;
    font-size: 14px;
}

.wcpc-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--wcpc-border);
    font-size: 14px;
}

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

.wcpc-summary-item-step {
    font-size: 11px;
    color: var(--wcpc-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcpc-summary-item-name {
    font-weight: 500;
}

.wcpc-summary-variation {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--wcpc-text-light);
    margin-top: 2px;
}

.wcpc-summary-item-price {
    font-weight: 600;
    color: var(--wcpc-primary);
    white-space: nowrap;
    margin-left: 12px;
}

/* Promo section */
.wcpc-promo-section {
    position: relative;
}

/* Auto promo banner - État appliquée (succès) */
.wcpc-auto-promo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--wcpc-radius);
    color: white;
    margin-bottom: 20px;
}

.wcpc-auto-promo-banner.wcpc-promo-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Auto promo banner - État en attente */
.wcpc-auto-promo-banner.wcpc-promo-waiting {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.wcpc-auto-promo-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcpc-auto-promo-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wcpc-auto-promo-message,
.wcpc-promo-pending-title {
    font-weight: 600;
    font-size: 15px;
}

.wcpc-auto-promo-detail,
.wcpc-promo-pending-detail {
    font-size: 13px;
    opacity: 0.9;
}

.wcpc-promo-remaining {
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: inline-block;
}

.wcpc-remaining-steps {
    font-weight: 700;
}

/* Manual promo section */
.wcpc-promo-section:not(.wcpc-auto-promo) {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--wcpc-bg-alt);
    border-radius: var(--wcpc-radius);
}

.wcpc-promo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--wcpc-text);
}

.wcpc-promo-icon {
    font-size: 18px;
}

.wcpc-promo-input-wrap {
    display: flex;
    gap: 8px;
}

.wcpc-promo-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius-sm);
    font-size: 14px;
    text-transform: uppercase;
}

.wcpc-promo-apply {
    padding: 10px 16px;
    background: var(--wcpc-secondary);
    color: white;
    border: none;
    border-radius: var(--wcpc-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--wcpc-transition);
}

.wcpc-promo-apply:hover {
    background: #475569;
}

.wcpc-promo-message {
    margin-top: 8px;
    font-size: 13px;
}

.wcpc-promo-message.success {
    color: var(--wcpc-success);
}

.wcpc-promo-message.error {
    color: var(--wcpc-error);
}

.wcpc-promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid var(--wcpc-success);
    border-radius: var(--wcpc-radius-sm);
    margin-top: 12px;
}

.wcpc-promo-code {
    font-weight: 600;
    color: var(--wcpc-success);
}

.wcpc-promo-discount {
    color: var(--wcpc-success);
}

.wcpc-promo-remove {
    background: none;
    border: none;
    color: var(--wcpc-error);
    cursor: pointer;
    padding: 4px;
}

/* Free product badge */
.wcpc-promo-free-product {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(22, 163, 74, 0.3);
}

.wcpc-free-product-badge {
    display: inline-block;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcpc-free-product-name {
    font-weight: 600;
    color: var(--wcpc-text);
}

/* Totals */
.wcpc-summary-totals {
    padding-top: 16px;
    border-top: 2px solid var(--wcpc-border);
    margin-bottom: 20px;
}

.wcpc-summary-subtotal,
.wcpc-summary-discount {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.wcpc-summary-discount {
    color: var(--wcpc-success);
}

.wcpc-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 18px;
    font-weight: 700;
}

.wcpc-total-value {
    color: var(--wcpc-price);
}

/* Actions */
.wcpc-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wcpc-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: var(--wcpc-button-bg);
    color: var(--wcpc-button-text);
    border: none;
    border-radius: var(--wcpc-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wcpc-transition);
}

.wcpc-add-to-cart:hover:not(:disabled) {
    background: var(--wcpc-button-hover-bg);
    transform: translateY(-1px);
}

.wcpc-add-to-cart:disabled,
.wcpc-add-to-cart.wcpc-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #94a3b8;
}

.wcpc-add-to-cart:disabled:hover,
.wcpc-add-to-cart.wcpc-btn-disabled:hover {
    transform: none;
    background: #94a3b8;
}

/* ===========================================
   VALIDATION MESSAGES
   =========================================== */

.wcpc-validation-message {
    display: none;
    margin-bottom: 12px;
}

.wcpc-validation-message.active {
    display: block;
}

.wcpc-validation-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--wcpc-radius);
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.wcpc-validation-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.wcpc-validation-list {
    flex: 1;
}

.wcpc-validation-item {
    font-size: 13px;
    color: #991b1b;
    margin-bottom: 4px;
    cursor: pointer;
    transition: var(--wcpc-transition);
    padding: 4px 6px;
    border-radius: 4px;
}

.wcpc-validation-item:last-child {
    margin-bottom: 0;
}

.wcpc-validation-item:hover {
    background: rgba(220, 38, 38, 0.1);
}

.wcpc-validation-item strong {
    color: #7f1d1d;
}

/* Step validation indicators */
.wcpc-step-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.wcpc-status-incomplete {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.wcpc-status-complete {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Step visual states */
.wcpc-step.wcpc-step-invalid .wcpc-step-header {
    border-left: 3px solid #dc2626;
}

.wcpc-step.wcpc-step-valid .wcpc-step-header {
    border-left: 3px solid #16a34a;
}

.wcpc-add-to-cart.loading {
    pointer-events: none;
}

/* Animation shake pour les variations non sélectionnées */
@keyframes wcpc-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.wcpc-shake {
    animation: wcpc-shake 0.5s ease-in-out;
    border-color: var(--wcpc-error) !important;
}

/* Option avec variation requise */
.wcpc-option.wcpc-variation-required {
    border-color: var(--wcpc-error);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.wcpc-option.wcpc-variation-required .wcpc-variation-select {
    border-color: var(--wcpc-error);
}

/* Message d'aide pour les variations */
.wcpc-variation-hint {
    font-size: 11px;
    color: var(--wcpc-muted);
    margin-top: 4px;
    font-style: italic;
}

.wcpc-secondary-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.wcpc-secondary-actions button {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wcpc-bg);
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius);
    cursor: pointer;
    color: var(--wcpc-text-light);
    transition: var(--wcpc-transition);
}

.wcpc-secondary-actions button:hover {
    background: var(--wcpc-bg-alt);
    color: var(--wcpc-primary);
    border-color: var(--wcpc-primary);
}

/* Modals */
.wcpc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.wcpc-modal.active {
    display: flex;
}

.wcpc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.wcpc-modal-content {
    position: relative;
    background: var(--wcpc-bg);
    border-radius: var(--wcpc-radius);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--wcpc-shadow-lg);
}

.wcpc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--wcpc-text-light);
    cursor: pointer;
    padding: 4px;
}

.wcpc-modal-content h3 {
    margin: 0 0 20px;
    font-size: 20px;
}

/* Lightbox */
.wcpc-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.wcpc-lightbox.active {
    display: flex;
}

.wcpc-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
}

.wcpc-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.wcpc-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--wcpc-radius);
}

.wcpc-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Save form */
.wcpc-save-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.wcpc-save-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius-sm);
    margin-bottom: 16px;
    font-size: 15px;
}

.wcpc-save-confirm {
    width: 100%;
    padding: 12px;
    background: var(--wcpc-primary);
    color: white;
    border: none;
    border-radius: var(--wcpc-radius);
    font-weight: 600;
    cursor: pointer;
}

/* Share */
.wcpc-share-url {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.wcpc-share-url input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--wcpc-border);
    border-radius: var(--wcpc-radius-sm);
    font-size: 13px;
}

.wcpc-copy-url {
    padding: 12px 20px;
    background: var(--wcpc-primary);
    color: white;
    border: none;
    border-radius: var(--wcpc-radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.wcpc-share-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.wcpc-share-buttons a {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: var(--wcpc-transition);
}

.wcpc-share-facebook { background: #1877f2; }
.wcpc-share-twitter { background: #1da1f2; }
.wcpc-share-whatsapp { background: #25d366; }
.wcpc-share-email { background: var(--wcpc-secondary); }

.wcpc-share-buttons a:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Saved sidebar */
.wcpc-saved-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    display: none;
}

.wcpc-saved-sidebar.active {
    display: block;
}

.wcpc-saved-sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.wcpc-saved-sidebar-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 100%;
    height: 100%;
    background: var(--wcpc-bg);
    box-shadow: var(--wcpc-shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.wcpc-saved-sidebar.active .wcpc-saved-sidebar-content {
    transform: translateX(0);
}

.wcpc-saved-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--wcpc-border);
}

.wcpc-saved-sidebar-header h3 {
    margin: 0;
}

.wcpc-saved-sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--wcpc-text-light);
}

.wcpc-saved-sidebar-list {
    padding: 20px;
    overflow-y: auto;
    height: calc(100% - 70px);
}

.wcpc-saved-config-item {
    padding: 16px;
    background: var(--wcpc-bg-alt);
    border-radius: var(--wcpc-radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--wcpc-transition);
}

.wcpc-saved-config-item:hover {
    background: #f1f5f9;
}

.wcpc-saved-config-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.wcpc-saved-config-date {
    font-size: 12px;
    color: var(--wcpc-text-light);
}

.wcpc-saved-config-total {
    font-weight: 600;
    color: var(--wcpc-primary);
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 992px) {
    .wcpc-main {
        grid-template-columns: 1fr;
    }
    
    .wcpc-summary {
        position: static;
    }
    
    .wcpc-progress-steps {
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .wcpc-configurator {
        padding: 12px;
    }
    
    .wcpc-header {
        flex-direction: column;
    }
    
    .wcpc-title {
        font-size: 22px;
    }
    
    .wcpc-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .wcpc-option {
        padding: 10px;
    }
    
    .wcpc-option-title {
        font-size: 13px;
    }
    
    .wcpc-summary-inner {
        padding: 16px;
    }
    
    .wcpc-add-to-cart {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .wcpc-options-grid {
        grid-template-columns: 1fr;
    }
    
    .wcpc-progress-step-title {
        display: none;
    }
}

/* Animations */
@keyframes wcpc-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.wcpc-add-to-cart.success {
    animation: wcpc-pulse 0.3s ease;
    background: var(--wcpc-success);
}

/* ===========================================
   PRODUCT DETAIL POPUP
   =========================================== */

.wcpc-product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wcpc-product-popup.active {
    display: flex;
}

.wcpc-product-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--wcpc-popup-overlay, rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(4px);
}

.wcpc-product-popup-content {
    position: relative;
    background: var(--wcpc-popup-bg, white);
    border-radius: var(--wcpc-popup-radius, 16px);
    max-width: var(--wcpc-popup-max-width, 60%);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: wcpc-popup-in 0.3s ease;
    border: 1px solid var(--wcpc-popup-border, var(--wcpc-border));
}

@keyframes wcpc-popup-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wcpc-product-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: var(--wcpc-popup-bg, white);
    border: 1px solid var(--wcpc-popup-border, var(--wcpc-border));
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: var(--wcpc-transition);
    color: var(--wcpc-popup-close, #64748b);
}

.wcpc-product-popup-close:hover {
    background: var(--wcpc-error);
    color: white;
    border-color: var(--wcpc-error);
}

.wcpc-product-popup-inner {
    max-height: 90vh;
    overflow-y: auto;
}

.wcpc-product-popup-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
    color: var(--wcpc-popup-text, var(--wcpc-text-light));
}

.wcpc-product-popup-loading .wcpc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--wcpc-popup-border, var(--wcpc-border));
    border-top-color: var(--wcpc-popup-price, var(--wcpc-primary));
    border-radius: 50%;
    animation: wcpc-spin 0.8s linear infinite;
}

@keyframes wcpc-spin {
    to { transform: rotate(360deg); }
}

/* Product Detail Layout */
.wcpc-product-detail {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 0;
}

.wcpc-product-gallery {
    background: var(--wcpc-popup-header-bg, var(--wcpc-bg-alt));
    padding: 24px;
}

.wcpc-product-main-image {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    margin-bottom: 12px;
}

.wcpc-product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wcpc-product-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wcpc-product-thumb {
    width: 50px;
    height: 50px;
    border: 2px solid var(--wcpc-border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: white;
    transition: var(--wcpc-transition);
}

.wcpc-product-thumb:hover,
.wcpc-product-thumb.active {
    border-color: var(--wcpc-primary);
}

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

.wcpc-product-no-image {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wcpc-bg);
    border-radius: 12px;
    color: var(--wcpc-border);
}

/* Product Info */
.wcpc-product-info {
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
}

.wcpc-product-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--wcpc-popup-title, var(--wcpc-text));
    padding-right: 40px;
}

.wcpc-product-price {
    font-size: 22px;
    font-weight: 600;
    color: var(--wcpc-popup-price, var(--wcpc-primary));
    margin-bottom: 16px;
}

.wcpc-product-price del {
    color: var(--wcpc-popup-text, var(--wcpc-text-light));
    font-size: 16px;
    margin-right: 8px;
}

.wcpc-product-price ins {
    text-decoration: none;
}

.wcpc-product-stock {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.wcpc-stock-instock {
    background: #dcfce7;
    color: #166534;
}

.wcpc-stock-outofstock {
    background: #fee2e2;
    color: #991b1b;
}

.wcpc-stock-onbackorder {
    background: #fef3c7;
    color: #92400e;
}

.wcpc-product-sku {
    font-size: 13px;
    color: var(--wcpc-popup-text, var(--wcpc-text-light));
    margin-bottom: 16px;
}

.wcpc-product-short-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--wcpc-popup-text, var(--wcpc-text));
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--wcpc-popup-border, var(--wcpc-border));
}

.wcpc-product-short-desc p:last-child {
    margin-bottom: 0;
}

.wcpc-product-attributes {
    margin-bottom: 20px;
}

.wcpc-product-attributes h4,
.wcpc-product-description h4 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wcpc-text-light);
    margin: 0 0 12px;
}

.wcpc-product-attributes table {
    width: 100%;
    border-collapse: collapse;
}

.wcpc-product-attributes th,
.wcpc-product-attributes td {
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--wcpc-border);
}

.wcpc-product-attributes th {
    font-weight: 600;
    color: var(--wcpc-text);
    width: 40%;
}

.wcpc-product-attributes td {
    color: var(--wcpc-text-light);
}

.wcpc-product-description {
    margin-bottom: 20px;
}

.wcpc-product-desc-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--wcpc-text);
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.wcpc-product-desc-content p:last-child {
    margin-bottom: 0;
}

.wcpc-product-link {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--wcpc-border);
}

.wcpc-btn-view-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--wcpc-popup-btn-bg, var(--wcpc-primary));
    color: var(--wcpc-popup-btn-text, white);
    text-decoration: none;
    border-radius: var(--wcpc-radius);
    font-weight: 500;
    transition: var(--wcpc-transition);
}

.wcpc-btn-view-product:hover {
    background: var(--wcpc-popup-btn-hover, var(--wcpc-primary-hover));
    color: var(--wcpc-popup-btn-text, white);
}

/* Responsive Popup */
@media (max-width: 768px) {
    .wcpc-product-popup {
        padding: 10px;
    }
    
    .wcpc-product-detail {
        grid-template-columns: 1fr;
    }
    
    .wcpc-product-gallery {
        padding: 20px;
    }
    
    .wcpc-product-info {
        padding: 20px;
        max-height: none;
    }
    
    .wcpc-product-title {
        font-size: 20px;
    }
    
    .wcpc-product-popup-close {
        top: 10px;
        right: 10px;
    }
}

/* ==========================================================================
   Cart Styles for WCPC Configurations
   ========================================================================== */

/* Quantité non modifiable pour configurations et produits gratuits */
.wcpc-config-qty,
.wcpc-free-product-qty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    min-width: 40px;
}

.wcpc-config-qty {
    background: #f1f5f9;
    color: #475569;
}

.wcpc-free-product-qty {
    background: #f0fdf4;
    color: #166534;
}

/* Masquer les contrôles de quantité natifs pour les items WCPC */
/* Ciblage générique pour tous les thèmes */
.woocommerce-cart-form .cart_item .wcpc-config-qty ~ .quantity,
.woocommerce-cart-form .cart_item .wcpc-free-product-qty ~ .quantity,
.woocommerce-cart-form .cart_item .wcpc-config-qty + .quantity,
.woocommerce-cart-form .cart_item .wcpc-free-product-qty + .quantity {
    display: none !important;
}

/* Woostify et autres thèmes: masquer les +/- et input si on a notre span */
.cart_item:has(.wcpc-config-qty) .quantity,
.cart_item:has(.wcpc-free-product-qty) .quantity,
.cart_item:has(.wcpc-config-qty) .product-quantity .quantity,
.cart_item:has(.wcpc-free-product-qty) .product-quantity .quantity {
    display: none !important;
}

/* Si :has n'est pas supporté, on utilise JS (fallback) */
.wcpc-qty-hidden .quantity {
    display: none !important;
}

/* Mini-cart styles */
.woocommerce-mini-cart-item .wcpc-config-qty,
.woocommerce-mini-cart-item .wcpc-free-product-qty {
    font-size: 0.85em;
    padding: 2px 8px;
}

/* Page checkout - order review */
.woocommerce-checkout-review-order-table .wcpc-config-qty,
.woocommerce-checkout-review-order-table .wcpc-free-product-qty {
    font-size: 0.9em;
}

/* Conditions - Étapes masquées */
.wcpc-step-hidden {
    display: none !important;
}

.wcpc-nav-hidden {
    display: none !important;
}

.wcpc-progress-step-hidden {
    display: none !important;
}

