/**
 * Freshmarkom B2B/B2C - Frontend Styles
 */

/* Prix HT/TTC */
.fm-price-ht {
    font-weight: bold;
    color: #333;
}

.fm-price-ttc {
    color: #666;
    font-size: 0.9em;
}

.fm-price-old {
    color: #999;
    font-size: 0.85em;
    display: block;
    margin-bottom: 3px;
}

/* Badge Prix Professionnel */
.fm-price-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-top: 5px;
    font-weight: 500;
}

.fm-price-badge--b2b {
    background-color: #2271b1;
    color: #fff;
}

/* Badge compte */
.fm-account-badge {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.fm-account-badge--b2b {
    background-color: #e7f3ff;
    color: #2271b1;
    border: 1px solid #2271b1;
}

/* Lien connexion pour voir le prix */
.fm-login-price {
    display: inline-block;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 0;
    font-size: 0.95em;
}

.fm-login-price:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Bouton connexion dans la boucle produits */
.fm-login-button {
    background-color: #2271b1 !important;
    color: #fff !important;
    border: none !important;
}

.fm-login-button:hover {
    background-color: #135e96 !important;
}

/* Message connexion requise sur page produit */
.fm-login-required {
    background-color: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.fm-login-required p {
    margin: 0 0 15px 0;
    color: #50575e;
    font-size: 1.1em;
}

.fm-login-required .button {
    background-color: #2271b1;
    color: #fff;
    padding: 12px 30px;
    font-size: 1em;
}

.fm-login-required .button:hover {
    background-color: #135e96;
}

/* B2B teaser */
.fm-b2b-teaser {
    display: block;
    color: #2271b1;
    font-style: italic;
    margin-top: 5px;
}

/* Panier - lignes HT/TTC */
.fm-cart-subtotal-ht th,
.fm-cart-subtotal-ht td,
.fm-cart-vat th,
.fm-cart-vat td {
    font-size: 0.95em;
    color: #666;
}

.fm-checkout-subtotal-ht th,
.fm-checkout-subtotal-ht td,
.fm-checkout-vat th,
.fm-checkout-vat td {
    font-size: 0.95em;
    color: #666;
}

/* Champs inscription B2B */
#fm-b2b-fields {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

#fm-b2b-fields p {
    margin-bottom: 10px;
}

/* Style pour prix masqué dans les résultats de recherche */
.woocommerce ul.products li.product .fm-login-price {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
}

/* =====================================================
   FORMULAIRE D'INSCRIPTION B2B - RESPONSIVE
   ===================================================== */

/* Sélecteur type de compte */
#fm_account_type {
    width: 100%;
    max-width: 100%;
    padding: 12px 40px 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

#fm_account_type:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Champs B2B */
#fm_b2b_fields {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e2e4e7;
}

#fm_b2b_fields h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #2271b1;
}

#fm_b2b_fields input[type="text"],
#fm_b2b_fields select {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#fm_b2b_fields .description {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #666;
}

#fm_b2b_fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* Secteur d'activité select */
#fm_business_sector {
    width: 100%;
    max-width: 100%;
    padding: 12px 40px 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Fix pour tous les selects du formulaire */
.woocommerce-form-register select,
#fm_b2b_fields select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 40px 12px 15px !important;
    font-size: 16px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    box-sizing: border-box !important;
}

/* =====================================================
   RESPONSIVE MOBILE
   ===================================================== */

@media screen and (max-width: 768px) {
    /* Formulaire inscription */
    .woocommerce-form-register {
        padding: 0 10px;
    }
    
    .woocommerce-form-register .form-row {
        margin-bottom: 15px;
    }
    
    .woocommerce-form-register input[type="text"],
    .woocommerce-form-register input[type="email"],
    .woocommerce-form-register input[type="password"],
    .woocommerce-form-register select {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 16px !important;
        padding: 12px 15px !important;
        box-sizing: border-box !important;
    }
    
    /* Type de compte select */
    #fm_account_type {
        font-size: 16px !important;
        padding: 14px 15px !important;
    }
    
    /* Champs B2B sur mobile */
    #fm_b2b_fields {
        padding: 15px;
        margin: 10px 0;
    }
    
    #fm_b2b_fields h3 {
        font-size: 1em;
    }
    
    #fm_b2b_fields input,
    #fm_b2b_fields select {
        font-size: 16px !important;
        padding: 14px 15px !important;
    }
    
    /* Prix sur mobile */
    .fm-b2b-price-wrapper {
        display: block;
    }
    
    .fm-b2b-ttc {
        display: block;
        margin-top: 3px;
    }
    
    .fm-b2b-badge {
        margin-top: 8px;
    }
    
    /* Panier mobile */
    .fm-cart-price,
    .fm-cart-subtotal {
        font-size: 0.9em;
    }
    
    .fm-cart-ttc {
        display: block;
        margin-top: 2px;
    }
    
    /* Message login mobile */
    .fm-login-to-see-price {
        display: block;
        padding: 10px;
        text-align: center;
    }
    
    /* Mini-cart mobile */
    .fm-mini-cart-subtotal {
        font-size: 0.9em;
    }
    
    .fm-mini-cart-subtotal .fm-price-ttc {
        font-size: 0.8em;
    }
}

@media screen and (max-width: 480px) {
    /* Extra small screens */
    #fm_b2b_fields {
        padding: 12px;
    }
    
    .woocommerce-form-register .form-row label {
        font-size: 0.95em;
    }
    
    /* Prix compact */
    .fm-b2b-price-wrapper {
        font-size: 0.95em;
    }
}