.cotizador-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cotizador-seccion {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cotizador-seccion h3 {
    margin-top: 0;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.buscar-productos-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.cotizador-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.cotizador-btn {
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cotizador-btn:hover {
    background: #005177;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.producto-item {
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 4px;
}

.producto-item img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    margin-bottom: 10px;
}

.producto-item h4 {
    font-size: 14px;
    margin: 10px 0;
}

.btn-agregar-producto {
    width: 100%;
    padding: 8px;
    background: #46b450;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.tabla-productos {
    width: 100%;
    border-collapse: collapse;
}

.tabla-productos th,
.tabla-productos td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cantidad-input {
    width: 60px;
    padding: 5px;
}

.btn-eliminar {
    background: #dc3232;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
}

.cotizador-total {
    text-align: right;
    font-size: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #0073aa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

textarea.cotizador-input {
    width: 100%;
    resize: vertical;
}

.cotizador-btn-primary {
    width: 100%;
    padding: 15px;
    background: #0073aa;
    font-size: 18px;
    font-weight: bold;
}

.cotizador-mensaje {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.mensaje-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensaje-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mensaje-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ===================================
   BOTÓN FLOTANTE ESTILO WHATSAPP
   =================================== */
.cotizador-flotante {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    animation: slideInUp 0.3s ease-out;
}

.cotizador-flotante-derecha {
    right: 20px;
}

.cotizador-flotante-izquierda {
    left: 20px;
}

.btn-flotante-cotizar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: var(--boton-color, #25D366);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.btn-flotante-cotizar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-flotante-cotizar svg {
    width: 24px;
    height: 24px;
}

.contador-flotante {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 0.5s ease;
}

/* ===================================
   BOTONES EN PRODUCTOS
   =================================== */
.btn-cotizar-producto,
.btn-cotizar-loop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    background: #0073aa !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.btn-cotizar-producto:hover,
.btn-cotizar-loop:hover {
    background: #005177 !important;
    transform: translateY(-2px);
}

.btn-cotizar-loop {
    font-size: 14px;
    padding: 10px 15px !important;
}

/* ===================================
   MODAL
   =================================== */
.cotizador-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

.cotizador-modal.active {
    display: block;
}

.cotizador-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.cotizador-modal-contenido {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: slideInDown 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cotizador-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
}

.cotizador-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.cotizador-modal-cerrar {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cotizador-modal-cerrar:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.cotizador-modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* ===================================
   TABS
   =================================== */
.cotizador-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.cotizador-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.cotizador-tab:hover {
    color: #0073aa;
}

.cotizador-tab.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.cotizador-tab svg {
    width: 20px;
    height: 20px;
}

.cotizador-tab-content {
    display: none;
}

.cotizador-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===================================
   BÚSQUEDA EN MODAL
   =================================== */
.modal-buscar-productos {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-buscar-productos input {
    flex: 1;
}

.modal-buscar-productos button {
    width: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-resultados-busqueda {
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
}

.modal-resultados-busqueda .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.modal-resultados-busqueda .producto-item {
    padding: 10px;
}

.modal-resultados-busqueda .producto-item img {
    height: 100px;
}

.modal-resultados-busqueda .producto-item h4 {
    font-size: 13px;
}

.modal-resultados-busqueda .btn-agregar-producto {
    padding: 6px;
    font-size: 13px;
}

/* ===================================
   LISTA DE PRODUCTOS EN MODAL
   =================================== */
.productos-seleccionados-modal h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.modal-lista-productos {
    margin-bottom: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.modal-producto-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.modal-producto-imagen {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.modal-producto-info {
    flex: 1;
}

.modal-producto-nombre {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.modal-producto-detalles {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.modal-producto-cantidad {
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-producto-cantidad button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-producto-cantidad button:hover {
    background: #f5f5f5;
}

.modal-producto-cantidad input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
}

.modal-producto-eliminar {
    background: #ff4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-producto-eliminar:hover {
    background: #cc0000;
    transform: rotate(90deg);
}

.modal-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
}

/* ===================================
   FORMULARIO EN MODAL
   =================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group label svg {
    width: 16px;
    height: 16px;
    color: #0073aa;
}

.modal-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-form-actions button {
    flex: 1;
}

.cotizador-btn-secondary {
    background: #6c757d;
}

.cotizador-btn-secondary:hover {
    background: #5a6268;
}

/* ===================================
   MENSAJES DEL MODAL
   =================================== */
.cotizador-modal-mensajes {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
}

.cotizador-modal-mensaje {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cotizador-modal-mensaje svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cotizador-modal-mensaje.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.cotizador-modal-mensaje.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ===================================
   ANIMACIONES
   =================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .cotizador-modal-contenido {
        width: 95%;
        margin: 2vh auto;
        max-height: 96vh;
    }
    
    .cotizador-modal-body {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .cotizador-tabs {
        overflow-x: auto;
    }
    
    .cotizador-tab {
        white-space: nowrap;
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .btn-flotante-cotizar span {
        display: none;
    }
    
    .btn-flotante-cotizar {
        width: 60px;
        height: 60px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
    
    .modal-producto-item {
        flex-wrap: wrap;
    }
    
    .modal-form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .cotizador-flotante {
        bottom: 15px;
    }
    
    .cotizador-flotante-derecha {
        right: 15px;
    }
    
    .cotizador-flotante-izquierda {
        left: 15px;
    }
}
