/* Botón de carrito en header y footer */

.site-topbar__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  color: var(--text-primary, #212529);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.site-topbar__cart:hover {
  background: var(--border-light, #e9ecef);
  color: var(--primary-color, #0d6efd);
}

.site-topbar__cart i {
  font-size: 1.2rem;
}

.site-topbar__cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: none;
}

.site-topbar__cart.has-items .site-topbar__cart-count {
  display: block;
}

.footer-cart-bar {
  margin-bottom: 1.5rem;
  text-align: center;
}

.footer-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: #fff !important;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(13, 110, 253, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.footer-cart-btn:hover {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.45);
}

.footer-cart-btn__badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 22px;
  display: none;
}

.footer-cart-btn.has-items .footer-cart-btn__badge {
  display: inline-block;
}

.cart-panel__count {
  display: none;
  font-size: 0.75rem;
  background: #1d6fd8;
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  min-width: 20px;
  text-align: center;
}

.cart-panel__link.has-items .cart-panel__count {
  display: inline-block;
}

/* —— Panel carrito (home) —— */
.cart-panel-wrap {
  width: 100%;
  max-width: 100%;
  padding: 1rem 0.5rem 1.25rem;
  box-sizing: border-box;
  background: #f8fafc;
  overflow-x: clip;
}

.cart-panel {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.cart-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.cart-panel__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: #0f172a;
}

.cart-panel__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #1d6fd8;
  color: #1d6fd8;
  text-decoration: none;
  background: #eff6ff;
  max-width: 100%;
}

.cart-panel__link:hover {
  background: #1d6fd8;
  color: #fff;
}

.cart-panel__table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 0 -0.15rem;
  padding-bottom: 0.15rem;
}

.cart-panel__table {
  margin-bottom: 0;
  font-size: 0.9rem;
  width: 100%;
  min-width: 520px;
  table-layout: auto;
}

.cart-panel .table thead th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  vertical-align: middle;
}

.cart-panel .table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

.cart-panel .table tbody tr:hover {
  background: #f8fafc;
}

.cart-panel .table tfoot th,
.cart-panel .table tfoot td {
  background: #f8fafc;
  font-weight: 600;
  border-top: 2px solid #e2e8f0;
  vertical-align: middle;
}

.cart-panel .cart-col-item,
.cart-panel td:nth-child(3) {
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  min-width: 9rem;
  max-width: 18rem;
}

.cart-panel .cart-col-total,
.cart-panel td:nth-child(6),
.cart-panel tfoot td:last-child {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cart-panel .input-cantidad {
  width: 64px;
  max-width: 100%;
  text-align: center;
  border-radius: 0.375rem;
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.35rem;
}

.cart-panel .quantity-controls {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}

.cart-panel .quantity-controls .btn {
  min-width: 32px;
  padding: 0.2rem 0.45rem;
}

.cart-panel .sortable-handle {
  color: #94a3b8;
  cursor: grab;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .cart-panel-wrap {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }

  .cart-panel {
    padding: 0.85rem 0.55rem;
    border-radius: 0.65rem;
  }

  .cart-panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-panel__table {
    min-width: 480px;
    font-size: 0.8rem;
  }

  .cart-panel .table thead th {
    font-size: 0.7rem;
    padding: 0.45rem 0.35rem;
  }

  .cart-panel .table td,
  .cart-panel .table th {
    padding: 0.45rem 0.3rem;
    vertical-align: middle;
  }

  .cart-panel .cart-col-handle,
  .cart-panel td.sortable-handle {
    width: 1.25rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .cart-panel .input-cantidad {
    width: 48px;
    font-size: 0.8rem;
  }

  .cart-panel .quantity-controls .btn {
    min-width: 28px;
    padding: 0.15rem 0.35rem;
    font-size: 0.85rem;
  }

  .cart-panel td:nth-child(3) {
    max-width: 11rem;
    font-size: 0.78rem;
    line-height: 1.25;
  }
}

.site-footer__heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #fff;
}
