/**
 * Styles pour le système de gestion de projets configurateur
 */

/* ========================================
   Panneau de sauvegarde du projet
   ======================================== */

.project-save-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    max-width: 360px;
    width: calc(100% - 48px);
}
.save-panel-content {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border: 1px solid #eef2f7;
}

.save-panel-message {
    font-size: 14px;
    color: #334155;
    line-height: 1.45;
    margin-bottom: 12px;
}
.save-panel-message a {
    text-decoration: underline;
}
.save-panel-message p {
    margin-block-end: 0!important;
}

.save-panel-email label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #475569;
    font-weight: 600;
}

.save-panel-email input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
    margin-top: 8px;
}

.save-panel-email input[type="email"]:focus {
    outline: none;
    border-color: var(--main-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.save-panel-change-email {
    display: inline-block;
    font-size: 13px;
    color: var(--main-blue);
    text-decoration: none;
}

.save-panel-change-email:hover {
    text-decoration: underline;
}

.save-panel-actions {
    display: flex;
    justify-content: flex-end;
}

.lbad-save-project-btn {
    background: var(--blue);
    color: var(--main-blue);
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: normal;
}

.lbad-save-project-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.lbad-save-project-btn.is-saved {
    background: var(--vert);
    color: white;
    cursor: default;
    opacity: 0.85;
}

.lbad-save-project-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.lbad-save-project-btn .icon {
    margin-right: 5px;
}

#save-project-btn.is-view-cart {
    color: var(--main-blue);
    background: transparent;
    cursor: pointer;
}

#save-project-btn.is-view-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.config-steps-nav__link.is-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.config-step-done.config-steps-nav__item .config-step__number{
    background: var(--main-blue);
    color: white;
    font-weight: 700;
}

/* ========================================
   Modales
   ======================================== */

.lbad-save-modal,
.lbad-project-conflict-modal,
.lbad-success-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content,
.notice-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-content h3,
.notice-content h4 {
    margin: 0 0 15px;
    color: #333;
    font-size: 24px;
}

.modal-content p {
    margin: 0 0 20px;
    color: #666;
    line-height: 1.6;
}

/* ========================================
   Formulaires dans les modales
   ======================================== */

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.modal-content input[type="email"],
.modal-content input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--main-blue);
}

/* ========================================
   Boutons modales
   ======================================== */

.modal-actions,
.modal-content form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-actions button,
.modal-content button[type="submit"],
.modal-content .btn-secondary,
.notice-close {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.btn-resume {
    background: var(--vert);
    color: white;
}

.btn-resume:hover {
    background: #059669;
}

.btn-overwrite {
    background: #f59e0b;
    color: white;
}

.btn-overwrite:hover {
    background: #d97706;
}

.btn-new {
    background: var(--main-blue);
    color: white;
}

.btn-new:hover {
    background: var(--blue);
    color: var(--main-blue);
}

.btn-primary,
.modal-content button[type="submit"] {
    background: var(--main-blue);
    color: white;
}

.btn-primary:hover,
.modal-content button[type="submit"]:hover {
    background: var(--blue);
    color: var(--main-blue);
}

.btn-secondary {
    background: #e5e7eb;
    color: #666;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.notice-close {
    background: var(--vert);
    color: white;
    width: 100%;
}

.notice-close:hover {
    background: #059669;
}

/* ========================================
   Notice de succès
   ======================================== */

.lbad-success-notice .notice-content {
    max-width: 600px;
}

.lbad-success-notice h4 {
    color: var(--vert);
    font-size: 24px;
    margin-bottom: 15px;
}

.notice-links {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.notice-links .btn-link {
    flex: 1;
    padding: 10px 15px;
    background: #f3f4f6;
    color: var(--main-blue);
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s;
}

.notice-links .btn-link:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* ========================================
   Attribution de classe aux produits du projet
   ======================================== */

.product.in-project {
    position: relative;
}
.product.in-project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #6fd7a240;
    pointer-events: none;
    z-index: -1;
    border-radius: 15px;
}

.product.in-project::after {
    content: 'Ajouté';
    position: absolute;
    top: 10px;
    right: 10px;
    height: 28px;
    background: var(--vert);
    color: white;
    padding: 5px 36px 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    z-index: 2;
    align-items: center;
    display: flex;
}

.product.in-project .add_to_cart_button:hover {
    background-color: white;
}

.single-parcours [data-products] .added {
    display: inline-flex !important;
}
.single-parcours [data-products] .product a.added_to_cart{
    display: none !important;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .project-save-bar {
        padding: 12px 15px;
    }
    
    .lbad-save-project-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .modal-content,
    .notice-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-actions,
    .modal-content form {
        flex-direction: column;
    }
    
    .modal-actions button {
        min-width: 100%;
    }
    
    .notice-links {
        flex-direction: column;
    }
}

/* ========================================
   Bouton de suppression sur les produits
   ======================================== */

.product.in-project {
    position: relative;
}

.remove-from-project {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: var(--rouge);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.remove-from-project:hover {
    background: var(--rouge-2);
}

.remove-from-project .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.remove-from-project:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
