/**
 * Estilos para el frontend del plugin B2B CJ PAL
 */

.b2b-cj-pal-logistics-selector {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.b2b-cj-pal-logistics-selector h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.logistics-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.logistics-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.logistics-option:hover {
    border-color: #0073aa;
    background-color: #f0f8ff;
}

.logistics-option input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.logistics-option input[type="radio"]:checked + .logistics-label {
    font-weight: 600;
    color: #0073aa;
}

.logistics-option:has(input[type="radio"]:checked) {
    border-color: #0073aa;
    background-color: #e6f3ff;
}

.logistics-label {
    font-size: 14px;
    color: #333;
    user-select: none;
}

/* Estilos para la tabla de presupuesto */
.b2b-cj-pal-quote-logistics {
    margin-top: 5px;
    padding: 5px 0;
}

.b2b-cj-pal-quote-logistics small {
    color: #666;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .logistics-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .logistics-option {
        min-width: auto;
        width: 100%;
    }
}

/* Estilos para el botón de añadir al presupuesto */
.afrfqbt_single_page {
    margin-top: 15px;
}

/* Validación de formulario */
.b2b-cj-pal-logistics-selector.error {
    border-color: #dc3232;
    background-color: #ffeaea;
}

.b2b-cj-pal-logistics-selector .error-message {
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.b2b-cj-pal-logistics-selector.error .error-message {
    display: block;
}

/* Estilos para el botón de ver producto en listado */
.view_product_button {
    background: #007cba !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 3px !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    line-height: 150% !important;
}

.view_product_button:hover {
    background: #005a87 !important;
    color: white !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Ocultar botones de añadir al carro en listado para productos con logística */
/* Se aplica dinámicamente por JavaScript */
.woocommerce .products .product .add_to_cart_button.hidden-by-logistics,
.woocommerce .products .product .single_add_to_cart_button.hidden-by-logistics,
.woocommerce .products .product .button.hidden-by-logistics {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* Asegurar que el botón de ver producto se muestre correctamente */
.woocommerce .products .product .view_product_button {
    display: inline-block !important;
}

/* Estilos para la pestaña de logística en admin */
#b2b_cj_pal_logistics_data {
    padding: 20px;
}

#b2b_cj_pal_logistics_data h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #23282d;
    font-size: 16px;
    font-weight: 600;
}

#b2b_cj_pal_logistics_data .options_group {
    margin-bottom: 20px;
}

#b2b_cj_pal_logistics_data .form-field {
    margin-bottom: 15px;
}

#b2b_cj_pal_logistics_data .form-field label {
    font-weight: 600;
    color: #23282d;
}

#b2b_cj_pal_logistics_data .description {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

#b2b_cj_pal_logistics_data .woocommerce-help-tip {
    color: #666;
    cursor: help;
}

/* Estilos para el editor WYSIWYG en la pestaña de logística */
.b2b-cj-pal-wysiwyg-container {
    margin: 10px 0;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-wrap {
    border: 1px solid #ddd;
    border-radius: 3px;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-tabs {
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    padding: 5px 10px;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-tabs .wp-switch-editor {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-bottom: none;
    color: #555;
    padding: 5px 10px;
    text-decoration: none;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-tabs .wp-switch-editor:hover {
    background: #fff;
    color: #000;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-tabs .wp-switch-editor.switch-tmce {
    border-right: none;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-tabs .wp-switch-editor.switch-html {
    border-left: none;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-tabs .wp-switch-editor.active {
    background: #fff;
    color: #000;
    font-weight: 600;
}

.b2b-cj-pal-wysiwyg-container .wp-editor-area {
    width: 100%;
    min-height: 120px;
    border: none;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.b2b-cj-pal-wysiwyg-container .mce-toolbar {
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.b2b-cj-pal-wysiwyg-container .mce-toolbar .mce-btn {
    background: transparent;
    border: none;
    color: #555;
}

.b2b-cj-pal-wysiwyg-container .mce-toolbar .mce-btn:hover {
    background: #e6e6e6;
    color: #000;
}

.b2b-cj-pal-wysiwyg-container .mce-toolbar .mce-btn.mce-active {
    background: #0073aa;
    color: #fff;
}

.b2b-cj-pal-wysiwyg-container .mce-edit-area {
    border: none;
}

.b2b-cj-pal-wysiwyg-container .mce-edit-area iframe {
    border: none;
    min-height: 120px;
}
