/* Styles spécifiques au configurateur */

/* Structure principale */
.configurator-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Barre de navigation spécifique au configurateur */
.configurator-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    height: 64px; /* Hauteur augmentée pour accommoder le logo plus grand */
    background-color: #171a20;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

/* Logo dans la navbar */
.configurator-logo {
    height: 100%;
    display: flex;
    align-items: center;
    margin-right: 15px; /* Espace entre le logo et le titre */
}

.logo-link {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.05); /* Léger effet d'agrandissement au survol */
}

.navbar-logo-img {
    height: 80px; /* Taille ajustée du logo */
    width: auto;
    padding: 4px 0;
    filter: brightness(1.1); /* Rend le logo légèrement plus lumineux */
}

/* Titre du produit dans la navbar */
.product-title {
    color: white;
    font-size: 22px; /* Taille augmentée pour équilibrer avec le logo plus grand */
    font-weight: 500;
    flex: 1;
    text-align: center;
}

/* Sélecteur de langue */
.lang-selector {
    display: flex;
    align-items: center;
}

.lang-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.lang-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Contenu du configurateur */
.configurator-content {
    display: flex;
    margin-top: 64px; /* Ajusté pour la nouvelle hauteur de navbar */
    height: calc(100vh - 64px);
}

/* Conteneur de visualisation du modèle */
.view-container {
    flex: 2.5;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.model-view {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: pan-x; /* Permet les swipes horizontaux sur mobile */
}

.model-image {
    max-width: 95%;
    max-height: 85vh;
    object-fit: contain;
    transition: all 0.7s ease;
    opacity: 1;
}

/* Animation pour l'image du modèle */
.animate-image {
    animation: fadeInScale 0.5s forwards;
}

/* Flèches de navigation */
.arrow-left, .arrow-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: background 0.3s;
}

.arrow-left {
    left: 20px;
}

.arrow-right {
    right: 20px;
}

.arrow-left:hover, .arrow-right:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Points indicateurs d'angle */
.angle-dots {
    display: flex;
    gap: 15px;
    justify-content: center;
    position: absolute;
    bottom: 30px;
    width: 100%;
}

.angle-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.angle-dot.active {
    background: #cc0000;
    transform: scale(1.2);
}

/* Panneau d'options */
.options-panel {
    flex: 1;
    background: white;
    padding: 30px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    height: 100%;
}

/* En-tête du modèle - Design simple et cohérent */
.model-header {
    margin-bottom: 15px;
    text-align: center;
    padding: 20px 10px 10px 10px;
}

.model-name {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2937;
}

.model-description {
    color: #6b7280;
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.5;
}

/* Spécifications techniques simples */
.specs {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    padding: 15px 0 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

.spec-item {
    text-align: center;
    flex: 1;
    max-width: 120px;
}

.spec-value {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.spec-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Groupes d'options simples */
.option-group {
    margin-bottom: 30px;
}

.option-group-title {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

/* Liste d'options */
.option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Option avec miniature - Style épuré et moderne avec alignement correct */
.option-item {
    display: flex;
    align-items: center;
    padding: 18px 16px;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.option-item:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Animation d'ajout améliorée */
.option-item.adding {
    animation: addingPulse 0.6s ease-out;
}

@keyframes addingPulse {
    0% {
        transform: scale(1);
        background-color: #f0fff4;
    }
    50% {
        transform: scale(1.02);
        background-color: #c6f6d5;
        border-color: #9ae6b4;
    }
    100% {
        transform: scale(1);
        background-color: transparent;
        border-color: transparent;
    }
}

/* Animation de retrait */
.option-item.removing {
    animation: removingFade 0.4s ease-out;
}

@keyframes removingFade {
    0% {
        transform: scale(1);
        background-color: #fff5f5;
    }
    50% {
        transform: scale(0.98);
        background-color: #fed7d7;
        border-color: #fc8181;
    }
    100% {
        transform: scale(1);
        background-color: transparent;
        border-color: transparent;
    }
}

.option-left-container {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
}

.option-thumbnail {
    width: 90px;
    height: 75px;
    background-color: transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: none;
}

.option-thumbnail img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    transition: transform 0.2s ease;
    opacity: 0;
    animation: fadeInImage 0.3s ease forwards;
}

.option-item:hover .option-thumbnail img {
    transform: scale(1.08);
}

.option-item-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.option-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    line-height: 1.3;
}

.option-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
    margin: 0;
}

/* Partie droite avec prix et bouton - Design moderne */
.option-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    min-width: 140px;
}

.option-price {
    font-size: 18px;
    font-weight: 700;
    color: #4b5563;
    text-align: right;
    margin: 0;
    min-width: 80px;
}

/* Boutons de sélection modernes - Design revu */
.option-select-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.option-select-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.option-select-btn.selected {
    background: linear-gradient(135deg, #f8d62b 0%, #ffc107 100%);
    border-color: #f8d62b;
    color: #212529;
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(248, 214, 43, 0.4);
}

/* Bouton toggle moderne - Design revu */
.option-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 90px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.option-toggle-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.option-toggle-btn.active {
    background: linear-gradient(135deg, #f8d62b 0%, #ffc107 100%);
    border-color: #f8d62b;
    color: #212529;
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(248, 214, 43, 0.4);
}

.toggle-icon {
    font-weight: 700;
    font-size: 13px;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.option-toggle-btn.active .toggle-icon {
    transform: rotate(45deg) scale(1.2);
}

/* Animation de clic pour les boutons */
.option-toggle-btn:active,
.option-select-btn:active {
    transform: translateY(0) scale(0.96);
}

/* Design du pack simplifié et élégant - Alignement corrigé */
.option-item[data-option="packTerrassement"] {
    background-color: #fffbf0;
    border: 2px solid #f8d62b;
    position: relative;
}

.option-item[data-option="packTerrassement"]:hover {
    background-color: #fff8e1;
    border-color: #f0c800;
    box-shadow: 0 4px 12px rgba(248, 214, 43, 0.2);
}

/* Badge PACK repositionné en overlay */
.option-item[data-option="packTerrassement"]::before {
    content: 'PACK';
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #f8d62b 0%, #f0c800 100%);
    color: #1a202c;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(248, 214, 43, 0.3);
    z-index: 2;
}

/* Texte du pack aligné normalement comme les autres */
.option-item[data-option="packTerrassement"] .option-name {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
    /* Suppression du padding-left pour alignement normal */
}

.option-item[data-option="packTerrassement"] .option-description {
    color: #4b5563;
    font-weight: 500;
    margin: 0;
    /* Suppression du padding-left pour alignement normal */
}

.option-item[data-option="packTerrassement"] .option-price {
    color: #059669;
    font-size: 18px;
    font-weight: 800;
}

/* Résumé et prix */
.summary {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.price-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.cta-button {
    background: #cc0000;
    color: white;
    border: none;
    padding: 15px 30px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.cta-button:hover {
    background: #b00000;
}

/* Animations */
@keyframes fadeInScale {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(204, 0, 0, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(204, 0, 0, 0);
    }
}

@keyframes fadeInImage {
    to {
        opacity: 1;
    }
}

/* État sélectionné pour les options */
.option-item.option-selected {
    background-color: #f0fff4;
    border-color: #9ae6b4;
    box-shadow: 0 2px 8px rgba(154, 230, 180, 0.2);
}

.option-item.option-selected .option-price {
    color: #38a169;
    font-weight: 800;
}

/* Animation de feedback visuel */
.option-item.flash-success {
    animation: flashSuccess 0.5s ease-out;
}

.option-item.flash-remove {
    animation: flashRemove 0.5s ease-out;
}

@keyframes flashSuccess {
    0% { background-color: transparent; }
    50% { 
        background-color: #c6f6d5;
        transform: scale(1.01);
    }
    100% { background-color: transparent; }
}

@keyframes flashRemove {
    0% { background-color: transparent; }
    50% { 
        background-color: #fed7d7;
        transform: scale(0.99);
    }
    100% { background-color: transparent; }
}

/* État "inclus dans le pack" pour les options */
.option-item.pack-included {
    background-color: #f0f9ff;
    border-color: #0ea5e9;
    position: relative;
}

.option-item.pack-included .option-toggle-btn {
    background-color: #f8d62b;
    border-color: #f8d62b;
    color: #1a202c;
    cursor: not-allowed;
    font-weight: 600;
}

.option-item.pack-included .option-toggle-btn:hover {
    background-color: #f8d62b;
    border-color: #f8d62b;
    transform: none;
}

/* Version Mobile */
@media (max-width: 768px) {
    .configurator-container.mobile-view {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .configurator-navbar {
        padding: 0 15px;
        height: 56px;
    }
    
    .navbar-logo-img {
        height: 40px;
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .configurator-content.mobile-layout {
        flex-direction: column;
        margin-top: 56px;
        height: auto;
    }
    
    .view-container {
        flex: none;
        height: 40vh;
        min-height: 250px;
    }
    
    .model-image {
        max-height: 100%;
    }
    
    .arrow-left, .arrow-right {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .angle-dots {
        bottom: 15px;
    }
    
    .angle-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Styles spécifiques Tesla-like pour mobile */
    .mobile-header {
        text-align: center;
        padding: 15px 0;
    }
    
    .mobile-header .model-name {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .mobile-header .model-description {
        font-size: 16px;
        color: #666;
    }
    
    .mobile-specs {
        display: flex;
        justify-content: space-around;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
        border-top: 1px solid #eee;
        margin: 0 10px 20px;
    }
    
    .mobile-spec {
        text-align: center;
        padding: 0 5px;
    }
    
    .mobile-spec .spec-value {
        font-size: 18px;
        font-weight: 600;
    }
    
    .mobile-spec .spec-label {
        font-size: 12px;
        color: #666;
    }
    
    .mobile-options-wrapper {
        padding: 0 15px;
    }
    
    .mobile-option-group {
        margin-bottom: 20px;
    }
    
    .option-group-header {
        margin-bottom: 10px;
    }
    
    .mobile-card-option {
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .mobile-option-item {
        display: flex;
        justify-content: space-between;
        padding: 15px;
        border-bottom: 1px solid #eee;
        position: relative;
    }
    
    .mobile-option-item:last-child {
        border-bottom: none;
    }
    
    /* NOUVEAUX STYLES POUR LES PACKS MOBILES */
    .mobile-pack-item {
        background-color: #fffbf0 !important;
        border: 2px solid #f8d62b !important;
        border-radius: 8px;
        margin-bottom: 8px;
        position: relative;
    }
    
    .mobile-pack-badge {
        position: absolute;
        top: 6px;
        left: 6px;
        background: linear-gradient(135deg, #f8d62b 0%, #f0c800 100%);
        color: #1a202c;
        font-size: 9px;
        font-weight: 700;
        padding: 3px 6px;
        border-radius: 4px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 4px rgba(248, 214, 43, 0.3);
        z-index: 2;
    }
    
    .mobile-pack-item .mobile-option-name {
        font-weight: 700 !important;
        color: #1f2937 !important;
        padding-top: 15px;
    }
    
    .mobile-pack-item .mobile-option-description {
        color: #4b5563 !important;
        font-weight: 500;
    }
    
    .mobile-pack-item .mobile-option-price {
        color: #059669 !important;
        font-weight: 800;
    }
    
    /* État "inclus dans le pack" pour les accessoires mobiles */
    .mobile-option-item.mobile-pack-included {
        background-color: #f0f9ff !important;
        border-color: #0ea5e9 !important;
        opacity: 0.8;
    }
    
    .mobile-toggle-slider.pack-included {
        background-color: #f8d62b !important;
        cursor: not-allowed;
    }
    
    .mobile-toggle-slider.pack-included:before {
        transform: translateX(18px);
    }
    
    .mobile-pack-included .mobile-toggle input {
        cursor: not-allowed;
    }
    
    /* Nouvel indicateur pack pour mobile */
    .mobile-pack-indicator {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
    }
    
    .mobile-pack-icon {
        font-size: 10px;
        background: linear-gradient(135deg, #f8d62b 0%, #f0c800 100%);
        padding: 2px 4px;
        border-radius: 3px;
        line-height: 1;
    }
    
    .mobile-option-left {
        flex: 1;
    }
    
    .mobile-option-name {
        font-weight: 500;
        margin-bottom: 3px;
    }
    
    .mobile-option-description {
        font-size: 12px;
        color: #666;
    }
    
    .mobile-option-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
    }
    
    .mobile-option-price {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .mobile-option-selector {
        width: 18px;
        height: 18px;
        border: 2px solid #ccc;
        border-radius: 50%;
        position: relative;
    }
    
    .mobile-option-selector.selected {
        border-color: #cc0000;
    }
    
    .mobile-option-selector.selected:after {
        content: "";
        position: absolute;
        width: 10px;
        height: 10px;
        background: #cc0000;
        border-radius: 50%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    /* Toggle switch style amélioré pour mobile */
    .mobile-toggle {
        position: relative;
        display: inline-block;
        width: 40px;
        height: 22px;
    }
    
    .mobile-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    
    .mobile-toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: .3s;
        border-radius: 22px;
    }
    
    .mobile-toggle-slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 2px;
        bottom: 2px;
        background-color: white;
        transition: .3s;
        border-radius: 50%;
    }
    
    .mobile-toggle input:checked + .mobile-toggle-slider {
        background-color: #cc0000;
    }
    
    .mobile-toggle input:checked + .mobile-toggle-slider:before {
        transform: translateX(18px);
    }
    
    /* Footer sticky */
    .mobile-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        z-index: 1000;
    }
    
    .mobile-price-container {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-price-label {
        font-size: 12px;
        color: #666;
    }
    
    .mobile-price-value {
        font-size: 20px;
        font-weight: 600;
    }
    
    .mobile-cta-button {
        background: #f8d62b; 
        color: white; 
        border: none;
        padding: 12px 30px;
        font-size: 16px;
        font-weight: 500;
        border-radius: 4px;
        min-width: 180px;
        text-align: center;
    }
    
    /* Ajout d'un espace en bas pour éviter que le contenu ne soit caché par le footer */
    .options-panel {
        padding-bottom: 80px;
    }
}

/* Responsive - Adaptation pour les écrans moyens */
@media (max-width: 1200px) {
    .option-item {
        padding: 16px 14px;
    }
    
    .option-thumbnail {
        width: 95px;
        height: 75px;
    }
    
    .option-left-container {
        gap: 14px;
        margin-right: 40px;
    }
    
    .option-name {
        font-size: 15px;
        margin-bottom: 7px;
    }
    
    .option-description {
        font-size: 13px;
    }
    
    .option-price {
        font-size: 16px;
        min-width: 75px;
        color: #4b5563;
    }
    
    .option-right {
        min-width: 120px;
    }
    
    .option-select-btn,
    .option-toggle-btn {
        min-width: 85px;
        font-size: 12px;
        padding: 8px 14px;
    }
    
    .model-header {
        padding: 15px 10px;
    }
    
    .model-name {
        font-size: 28px;
    }
    
    .specs {
        gap: 25px;
        padding: 15px 0;
    }
    
    .spec-value {
        font-size: 20px;
    }
}

/* Améliorations spécifiques pour certains produits */
.xp1000-configurator .option-toggle-btn.active,
.sjw25-configurator .option-toggle-btn.active,
.sjw18u-configurator .option-toggle-btn.active,
.xp1000-configurator .option-select-btn.selected,
.sjw25-configurator .option-select-btn.selected,
.sjw18u-configurator .option-select-btn.selected {
    background-color: #f8d62b;
    border-color: #f8d62b;
    color: #1a202c;
    font-weight: 600;
}