.checkout-cart-fab {
  position: fixed;
  right: 20px;
  bottom: var(--checkout-cart-fab-bottom, 92px);
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 0.85rem 1rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22), 0 0 0 4px rgba(37, 99, 235, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.checkout-cart-fab:hover,
.checkout-cart-fab:focus {
  color: #fff;
  filter: saturate(1.08);
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.28), 0 0 0 5px rgba(37, 99, 235, 0.24);
}

.checkout-cart-fab:focus-visible {
  outline: 0;
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.28), 0 0 0 5px rgba(147, 197, 253, 0.34);
}

.checkout-cart-fab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.8rem;
  font-weight: 700;
}

.checkout-cart-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(147, 197, 253, 0.42);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #eff6ff;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.checkout-cart-nav:hover,
.checkout-cart-nav:focus {
  background: rgba(37, 99, 235, 0.32);
  border-color: rgba(191, 219, 254, 0.72);
  color: #ffffff;
  transform: translateY(-1px);
}

.checkout-cart-nav:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(147, 197, 253, 0.3);
}

.checkout-cart-nav__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 800;
}

.checkout-cart-nav--compact {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  position: relative;
}

.checkout-cart-nav--compact .checkout-cart-nav__count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: 0.7rem;
  border: 2px solid #212529;
}

.drawer-carro-compra {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(100%, 440px);
  max-width: 100vw;
  height: auto;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  right: 0;
  transform: translateX(100%);
  border-radius: 0;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  overflow: hidden;
  background: #fff;
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.22);
  z-index: 1050;
}

.drawer-carro-compra.open {
  transform: translateX(0);
  pointer-events: auto;
}

.drawer-carro-compra__header,
.drawer-carro-compra__footer {
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.drawer-carro-compra__footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom: 0;
}

.drawer-carro-compra__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.drawer-carro-compra__subtitle {
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.9rem;
}

.drawer-carro-compra__close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.drawer-carro-compra__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.85rem 1rem 0;
}

.drawer-carro-compra__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
}

.drawer-carro-compra__step.is-active {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.18);
}

.drawer-carro-compra__list {
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  /* allow the list to size to its content but limit maximum height so header/footer stay visible */
  flex: 0 1 auto;
  max-height: calc(100dvh - 220px);
  overflow: auto;
}

.checkout-cart-empty,
.checkout-cart-success,
.checkout-cart-status {
  margin: 0 1rem 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
}

.checkout-cart-success {
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
  display: none;
}

.checkout-cart-status.is-info {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.checkout-cart-status.is-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.checkout-cart-status.is-error {
  background: rgba(239, 68, 68, 0.10);
  color: #b91c1c;
}

.checkout-cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #f8fafc;
}

.checkout-cart-item__media {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-cart-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-cart-item__body {
  min-width: 0;
  padding-top: 0.1rem;
}

.checkout-cart-item__body strong,
.checkout-cart-item__body small {
  display: block;
}

.checkout-cart-item__body strong {
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.checkout-cart-item__body small {
  margin-top: 0.2rem;
  line-height: 1.35;
  color: #64748b;
}

.checkout-cart-item__remove {
  border: 0;
  background: transparent;
  color: #ef4444;
  align-self: start;
  padding: 0.15rem;
  line-height: 1;
}

.drawer-carro-compra__summary {
  padding: 0 1rem 1rem;
}

.drawer-carro-compra__summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.drawer-carro-compra__server-summary {
  color: #64748b;
  font-size: 0.85rem;
}

.drawer-carro-compra__form {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 0.75rem;
  flex: 0 0 auto;
  max-height: 34vh;
  overflow: auto;
}

.drawer-carro-compra__section-heading {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.15rem;
}

.drawer-carro-compra__section-heading strong {
  color: #0f172a;
}

.drawer-carro-compra__section-heading span {
  color: #64748b;
  font-size: 0.85rem;
}

.drawer-carro-compra__footer-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: #64748b;
  font-size: 0.84rem;
  margin-bottom: 0.9rem;
}

.drawer-carro-compra__footer-note i {
  margin-top: 0.1rem;
  color: #2563eb;
}

.drawer-carro-compra__actions {
  display: flex;
  gap: 0.75rem;
}

.drawer-carro-compra__actions .btn {
  flex: 1 1 0;
}

.landing-card__actions .btn-agregar-compra,
.emp-drawer-cta .btn-agregar-compra {
  white-space: nowrap;
}

body.dark-mode .drawer-carro-compra {
  background: #111827;
  color: #f8fafc;
}

body.dark-mode .checkout-cart-fab {
  color: #eff6ff;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border-color: rgba(191, 219, 254, 0.35);
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.4), 0 0 0 4px rgba(59, 130, 246, 0.18);
}

body.dark-mode .checkout-cart-fab:hover,
body.dark-mode .checkout-cart-fab:focus {
  color: #fff;
  box-shadow: 0 22px 42px rgba(2, 6, 23, 0.48), 0 0 0 5px rgba(96, 165, 250, 0.22);
}

.vista-empresa-page .checkout-cart-fab {
  --checkout-cart-fab-bottom: 108px;
}

body.dark-mode .checkout-cart-fab__count {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(191, 219, 254, 0.22);
}

body.dark-mode .checkout-cart-nav {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(147, 197, 253, 0.38);
  color: #dbeafe;
}

body.dark-mode .checkout-cart-nav:hover,
body.dark-mode .checkout-cart-nav:focus {
  background: rgba(59, 130, 246, 0.34);
  color: #ffffff;
}

body.dark-mode .checkout-cart-nav__count {
  background: #dbeafe;
  color: #1e3a8a;
}

body.dark-mode .drawer-carro-compra__header,
body.dark-mode .drawer-carro-compra__footer {
  border-color: rgba(71, 85, 105, 0.45);
}

body.dark-mode .checkout-cart-item,
body.dark-mode .checkout-cart-empty,
body.dark-mode .checkout-cart-status {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.45);
  color: #e2e8f0;
}

body.dark-mode .checkout-cart-item__body small,
body.dark-mode .drawer-carro-compra__server-summary,
body.dark-mode .drawer-carro-compra__subtitle,
body.dark-mode .drawer-carro-compra__section-heading span,
body.dark-mode .drawer-carro-compra__footer-note {
  color: #94a3b8;
}

body.dark-mode .drawer-carro-compra__section-heading strong {
  color: #f8fafc;
}

body.dark-mode .drawer-carro-compra__step {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.45);
  color: #cbd5e1;
}

body.dark-mode .drawer-carro-compra__step.is-active {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.3);
}

body.dark-mode .checkout-cart-status.is-info {
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

body.dark-mode .checkout-cart-status.is-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

body.dark-mode .checkout-cart-status.is-error {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

@media (max-width: 767.98px) {
  .checkout-cart-fab {
    right: 14px;
    --checkout-cart-fab-bottom: 84px;
    padding: 0.75rem 0.9rem;
  }

  .vista-empresa-page .checkout-cart-fab {
    --checkout-cart-fab-bottom: 104px;
  }

  .checkout-cart-nav {
    min-height: 2.75rem;
  }

  .drawer-carro-compra {
    width: 100%;
  }

  .drawer-carro-compra__steps,
  .drawer-carro-compra__actions {
    grid-template-columns: 1fr;
  }

  .drawer-carro-compra__actions {
    flex-direction: column;
  }
}
