/**
 * Configurateur AJAX Systems - Styles
 * Design professionnel bleu
 */

:root {
    --ajax-primary: #1a5fb4;
    --ajax-primary-dark: #0d4a8c;
    --ajax-primary-light: #3584e4;
    --ajax-secondary: #2ec4b6;
    --ajax-success: #26a269;
    --ajax-warning: #e5a50a;
    --ajax-danger: #c01c28;
    --ajax-text: #1e1e1e;
    --ajax-text-light: #5e5e5e;
    --ajax-bg: #ffffff;
    --ajax-bg-light: #f6f5f4;
    --ajax-border: #deddda;
    --ajax-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --ajax-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --ajax-radius: 8px;
    --ajax-radius-lg: 12px;
}

/* Bloquer le scroll quand modal ouvert */
body.modal-open {
    overflow: hidden !important;
}

/* ==================== Filtres HUB ==================== */

.hub-filters {
    background: linear-gradient(135deg, #1a5fb4 0%, #0d4a8c 100%);
    border-radius: var(--ajax-radius-lg);
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(26, 95, 180, 0.3);
}

.filters-label {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(5px);
}

.filter-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: white;
    border-color: white;
    color: var(--ajax-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.filter-btn .filter-icon {
    font-size: 18px;
}

/* ==================== Badges promotionnels sur HUB ==================== */

.hub-badges-container {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hub-promo-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 12px 12px 0 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hub-promo-badge:first-child {
    border-radius: 12px 12px 0 0;
}

.hub-promo-badge:last-child {
    border-radius: 0;
}

.hub-promo-badge:only-child {
    border-radius: 12px 12px 0 0;
}

.hub-promo-badge .badge-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.hub-promo-badge .badge-text {
    flex: 1;
}

/* Positionner la carte HUB pour les badges absolus */
.hub-card {
    position: relative;
    overflow: visible;
}

/* Ajuster la carte quand il y a des badges */
.hub-card .hub-badges-container ~ .product-image {
    border-radius: 0 0 0 0;
}

.product-card.hub-card {
    padding-top: 0;
    overflow: hidden;
    border-radius: var(--ajax-radius-lg);
}

/* ==================== Layout général ==================== */

.ajax-configurator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ==================== Indicateur d'étapes ==================== */

.configurator-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    margin-bottom: 30px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ajax-border);
    color: var(--ajax-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.step.active .step-number,
.step.completed .step-number {
    background: var(--ajax-primary);
    color: white;
}

.step.completed .step-number::after {
    content: '✓';
}

.step-label {
    margin-top: 8px;
    font-size: 14px;
    color: var(--ajax-text-light);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--ajax-primary);
}

.step-line {
    width: 100px;
    height: 3px;
    background: var(--ajax-border);
    margin: 0 20px;
    margin-bottom: 25px;
    transition: background 0.3s ease;
}

.step-line.completed {
    background: var(--ajax-primary);
}

/* ==================== Contenu des étapes ==================== */

.configurator-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.configurator-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.configurator-step h2 {
    color: var(--ajax-text);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.step-description {
    color: var(--ajax-text-light);
    text-align: center;
    margin-bottom: 30px;
    font-size: 16px;
}

/* ==================== Grille de produits ==================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.hubs-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ==================== Carte produit ==================== */

.product-card {
    background: var(--ajax-bg);
    border: 1px solid var(--ajax-border);
    border-radius: var(--ajax-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: var(--ajax-shadow-lg);
    transform: translateY(-2px);
    border-color: var(--ajax-primary-light);
}

.product-card.selected {
    border-color: var(--ajax-primary);
    box-shadow: 0 0 0 2px var(--ajax-primary);
}

/* ==================== Produits incompatibles ==================== */

.product-card.incompatible {
    opacity: 0.6;
    border-color: var(--ajax-danger);
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
    position: relative;
    cursor: not-allowed;
}

.product-card.incompatible:hover {
    transform: none;
    box-shadow: var(--ajax-shadow);
    border-color: var(--ajax-danger);
}

.product-card.incompatible .product-image {
    filter: grayscale(50%);
}

.product-card.incompatible .product-image img {
    opacity: 0.7;
}

.incompatible-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--ajax-danger);
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.incompatible-icon {
    font-size: 14px;
}

.incompatible-message {
    background: #fff5f5;
    border: 1px solid var(--ajax-danger);
    border-radius: var(--ajax-radius);
    padding: 12px;
    margin-top: 10px;
}

.incompatible-message p {
    margin: 0;
    color: var(--ajax-danger);
    font-size: 13px;
    line-height: 1.4;
}

.product-card.incompatible .product-name {
    color: var(--ajax-text-light);
}

.product-card.incompatible .price-final {
    color: var(--ajax-text-light);
}

.product-card.incompatible .variant-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card.incompatible .variant-btn:hover {
    background: var(--ajax-bg);
    border-color: var(--ajax-border);
}

.product-image {
    width: 100%;
    height: 200px;
    background: var(--ajax-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.no-image {
    color: var(--ajax-text-light);
    font-size: 14px;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--ajax-text);
    margin-bottom: 8px;
}

.product-description {
    font-size: 14px;
    color: var(--ajax-text-light);
    margin-bottom: 15px;
    line-height: 1.5;
}

/* ==================== Déclinaisons ==================== */

.product-variants {
    margin-bottom: 15px;
}

.product-variants label {
    display: block;
    font-size: 13px;
    color: var(--ajax-text-light);
    margin-bottom: 8px;
}

.variant-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.variant-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--ajax-border);
    border-radius: 25px;
    background: var(--ajax-bg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-btn::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}

/* Premier bouton = Blanc */
.variant-options .variant-btn:first-child::before {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    box-shadow: inset 0 0 0 2px #ddd;
}

/* Second bouton = Noir */
.variant-options .variant-btn:nth-child(2)::before {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

.variant-btn:hover {
    border-color: var(--ajax-primary);
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.variant-btn.selected {
    border-color: var(--ajax-primary);
    background: linear-gradient(135deg, var(--ajax-primary) 0%, var(--ajax-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 95, 180, 0.35);
}

.variant-btn.selected::before {
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
}

/* ==================== Prix ==================== */

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.price-original {
    text-decoration: line-through;
    color: var(--ajax-text-light);
    font-size: 14px;
}

.price-discount {
    background: var(--ajax-danger);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.price-final {
    font-size: 22px;
    font-weight: 700;
    color: var(--ajax-primary);
}

/* ==================== Boutons ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--ajax-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn i, .btn .material-icons {
    font-size: 18px;
}

.btn-primary {
    background: var(--ajax-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--ajax-primary-dark);
}

.btn-secondary {
    background: var(--ajax-bg-light);
    color: var(--ajax-text);
    border: 1px solid var(--ajax-border);
}

.btn-secondary:hover {
    background: var(--ajax-border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--ajax-primary);
    padding: 0;
    text-decoration: underline;
}

.select-hub-btn {
    width: 100%;
}

/* ==================== Sélecteur de quantité mini ==================== */

.product-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--ajax-bg-light);
    border-radius: var(--ajax-radius);
}

.product-quantity label {
    font-size: 13px;
    color: var(--ajax-text-light);
    margin: 0;
}

.quantity-selector-mini {
    display: flex;
    align-items: center;
    border: 1px solid var(--ajax-border);
    border-radius: var(--ajax-radius);
    overflow: hidden;
    background: white;
}

.qty-btn-mini {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--ajax-bg-light);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--ajax-text);
}

.qty-btn-mini:hover {
    background: var(--ajax-primary-light);
    color: white;
}

.qty-btn-mini:active {
    background: var(--ajax-primary);
}

.qty-input-mini {
    width: 45px;
    height: 32px;
    border: none;
    border-left: 1px solid var(--ajax-border);
    border-right: 1px solid var(--ajax-border);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ajax-text);
}

.qty-input-mini::-webkit-inner-spin-button,
.qty-input-mini::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input-mini[type=number] {
    -moz-appearance: textfield;
}

/* ==================== Étape 2 Header ==================== */

.step2-header {
    margin-bottom: 30px;
}

.selected-hub-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
    border-radius: var(--ajax-radius-lg);
    border: 2px solid var(--ajax-primary-light);
}

.hub-thumbnail {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: var(--ajax-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hub-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hub-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hub-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--ajax-text-light);
    letter-spacing: 0.5px;
}

.hub-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--ajax-primary-dark);
}

/* ==================== Grille de catégories ==================== */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.category-card {
    background: #ffffff;
    border: 2px solid #e8ecf0;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.category-card:hover {
    border-color: var(--ajax-primary);
    box-shadow: 0 8px 25px rgba(26, 95, 180, 0.15);
    transform: translateY(-3px);
}

.category-card.has-selection {
    border-color: var(--ajax-success);
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.category-card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--ajax-primary) 0%, var(--ajax-primary-dark) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(26, 95, 180, 0.25);
}

/* Icônes des catégories */
.icon-door::before { content: '🚪'; }
.icon-motion::before { content: '📡'; }
.icon-siren::before { content: '🔔'; }
.icon-keyboard::before { content: '⌨️'; }
.icon-camera::before { content: '📹'; }
.icon-fire::before { content: '🔥'; }
.icon-water::before { content: '💧'; }
.icon-signal::before { content: '📶'; }
.icon-automation::before { content: '⚡'; }
.icon-accessories::before { content: '🔧'; }

.category-card-content {
    flex: 1;
}

.category-card-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--ajax-text);
    margin: 0 0 6px 0;
}

.category-card-content p {
    font-size: 13px;
    color: var(--ajax-text-light);
    margin: 0;
    line-height: 1.4;
}

.category-card-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 28px;
    height: 28px;
    background: var(--ajax-success);
    color: white;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    box-shadow: 0 2px 8px rgba(38, 162, 105, 0.4);
}

.category-card.has-selection .category-card-badge {
    display: flex;
}

/* ==================== Modal produits (centrée) ==================== */

.products-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    z-index: 9000;
    flex-direction: column;
    overflow: hidden;
}

.products-panel.open {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.products-panel-header {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--ajax-primary) 0%, var(--ajax-primary-dark) 100%);
    color: white;
    flex-shrink: 0;
}

.panel-back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.2s;
}

.panel-back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(-3px);
}

.panel-title {
    flex: 1;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: white;
    text-align: center;
}

.panel-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.panel-close-btn:hover {
    background: rgba(255,0,0,0.7);
    transform: rotate(90deg);
}

.products-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: var(--ajax-bg-light);
}

.products-panel-content .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Overlay pour la modal */
.panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 8999;
    backdrop-filter: blur(4px);
}

.panel-overlay.open {
    display: block;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== Spinner chargement ==================== */

.products-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
    color: var(--ajax-text-light);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--ajax-border);
    border-top-color: var(--ajax-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Actions étapes ==================== */

.step-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 30px;
    border-top: 1px solid var(--ajax-border);
    margin-top: 30px;
}

/* ==================== Récapitulatif (Étape 3) ==================== */

.configuration-summary {
    background: var(--ajax-bg-light);
    border-radius: var(--ajax-radius-lg);
    padding: 30px;
    margin-bottom: 30px;
}

.summary-hub,
.summary-equipments {
    margin-bottom: 25px;
}

.summary-hub h3,
.summary-equipments h3 {
    font-size: 16px;
    color: var(--ajax-text-light);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-product {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: var(--ajax-radius);
    margin-bottom: 10px;
}

.summary-product-image {
    width: 60px;
    height: 60px;
    background: var(--ajax-bg-light);
    border-radius: var(--ajax-radius);
    overflow: hidden;
    flex-shrink: 0;
}

.summary-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.summary-product-info {
    flex: 1;
}

.summary-product-name {
    font-weight: 600;
    color: var(--ajax-text);
    margin-bottom: 4px;
}

.summary-product-variant {
    font-size: 13px;
    color: var(--ajax-text-light);
}

.summary-product-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-product-qty {
    background: var(--ajax-bg-light);
    padding: 4px 12px;
    border-radius: var(--ajax-radius);
    font-size: 13px;
}

.summary-product-price {
    font-weight: 600;
    color: var(--ajax-primary);
    min-width: 80px;
    text-align: right;
}

.summary-product-remove {
    background: none;
    border: none;
    color: var(--ajax-danger);
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
}

.summary-total {
    padding-top: 20px;
    border-top: 2px solid var(--ajax-border);
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
}

.total-price {
    font-size: 28px;
    color: var(--ajax-primary);
}

.total-info {
    text-align: right;
    font-size: 13px;
    color: var(--ajax-text-light);
    margin-top: 5px;
}

/* ==================== Login requis ==================== */

.login-required {
    text-align: center;
    padding: 20px;
    background: var(--ajax-bg-light);
    border-radius: var(--ajax-radius);
}

.login-required p {
    margin-bottom: 15px;
    color: var(--ajax-text-light);
}

/* ==================== Panier flottant ==================== */

.floating-summary {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.floating-summary-toggle {
    width: 60px;
    height: 60px;
    background: var(--ajax-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: var(--ajax-shadow-lg);
    position: relative;
    transition: transform 0.2s ease;
}

.floating-summary-toggle:hover {
    transform: scale(1.05);
}

.floating-summary-toggle .items-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--ajax-danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-summary-content {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: var(--ajax-radius-lg);
    box-shadow: var(--ajax-shadow-lg);
    overflow: hidden;
}

.floating-summary.open .floating-summary-content {
    display: block;
}

.floating-summary-content h4 {
    padding: 15px 20px;
    background: var(--ajax-primary);
    color: white;
    margin: 0;
    font-size: 16px;
}

.floating-items {
    max-height: 280px;
    overflow-y: auto;
    padding: 15px;
}

.floating-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ajax-border);
}

.floating-item:last-child {
    border-bottom: none;
}

.floating-item-name {
    flex: 1;
    font-size: 14px;
}

.floating-item-qty {
    background: var(--ajax-bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.floating-item-price {
    font-weight: 600;
    color: var(--ajax-primary);
}

.floating-total {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--ajax-bg-light);
    font-weight: 600;
}

.floating-price {
    color: var(--ajax-primary);
    font-size: 18px;
}

/* ==================== Modal produit ==================== */

.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99990;
}

.product-modal.open {
    display: block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    opacity: 0.95;
    z-index: 99998;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: row;
    z-index: 99999;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffffff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--ajax-danger);
    color: white;
}

.modal-image-wrapper {
    width: 380px;
    min-width: 380px;
    background: #f0f3f7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-right: 1px solid #e0e0e0;
}

.modal-product-image {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-product-image .no-image {
    color: #999;
    font-size: 14px;
}

.modal-info-wrapper {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.modal-product-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1a1a1a;
    padding-right: 40px;
}

.modal-product-description {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.6;
    font-size: 14px;
}

.modal-product-variants {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 10px;
}

.modal-product-variants:empty {
    display: none;
}

.modal-product-variants label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.modal-product-variants .variant-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-product-variants .variant-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-product-variants .variant-btn:hover {
    border-color: var(--ajax-primary);
}

.modal-product-variants .variant-btn.selected {
    border-color: var(--ajax-primary);
    background: var(--ajax-primary);
    color: white;
}

.modal-product-price {
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-price-original {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
}

.modal-price-discount {
    background: #e53935;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
}

.modal-price-final {
    font-size: 32px;
    font-weight: 800;
    color: var(--ajax-primary);
}

.modal-product-quantity {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 10px;
}

.modal-product-quantity .qty-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.modal-product-quantity .quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.modal-product-quantity .qty-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #f0f0f0;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-product-quantity .qty-btn:hover {
    background: #e0e0e0;
}

.modal-product-quantity .qty-input {
    width: 60px;
    height: 44px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.modal-product-quantity .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--ajax-border);
    border-radius: var(--ajax-radius);
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--ajax-bg-light);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: var(--ajax-border);
}

.qty-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.modal-add-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    margin-top: auto;
    border-radius: 10px;
    background: var(--ajax-primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-add-btn:hover {
    background: var(--ajax-primary-dark);
}

/* ==================== Responsive ==================== */

@media (max-width: 850px) {
    .modal-content {
        flex-direction: column;
        max-height: 95vh;
    }

    .modal-image-wrapper {
        width: 100%;
        min-width: auto;
        height: 250px;
        padding: 20px;
    }

    .modal-product-image {
        height: 200px;
    }

    .modal-info-wrapper {
        padding: 20px;
    }

    .modal-product-name {
        font-size: 20px;
    }

    .modal-price-final {
        font-size: 26px;
    }
}

@media (max-width: 768px) {
    .configurator-steps {
        flex-wrap: wrap;
        gap: 10px;
    }

    .step-line {
        display: none;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Filtres sur mobile */
    .hub-filters {
        padding: 15px;
    }

    .filters-list {
        flex-direction: column;
        gap: 8px;
    }

    .filter-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }

    /* Badges sur mobile */
    .hub-promo-badge {
        font-size: 11px;
        padding: 8px 12px;
    }

    .hub-promo-badge .badge-icon {
        font-size: 14px;
    }

    /* Modal catégorie sur mobile */
    .products-panel {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .products-panel.open {
        animation: none;
    }

    .products-panel-header {
        padding: 15px 20px;
    }

    .panel-title {
        font-size: 18px;
    }

    .panel-back-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .products-panel-content {
        padding: 15px;
    }

    .products-panel-content .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-content {
        width: 98%;
        max-height: 98vh;
        margin: 5px;
    }

    .modal-body {
        padding: 20px;
        gap: 20px;
    }

    .modal-product-image {
        height: 220px;
    }

    .modal-product-name {
        font-size: 20px;
    }

    .modal-product-description {
        font-size: 14px;
    }

    .modal-product-price {
        font-size: 24px;
    }

    .step-actions {
        flex-direction: column;
        gap: 15px;
    }

    .step-actions .btn {
        width: 100%;
    }

    .summary-product {
        flex-wrap: wrap;
    }

    .floating-summary-content {
        width: calc(100vw - 40px);
        right: -10px;
    }
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.cart-restored-notification {
    font-family: 'Roboto', Arial, sans-serif;
}

.cart-restored-notification .notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-restored-notification .material-icons {
    font-size: 24px;
}

.cart-restored-notification .notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.cart-restored-notification .notification-close:hover {
    opacity: 1;
}

/* ============================================
   MODAL CROSS-SELL (VENTES ADDITIONNELLES)
   ============================================ */
.crosssell-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.crosssell-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.crosssell-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.crosssell-modal .modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crosssell-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.crosssell-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.crosssell-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2980b9 100%);
    color: #fff;
}

.crosssell-header i {
    font-size: 40px;
    opacity: 0.9;
}

.crosssell-header-text h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
}

.crosssell-header-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.85;
}

.crosssell-products {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.crosssell-product {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.crosssell-product:hover {
    border-color: #2980b9;
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.15);
}

.crosssell-product-image {
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.crosssell-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.crosssell-product-image .no-image {
    color: #ccc;
}

.crosssell-product-image .no-image i {
    font-size: 32px;
}

.crosssell-product-info {
    flex: 1;
    min-width: 0;
}

.crosssell-product-name {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.crosssell-product-variants {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.crosssell-product-variants .variant-btn {
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crosssell-product-variants .variant-btn:hover {
    border-color: #2980b9;
}

.crosssell-product-variants .variant-btn.selected {
    background: #2980b9;
    color: #fff;
    border-color: #2980b9;
}

.crosssell-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #2980b9;
}

.crosssell-add-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
    transition: all 0.2s ease;
}

.crosssell-add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.crosssell-add-btn i {
    font-size: 24px;
}

.crosssell-actions {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.crosssell-skip-btn {
    padding: 12px 30px;
    font-size: 14px;
    color: #666;
    border: 1px solid #ddd;
    background: transparent;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crosssell-skip-btn:hover {
    background: #fff;
    border-color: #999;
    color: #333;
}

/* Responsive */
@media (max-width: 576px) {
    .crosssell-modal .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 15px;
    }

    .crosssell-header {
        padding: 20px;
    }

    .crosssell-header i {
        font-size: 32px;
    }

    .crosssell-header-text h3 {
        font-size: 18px;
    }

    .crosssell-product {
        flex-wrap: wrap;
    }

    .crosssell-product-image {
        width: 60px;
        height: 60px;
    }

    .crosssell-product-info {
        flex: 1;
        min-width: calc(100% - 140px);
    }

    .crosssell-add-btn {
        width: 100%;
        border-radius: 8px;
        margin-top: 10px;
    }
}
