/* Floating Crytalix liquid-glass "View cart" dock */

.cart-glass {
  --cg-ink: #ffffff;
  --cg-brand: var(--brand, #810100);
  --cg-ring: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.14) 30%,
    transparent 50%,
    transparent 100%
  );

  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px) + 12px);
  translate: -50% calc(100% + 28px);
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(92vw, 360px);
  height: 58px;
  box-sizing: border-box;
  padding: 6px 14px 6px 8px;
  margin: 0;
  border: 0;
  border-radius: 99em;
  text-decoration: none;
  color: var(--cg-ink);
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  isolation: isolate;
  overflow: hidden;
  /* Crytalix glass — brand red + white text */
  background: linear-gradient(
    180deg,
    rgba(158, 22, 20, 0.88) 0%,
    rgba(129, 1, 0, 0.82) 48%,
    rgba(92, 0, 0, 0.86) 100%
  );
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(129, 1, 0, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.12);
  transition:
    translate 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    bottom 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    visibility 0.28s,
    box-shadow 0.35s cubic-bezier(1, 0, 0.4, 1),
    background 0.35s cubic-bezier(1, 0, 0.4, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Crytalix top-fade border ring (mask-composite) */
.cart-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  pointer-events: none;
  z-index: 2;
  background: var(--cg-ring);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.cart-glass > * {
  position: relative;
  z-index: 3;
}

.cart-glass.is-visible {
  translate: -50% 0;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.cart-glass.is-bump {
  animation: cartGlassBump 0.44s ease;
}

@keyframes cartGlassBump {
  0% { scale: 1 1; }
  45% { scale: 1.06 1.02; }
  100% { scale: 1 1; }
}

.cart-glass__thumbs {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding-left: 2px;
}

.cart-glass__thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f4f6;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: block;
  margin-left: -10px;
  position: relative;
}

.cart-glass__thumb:first-child {
  margin-left: 0;
  z-index: 4;
}

.cart-glass__thumb:nth-child(2) { z-index: 3; }
.cart-glass__thumb:nth-child(3) { z-index: 2; }
.cart-glass__thumb:nth-child(4) { z-index: 1; }

.cart-glass__thumb--ph {
  display: grid;
  place-items: center;
  color: #9ca3af;
  font-size: 14px;
  background: linear-gradient(145deg, #f8f8f9, #ebecef);
}

.cart-glass__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 2px;
}

.cart-glass__label {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--cg-ink);
  white-space: nowrap;
}

.cart-glass__sub {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.cart-glass__arrow {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cg-brand);
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(0, 0, 0, 0.18);
}

.cart-glass__arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Lift above the floating discount / offers badge in the bottom nav */
html:has(.bottom-nav__item--offer) .cart-glass {
  bottom: calc(var(--bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px) + 28px);
}

html:has(.bottom-nav.is-scroll-hidden) .cart-glass,
html.chrome-scroll-hidden .cart-glass {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transition:
    translate 0.36s cubic-bezier(0.4, 0, 1, 1),
    bottom 0.36s cubic-bezier(0.4, 0, 1, 1),
    opacity 0.26s ease,
    visibility 0.26s,
    box-shadow 0.35s cubic-bezier(1, 0, 0.4, 1),
    background 0.35s cubic-bezier(1, 0, 0.4, 1);
}

/* Restaurant menu: nav may hide on scroll, View cart stays on top and visible */
html:has(.rv-detail):has(.bottom-nav.is-scroll-hidden) .cart-glass,
html:has(.rv-detail).chrome-scroll-hidden .cart-glass {
  z-index: 160;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
html:has(.rv-detail):has(.bottom-nav.is-scroll-hidden) .cart-glass.is-visible,
html:has(.rv-detail).chrome-scroll-hidden .cart-glass.is-visible {
  translate: -50% 0;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html.keyboard-open .cart-glass,
body.keyboard-open .cart-glass,
html.search-float-open .cart-glass,
html.offer50-open .cart-glass,
html:has(.live-chat) .cart-glass,
body[data-page="chat"] .cart-glass {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

@media (max-width: 380px) {
  .cart-glass {
    height: 54px;
    padding: 5px 12px 5px 7px;
    gap: 8px;
  }
  .cart-glass__thumb {
    width: 36px;
    height: 36px;
    margin-left: -9px;
  }
  .cart-glass__label {
    font-size: 13px;
  }
  .cart-glass__arrow {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cart-glass,
  .cart-glass.is-bump {
    transition: none !important;
    animation: none !important;
  }
}

@supports not (backdrop-filter: blur(8px)) {
  .cart-glass {
    background: linear-gradient(
      180deg,
      #9e1614 0%,
      #810100 48%,
      #5c0000 100%
    );
  }
}
