/* ============================================
   MÓDULO DE COTIZACIONES - EVSE
   ============================================ */

.cotizacion-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  align-items: start;
}

/* --- PANEL IZQUIERDO: CATÁLOGO --- */
.catalogo-busqueda {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.catalogo-busqueda input,
.catalogo-busqueda select {
  padding: 0.65rem 1rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
}

.catalogo-busqueda input {
  flex: 1;
  min-width: 200px;
}

.catalogo-busqueda input:focus,
.catalogo-busqueda select:focus {
  border-color: #7ab83a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(122,184,58,0.12);
}

.catalogo-grid-cotizacion {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.producto-card-cotizacion {
  background: white;
  border-radius: 12px;
  border: 1.5px solid #f0f0f0;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.producto-card-cotizacion:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.producto-card-cotizacion .prod-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #eaf3de;
}

.producto-card-cotizacion .prod-body {
  padding: 0.8rem 1rem;
}

.producto-card-cotizacion .prod-nombre {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a2e0f;
  margin: 0 0 4px;
}

.producto-card-cotizacion .prod-origen {
  font-size: 0.7rem;
  color: #888;
  display: block;
  margin-bottom: 0.5rem;
}

.btn-agregar-cot {
  width: 100%;
  background: #eaf3de;
  color: #1a2e0f;
  border: 1.5px solid #c8dbb5;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-agregar-cot:hover {
  background: #7ab83a;
  border-color: #7ab83a;
  color: white;
}

/* --- PANEL DERECHO: CARRITO --- */
.carrito-panel {
  position: sticky;
  top: 100px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  overflow: hidden;
}

.carrito-header {
  background: #1a2e0f;
  color: white;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.carrito-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin: 0;
}

.carrito-badge {
  background: #7ab83a;
  color: white;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}

.carrito-items {
  padding: 1rem 1.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.carrito-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.carrito-item-img {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #eaf3de;
}

.carrito-item-info { flex: 1; }

.carrito-item-nombre {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1a2e0f;
}

.carrito-item-qty {
  font-size: 0.8rem;
  color: #666;
}

.btn-remove-item {
  background: none; border: none;
  color: #dc3545; cursor: pointer;
  font-size: 1.1rem; padding: 4px;
  transition: color 0.2s;
}

.btn-remove-item:hover {
  color: #b02a37;
}

.carrito-vacio {
  text-align: center; padding: 2rem;
  color: #999; font-size: 0.9rem;
}

.carrito-form {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid #f0f0f0;
}

.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block; font-size: 0.8rem;
  font-weight: 600; color: #333;
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #7ab83a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(122,184,58,0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.carrito-acciones {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.5rem 0.5rem;
}

.btn-vaciar {
  flex: 1;
  background: none;
  border: 1.5px solid #e0e0e0;
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-vaciar:hover {
  border-color: #dc3545;
  color: #dc3545;
}

.btn-solicitar {
  width: 100%;
  background: #7ab83a;
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  margin-top: 0.5rem;
  font-family: 'Playfair Display', serif;
}

.btn-solicitar:hover {
  background: #3B6D11;
  transform: translateY(-1px);
}

.btn-solicitar:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* --- CARRITO FLOTANTE (CATÁLOGO) --- */
.carrito-flotante {
  position: fixed;
  bottom: 90px; right: 24px;
  background: #1a2e0f;
  color: white;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  text-decoration: none;
  z-index: 999;
  transition: transform 0.2s;
}

.carrito-flotante:hover {
  transform: scale(1.1);
  color: white;
}

.carrito-flotante .count {
  position: absolute;
  top: -4px; right: -4px;
  background: #7ab83a;
  color: white;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* --- MINI-MODAL PARA AGREGAR PRODUCTO --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-contenido {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-contenido h3 {
  font-family: 'Playfair Display', serif;
  color: #1a2e0f;
  margin: 0 0 1.2rem;
  font-size: 1.2rem;
}

.modal-contenido .form-group {
  margin-bottom: 1rem;
}

.modal-acciones {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.btn-modal-cancelar {
  flex: 1;
  background: #f5f5f0;
  border: 1px solid #e0e0e0;
  padding: 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-modal-cancelar:hover {
  background: #e8e8e0;
}

.btn-modal-agregar {
  flex: 1;
  background: #7ab83a;
  color: white;
  border: none;
  padding: 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-modal-agregar:hover {
  background: #3B6D11;
}

/* --- PÁGINA VER COTIZACIÓN (cotizacion-ver.php) --- */
.cotizacion-ver-header {
  background: linear-gradient(135deg, #1a2e0f, #2d5a1a);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
}

.cotizacion-ver-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.cotizacion-ver-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.estado-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.estado-pendiente { background: #fff3d6; color: #c4840a; }
.estado-revision  { background: #d1ecf1; color: #0c5460; }
.estado-respondida{ background: #d4edda; color: #155724; }
.estado-cerrada   { background: #e2e3e5; color: #383d41; }

.cotizacion-codigo {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1a2e0f;
  letter-spacing: 1px;
  margin: 1rem 0;
}

.tabla-cotizacion {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e0e0d8;
}

.tabla-cotizacion th {
  background: #1a2e0f;
  color: white;
  padding: 12px 14px;
  font-size: 0.85rem;
  text-align: left;
}

.tabla-cotizacion td {
  padding: 12px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

.tabla-cotizacion tr.total-row td {
  font-weight: 700;
  color: #1a2e0f;
  border-top: 2px solid #1a2e0f;
}

.condiciones-box {
  background: #fafaf5;
  border: 1px solid #e8e8e0;
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}

.condiciones-box h3 {
  font-size: 1rem;
  color: #1a2e0f;
  margin: 0 0 0.5rem;
}

.condiciones-box p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

.preguntas-section {
  text-align: center;
  margin: 2rem 0;
  padding: 2rem;
  background: #f5f5f0;
  border-radius: 12px;
}

.preguntas-section h3 {
  font-family: 'Playfair Display', serif;
  color: #1a2e0f;
  margin: 0 0 1rem;
}

.preguntas-btns {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-wa,
.btn-email-cot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-wa {
  background: #25D366;
  color: white;
}

.btn-wa:hover {
  background: #1da851;
  color: white;
}

.btn-email-cot {
  background: #1a2e0f;
  color: white;
}

.btn-email-cot:hover {
  background: #2d5a1a;
  color: white;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .cotizacion-layout {
    grid-template-columns: 1fr;
  }
  .carrito-panel {
    position: static;
  }
}

@media (max-width: 600px) {
  .cotizacion-layout {
    padding: 1rem;
  }
  .catalogo-grid-cotizacion {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .cotizacion-ver-header h1 {
    font-size: 1.4rem;
  }
  .cotizacion-codigo {
    font-size: 1.3rem;
  }
}
