/* ==========================================================
   LEONARI – PANEL DE COTIZACIÓN (versión refinada)
   ========================================================== */

#cart-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9998;
  display: none;
}
#cart-overlay.show { display: block; }

#cart-panel {
  position: fixed;
  right: -400px;
  top: 0;
  width: 380px;
  height: 100%;
  background: #fff;
  z-index: 9999;
  box-shadow: -3px 0 10px rgba(0,0,0,0.25);
  transition: right 0.35s ease;
  display: flex;
  flex-direction: column;
  border-radius: 8px 0 0 8px;
  overflow: hidden;
}
#cart-panel.open { right: 0; }

/* === Cabecera === */
/* === CORRECCIÓN DEFINITIVA: BOTÓN COTIZAR A TODO EL ANCHO === */
#cart-panel .button-wrapper {
  padding: 18px 20px;
  border-top: 1px solid #eee;
  background: #f9fafa;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
}

#cart-panel .button-wrapper button,
#cart-panel .button-wrapper .rts-btn {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;   /* 🔹 fuerza ancho completo */
  text-align: center !important;
  border-radius: 30px;
  padding: 14px 0 !important;
  background-color: #0096a6 !important;
  color: #fff !important;
  font-size: 17px !important;
  font-weight: 600;
  border: none !important;
  transition: background 0.3s ease, transform 0.2s ease;
}

#cart-panel .button-wrapper button:hover,
#cart-panel .button-wrapper .rts-btn:hover {
  background-color: #007f8b !important;
  transform: scale(1.02);
}

#cart-panel .button-wrapper i {
  margin-right: 6px;
  font-size: 18px;
}


/* === Productos === */
.block-products {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
}
.list-cotizacion {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-cotizacion li {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
  transition: background 0.2s;
}
.list-cotizacion li:hover {
  background: #f9fcfc;
  border-radius: 6px;
}

/* Imagen */
.list-cotizacion img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #00a1ad;
  background: #fff;
}

/* Texto del producto */
.list-cotizacion .txt-product {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.list-cotizacion h6 {
  font-size: 15px;
  font-weight: 600;
  color: #0072a1;
  margin: 0 0 5px;
  line-height: 1.2;
}

/* Campo cantidad */
.list-cotizacion input[type="number"] {
  width: 55px;
  height: 34px;
  border: 1px solid #00a1ad;
  border-radius: 6px;
  text-align: center;
  color: #00717f;
  font-weight: 500;
  transition: 0.2s;
}
.list-cotizacion input[type="number"]:focus {
  outline: none;
  border-color: #007c89;
  box-shadow: 0 0 0 2px rgba(0,161,173,0.2);
}

/* Eliminar */
.list-cotizacion .remove {
  color: #d9534f;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}
.list-cotizacion .remove:hover {
  color: #b22222;
}

/* === Botón Cotizar === */
.button-wrapper {
  padding: 18px 20px;
  border-top: 1px solid #eee;
  background: #f9fafa;
  position: sticky;
  bottom: 0;
}
.button-wrapper .rts-btn {
  width: 100%;
  background: linear-gradient(90deg, #009da8, #00c2c2);
  color: #fff;
  font-weight: 600;
  font-size: 17px;
  border: none;
  border-radius: 30px;
  padding: 12px 0;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.button-wrapper .rts-btn i {
  font-size: 18px;
}
.button-wrapper .rts-btn:hover {
  background: linear-gradient(90deg, #00848c, #00a0a0);
  transform: scale(1.02);
}

/* Scroll */
.block-products::-webkit-scrollbar {
  width: 6px;
}
.block-products::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
}

/* === Responsive === */
@media (max-width: 480px) {
  #cart-panel {
    width: 100%;
    max-width: none;
    border-radius: 0;
  }
}

/* === FORZAR SUPERPOSICIÓN Y VISIBILIDAD DEL PANEL === */
#cart-overlay,
#cart-panel {
  z-index: 99999 !important; /* 🔹 encima de todo */
}

#cart-overlay {
  position: fixed !important;
  inset: 0; /* equivale a top:0; left:0; right:0; bottom:0 */
  background: rgba(0,0,0,0.55);
  display: none;
}

#cart-overlay.show { display: block !important; }

#cart-panel {
  position: fixed !important;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh; /* 🔹 asegura que cubra todo el alto */
  background: #fff;
  border-radius: 8px 0 0 8px;
  box-shadow: -3px 0 10px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  transition: right 0.35s ease;
}

#cart-panel.open { right: 0; }

/* === BOTONES DEL DETALLE DEL PRODUCTO === */
.button-wrapper a.rts-btn,
.button-wrapper button.rts-btn,
.button-wrapper .rts-btn.btn-primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 10px 20px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 25px !important;
  white-space: nowrap;
  min-width: 150px;
  background-color: #0096a6 !important;
  color: #fff !important;
  transition: background 0.3s ease;
}

.button-wrapper a.rts-btn:hover,
.button-wrapper button.rts-btn:hover {
  background-color: #007f8b !important;
}

.button-wrapper a.rts-btn.bg-transparent {
  background-color: transparent !important;
  color: #0096a6 !important;
  border: 2px solid #0096a6 !important;
}

.button-wrapper.mt--25 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================
   CABECERA DEL PANEL DE COTIZACIÓN (alineada y refinada)
   ========================================================== */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px 20px; /* margen interno más equilibrado */
  border-bottom: 1px solid #eee;
  background: #ffffff;
}

.cart-header h5 {
  margin: 0; /* elimina margen por defecto */
  color: #002c6e;
  font-weight: 700;
  font-size: 17px; /* tamaño ligeramente menor */
  letter-spacing: 0.2px;
  flex: 1; /* asegura que ocupe todo el espacio disponible */
}

/* === BOTÓN DE CERRAR === */
.close-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;  /* un poco más compacto */
  height: 34px;
  margin-left: 12px; /* espacio entre título y botón */
  border-radius: 8px;
  background: #0096a6;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.close-cart i {
  font-size: 18px;
  line-height: 1;
}

.close-cart:hover {
  background: #007f8b;
  transform: rotate(90deg);
}

.close-cart:active {
  transform: scale(0.92);
}

/* ==========================================================
   BOTONES DE ACCIÓN (versión corregida y prioritaria)
   ========================================================== */
.button-wrapper {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Base común --- */
.button-wrapper .rts-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 30px;
  transition: all 0.25s ease-in-out;
  border: none;
  text-transform: none;
  line-height: 1.1;
}

/* --- COTIZAR --- */
#btnAgregarCotizacion {
  background: linear-gradient(90deg, #00a2c7, #00d4b4) !important;
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(0, 162, 199, 0.25);
}
#btnAgregarCotizacion:hover {
  background: linear-gradient(90deg, #00d4b4, #00a2c7) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 162, 199, 0.4);
}
#btnAgregarCotizacion i {
  color: #fff !important;
}

/* --- FICHA TÉCNICA --- */
.button-wrapper .btn-ficha {
  background: #f1fefe !important;
  color: #008ba3 !important;
  border: 2px solid #00a2c7 !important;
  box-shadow: 0 3px 6px rgba(0, 162, 199, 0.15);
}
.button-wrapper .btn-ficha:hover {
  background: linear-gradient(90deg, #00a2c7, #00d4b4) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 162, 199, 0.4);
}
.button-wrapper .btn-ficha i {
  color: #008ba3 !important;
  transition: color 0.25s ease;
}
.button-wrapper .btn-ficha:hover i {
  color: #fff !important;
}
