/* ===== BOTÓN CARRITO FLOTANTE (siempre visible cuando hay items) ===== */
.cart-fab{
  position: fixed;
  right: 18px;
  top: 5px;
  z-index: 99999;

  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;

  background: #3468b1;
  color: #fff;

  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  cursor: pointer;
}

/* Burbuja contador */
.cart-badge{
  position:absolute;
  top: 0px;
  right: 0px;
  background:#f6d435;
  color:#000;
  font-weight:700;
  min-width:20px;
  height:20px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  padding:0 6px;
}

/* ===== Modal estructura ===== */
.cart-modal-dialog { max-width: 640px; }
.cart-modal-content { border:none; border-radius:14px; overflow:hidden; }

.cart-modal-header {
  background: #1a1a2e;
  padding: 16px 20px;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-modal-title {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color .15s;
}
.cart-modal-close:hover { color: #fff; }

.cart-modal-body { padding: 0 20px 4px; }
.cart-empty-msg { text-align:center; padding:40px 0; color:#9ca3af; font-size:14px; }

/* Items */
.cart-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
}
.cart-item:last-child { border-bottom: none; }

.cart-item-img {
  width: 68px;
  min-width: 68px;
  height: 68px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: repeating-linear-gradient(-45deg,#f3f4f6 0,#f3f4f6 2px,#fff 2px,#fff 10px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-ph {
  font-size: 9px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: .5px;
  text-align: center;
  padding: 4px;
  text-transform: uppercase;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.cart-item-img img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 6px;
  background: #fff;
  z-index: 2;
}

.cart-item-body { flex: 1; min-width: 0; }
.cart-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.cart-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.3;
  flex: 1;
}
.cart-item-cpu {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}
.cart-item-sku { font-size: 11px; color: #9ca3af; margin-bottom: 4px; }
.cart-item-subtotal {
  font-size: 15px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 8px;
  text-align: right;
}
.cart-item-actions { display: flex; align-items: center; gap: 14px; }

.cart-qty-v2 {
  display: flex;
  align-items: center;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.cart-qty-btn {
  background: #f8fafc;
  border: none;
  width: 30px;
  height: 30px;
  font-size: 16px;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.cart-qty-btn:hover { background: #e5e7eb; }
.cart-qty-val {
  min-width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  border-left: 1.5px solid #e5e7eb;
  border-right: 1.5px solid #e5e7eb;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-remove {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: #3468b1;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color .12s;
}
.btn-remove:hover { color: #ef4444; }

/* Totales */
.cart-totals {
  border-top: 2px solid #f3f4f6;
  padding: 16px 0 8px;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #374151;
  padding: 4px 0;
}
.cart-total-row:first-child { color: #6b7280; }
.cart-total-row:nth-child(2) { color: #6b7280; }
.cart-total-final {
  font-size: 17px;
  font-weight: 900;
  color: #1a1a2e;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  margin-top: 6px;
}

/* Footer */
.cart-modal-footer {
  padding: 14px 20px 18px;
  border-top: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cart-btn-vaciar {
  border: 1.5px solid #ef4444;
  background: #fff;
  color: #ef4444;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 22px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.cart-btn-vaciar:hover { background: #ef4444; color: #fff; }
.cart-btn-seguir {
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-btn-seguir:hover { background: #f3f4f6; }
.cart-btn-checkout {
  flex: 1;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s;
}
.cart-btn-checkout:hover { background: #15803d; }

@media (max-width: 575px){
  .cart-fab{
    top: 5px; /* baja el botón para no tapar header en móvil */
    right: 12px;
  }
}

/* ===== Botones Agregar al carrito (unificados) ===== */
.btn-add-to-cart,
#btnAddDetail{
  background-color: #3468b1;
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 7px 16px;
  font-size: 14px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s ease;
}

.btn-add-to-cart:hover,
#btnAddDetail:hover{
  background-color: #2a5592;
  transform: translateY(-1px);
}

.btn-add-to-cart:active,
#btnAddDetail:active{
  transform: translateY(0);
}

/* Icono dentro del botón */
.btn-add-to-cart i,
#btnAddDetail i{
  font-size: 15px;
}

/* ===== Input cantidad (detalle) ===== */
#qty{
  width: 60px;
  text-align: center;
  padding: 4px 6px;
  font-size: 14px;
  border-radius: 14px;
  border: 1px solid #ccc;
  height: 32px;
}

#qty:focus{
  outline: none;
  border-color: #3468b1;
  box-shadow: 0 0 0 2px rgba(52,104,177,.15);
}

/* ===== Totales carrito ===== */
#cart-subtotal,
#cart-iva,
#cart-total{
  font-weight: 600;
}
#cart-iva{
  color: #555;
}
/* ===== Checkout compacto ===== */
.checkout-compact .form-group {
  margin-bottom: 0.6rem; /* antes ~1.5rem */
}

.checkout-compact .form-text {
  margin-top: 0.15rem;
  font-size: 12px;
}

.checkout-compact .card-body {
  padding: 1rem; /* antes 1.25rem+ */
}

.checkout-compact input.form-control,
.checkout-compact textarea.form-control {
  padding: 0.35rem 0.55rem;
  font-size: 14px;
}

.checkout-compact textarea {
  resize: vertical;
}
