/* =========================================
DESIGN FORMULAIRE COMMANDE B2C
========================================= */
#cs-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
}

.PageCommande {
    padding-top: 110px;
    background-color: #f8f9fa;
    margin: 0;
    max-width: 100vw;
    overflow-x: hidden;
}

.FormulaireCommande * {
    box-sizing: border-box !important;
}

.modern-layout {
    max-width: 1300px !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 15px !important;
    margin: 0 auto;
}

.commande-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}

.commande-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.commande-sidebar {
    width: 400px;
    flex-shrink: 0;
}

.cart-sticky {
    position: sticky;
    top: 120px;
    z-index: 50;
}

.modern-box {
    background: #fff;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.03);
    margin-bottom: 30px;
    border: 1px solid #eaeaea;
    width: 100%; 
}

.modern-box h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 25px;
    border-bottom: 2px solid #f4f4f4;
    padding-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row { display: flex; gap: 20px; width: 100%; }
.form-row .form-group { flex: 1; }

.format-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}
.tab-btn {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    padding: 12px 10px;
    border-radius: 12px;
    font-weight: 700;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    width: 100%;
}
.tab-btn.active, .tab-btn:hover {
    background: #ff7e5f;
    color: #fff;
    border-color: #ff7e5f;
    box-shadow: 0 4px 15px rgba(255, 126, 95, 0.25);
    transform: translateY(-2px);
}

.format-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}
.format-grid.active {
    display: grid;
    animation: fadeIn 0.4s ease;
}

.format-card {
    border: 2px solid #f3f4f6;
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}
.format-card img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.4s ease;
}
.format-card:hover img {
    transform: scale(1.15) rotate(-3deg);
}
.format-card h4 {
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    color: #1f2937;
    font-weight: 800;
}
.format-card span {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
}
.format-card:hover {
    border-color: #ffbdab;
    box-shadow: 0 10px 25px rgba(255, 126, 95, 0.12);
}
.format-card.selected {
    border-color: #ff7e5f;
    background: #fffaf8;
    box-shadow: 0 8px 20px rgba(255, 126, 95, 0.2);
    transform: scale(1.03);
}

.premium-card { background: #f0fdfa; border-color: #ccfbf1; }
.premium-card.selected { background: #ccfbf1; border-color: #0d9488; }
.premium-card .icon-placeholder {
    width: 70px; height: 70px; border-radius: 50%;
    background: #fff; color: #0d9488; display: flex;
    align-items: center; justify-content: center;
    font-size: 2.2rem; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.sticky-progress {
    position: sticky;
    top: 90px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0 20px 0;
    z-index: 10;
    border-bottom: 2px solid #f3f4f6;
    margin-bottom: 25px;
}

.progress-info {
    text-align: right;
    font-weight: 800;
    color: #ff7e5f;
    margin-bottom: 10px;
    font-size: clamp(0.95rem, 4vw, 1.2rem); 
    white-space: nowrap;
}

.progress-track {
    background: #f3f4f6;
    height: 14px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress-fill {
    height: 100%;
    background: #ff7e5f;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s;
}

.progress-fill.full { background: #10b981; }

.modern-parfums-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); 
    gap: 15px;
    width: 100%;
}

.modern-parfum-card {
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 15px 10px;
    text-align: center;
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.modern-parfum-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    border-color: #ffbdab;
}

.modern-parfum-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modern-parfum-card h4 {
    font-size: 0.9rem;
    margin: 0 0 15px 0;
    color: #111;
    font-weight: 800;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type=number] { -moz-appearance: textfield; }

.qty-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    height: 45px; 
}

.qty-btn {
    background: transparent; 
    border: none;
    width: 38px;
    flex-shrink: 0;
    height: 100%;
    font-size: 1.2rem;
    color: #ff7e5f;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
}

.qty-btn:hover { background: #ffede8; color: #ff7e5f; }
.qty-input {
    width: 100%; 
    flex: 1;
    min-width: 0; 
    height: 100%;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 900;
    font-size: 1.2rem;
    color: #111;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.qty-input:focus { outline: none; background: transparent; }

.btn-modern-primary, .btn-modern-checkout {
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.btn-modern-primary {
    background: #ff7e5f;
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 126, 95, 0.3);
}

.btn-modern-primary:disabled,
.btn-modern-checkout:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-modern-primary:not(:disabled):hover {
    background: #e66648;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 126, 95, 0.4);
}

.btn-modern-checkout {
    background: #111;
    color: #fff;
    margin-top: 50px;
}
.btn-modern-checkout:not(:disabled):hover {
    background: #333;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-size: 16px;
    border: 2px solid #eaeaea;
    border-radius: 12px;
    background-color: #f9f9f9;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: #ff6a3e;
    outline: none;
}

.input-wrapper input[type="text"].modern-date-input,
.input-wrapper input.flatpickr-input,
.input-wrapper select.modern-time-input {
    width: 100% !important;
    max-width: 100% !important;
    height: 52px !important;
    padding: 0 16px !important;
    font-size: 16px !important;
    border: 2px solid #ff6a3e !important;
    border-radius: 12px !important;
    background-color: #f9f9f9 !important;
    color: #333 !important;
    margin-bottom: 15px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    outline: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.input-wrapper input.flatpickr-input:focus,
.input-wrapper select.modern-time-input:focus {
    background-color: #fff !important;
    box-shadow: 0 0 8px rgba(255, 106, 62, 0.4) !important;
}

.modern-date-input, .flatpickr-input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="18"><path fill="%23ff6a3e" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64-64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192h352v256c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    padding-right: 45px !important;
}

.modern-time-input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="18"><path fill="%23ff6a3e" d="M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    padding-right: 45px !important;
}

.modern-recap .boite-recap {
    background: #fff;
    border: 2px solid #f0f0f0;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    border-radius: 14px;
    transition: border-color 0.3s ease;
}

.modern-recap .boite-recap:hover {
    border-color: #ffbdab;
}

.modern-recap .boite-recap h3 {
    font-size: 1.1rem;
    color: #111;
    border-bottom: 2px solid #f4f4f4;
    padding-bottom: 12px;
    margin-bottom: 15px;
    padding-right: 35px;
}
.modern-recap .boite-recap ul li {
    font-size: 0.95rem;
    color: #4b5563;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
}

.btn-remove-box {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-remove-box:hover { 
    background: #ef4444; 
    color: #fff; 
    transform: rotate(90deg) scale(1.1);
}

.cart-qty-wrapper {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 10px;
}

.cart-qty-wrapper span {
    font-weight: 800;
    color: #333;
}

.cart-qty-input {
    width: 70px;
    height: 40px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
    color: #111;
    transition: border-color 0.3s;
}

.cart-qty-input:focus {
    border-color: #ff7e5f;
    outline: none;
    background: #fff;
}

.modern-promo .promo-input-container {
    display: flex;
    width: 100%;
    gap: 8px;
    align-items: center;
}

.modern-promo .promo-input-container input {
    flex: 1 1 auto;
    min-width: 0; 
    height: 48px !important;
    margin: 0 !important;
    border-radius: 8px;
    box-sizing: border-box;
}

.modern-promo .promo-input-container button {
    flex: 0 0 auto;
    height: 48px !important;
    padding: 0 20px !important;
    white-space: nowrap; 
    border-radius: 8px;
    box-sizing: border-box;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-total {
    background: #fff5f2;
    padding: 25px;
    border-radius: 16px;
    margin-top: 10px;
    margin-bottom: 5px;
    border: 2px solid #ffbdab;
}

.modern-total p { margin: 8px 0; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; }
.modern-total p strong { font-size: 1.4rem; color: #111; }

.selected-format-badge {
    display: none;
    background: #fff5f2;
    color: #ff6a3e;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: -15px;
    margin-bottom: 25px;
    border: 1px solid #ffbdab;
    box-shadow: 0 4px 10px rgba(255, 106, 62, 0.1);
}
.selected-format-badge i { margin-right: 6px; }

@media (max-width: 900px) {
    .commande-grid { display: flex; flex-direction: column; width: 100%; }
    .commande-main, .commande-sidebar { width: 100%; max-width: 100%; flex: none; }
    .form-row { flex-direction: column; gap: 15px; }
    .cart-sticky { position: static; }
}

@media (max-width: 768px) {
    .modern-promo .promo-input-container {
        flex-direction: row; 
        align-items: center;
        gap: 8px;
    }
    .modern-promo .promo-input-container input,
    .modern-promo .promo-input-container button {
        height: 48px !important;
        margin-top: 0 !important;
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .modern-box { padding: 20px 15px; }
    .format-grid { grid-template-columns: repeat(2, 1fr); }
    .format-tabs { display: flex; flex-direction: column; }
    .tab-btn { width: 100%; }
    
    .modern-parfums-container { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .modern-parfum-card { padding: 10px 8px; }
    .modern-parfum-card img { width: 70px; height: 70px; }
}

.format-card.indispo-format {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
    position: relative;
}

.format-card.indispo-format::after {
    content: attr(data-epuise);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(220, 38, 38, 0.95);
    color: white;
    padding: 8px 20px;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 1px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* =========================================
   DESIGN FILTRES & BOUTON SURPRISE (Page Commande)
========================================= */
#commande-filtre-allergenes {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 35px;
    margin-bottom: 25px;
}

.action-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 15px;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    justify-content: center;
}

#btn-commande-filtre, #btnSurprise {
    flex: 1; 
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 15px;
    margin: 0;
    white-space: nowrap;
}

#btn-commande-filtre {
    background-color: #ff6a3e;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 106, 62, 0.25);
}
#btn-commande-filtre:hover {
    background-color: #e85a2d;
    transform: translateY(-2px);
}

#btnSurprise {
    background-color: #ffba43;
    color: #111;
    box-shadow: 0 4px 15px rgba(255, 186, 67, 0.25);
}
#btnSurprise:hover {
    background-color: #e5a435;
    transform: translateY(-2px);
}

#commande-arrow {
    transition: transform 0.3s ease;
}
#btn-commande-filtre.open #commande-arrow {
    transform: rotate(180deg);
}

/* =========================================
   DESIGN FILTRES ALLERGÈNES 
========================================= */
#commande-checkboxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding: 20px;
    background-color: #fff8f5;
    border: 1px solid #ffd5c5;
    border-radius: 14px;
    max-width: 900px;
    width: 100%;
    opacity: 1;
    transition: all 0.4s ease;
    box-shadow: 0 4px 16px rgba(255, 106, 62, 0.1);
    box-sizing: border-box;
}

#commande-checkboxes.hidden {
    display: none;
    opacity: 0;
}

#commande-checkboxes label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex: 0 0 calc(25% - 15px);
    min-width: 160px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    background: #fff;
    border: 1px solid #ff6a3e;
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

#commande-checkboxes label:hover {
    background-color: #fff1eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 106, 62, 0.15);
}

#commande-checkboxes input[type="checkbox"] {
    accent-color: #ff6a3e;
    transform: scale(1.3);
    margin: 0;
    cursor: pointer;
}

@media (max-width: 900px) {
    #commande-checkboxes label {
        flex: 0 0 calc(33.333% - 15px);
    }
}

@media (max-width: 600px) {
    #commande-checkboxes {
        gap: 10px;
        padding: 15px;
    }
    #commande-checkboxes label {
        flex: 0 0 calc(50% - 10px);
        font-size: 0.85rem;
        padding: 10px;
        min-width: 130px;
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .action-buttons-row {
        flex-direction: column;
        gap: 12px;
    }
    
    #btn-commande-filtre, 
    #btnSurprise {
        flex: none;
        width: 100%;
        height: 46px;
    }
}

@media (max-width: 360px) {
    #commande-checkboxes label {
        flex: 0 0 100%; 
    }
}