/* --- Floating Cart Container--- */
.floating-cart {
  position: fixed;
  bottom: 0;
  width: 40rem;
  max-height: 80vh;
  background: var(--White);
  border-radius: 1.6rem 1.6rem 0 0;
  box-shadow: 0 -0.4rem 1rem rgba(0, 0, 0, 0.1);
  transform: translateY(110%);
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  text-align: center;
  right: max(var(--min-viewport-margin), calc(50% - (var(--max-content-width) / 2) + var(--cart-offset-from-content)));
}

.floating-cart.active {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 57.5rem) {
  .floating-cart {
    right: auto;
    width: 100%;
    height: 100vh;
    min-height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    border-radius: 0;
  }

  .floating-cart.active {
    display: flex;
  }
}

/* --- Floating Cart Content--- */
.floating-cart__content {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) var(--space-md);
}

.floating-cart__content h2 {
  font-weight: var(--font-weight-900);
  font-size: clamp(2rem, 2.2vw, 2.4rem);
}

@media (max-width: 57.5rem) {
  .floating-cart__content {
    width: 100%;
    max-height: 85vh;
    margin: var(--space-4xl);
    background: var(--White);
    border-radius: 1.6rem;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

@media (max-width: 35rem) {
  .floating-cart__content {
    margin: var(--space-md);
  }
}

/* --- Cart Items--- */
.cart-panel__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.cart__items {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.5rem;
}

.cart__item {
  margin-bottom: var(--space-md);
  text-align: left;
}

.cart__item-name {
  display: flex;
  justify-content: space-between;
  font-weight: var(--font-weight-500);
  font-size: 1.6rem;
}

.cart__item-name i {
  color: var(--Slate-300);
}

.cart__item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-size: 1.6rem;
}

.cart__item-controls i {
  color: var(--Slate-300);
}

.cart__item-controls button {
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-weight: bold;
}

.cart__item-quantity {
  width: 3rem;
  text-align: center;
  display: inline-block;
}

.cart__item-controls span.cart__item-quantity {
  min-width: 1.5rem;
  text-align: center;
}

/* --- Cart Summary--- */
.cart__summary {
  font-size: 1.6rem;
  border-top: 1px solid var(--Slate-200);
  padding-top: var(--space-md);
}

.cart__summary-items {
  display: flex;
  justify-content: space-between;
}

.cart__summary-order-btn {
  background: var(--Red);
  color: var(--White);
  font-weight: var(--font-weight-900);
  border-radius: 2.6rem;
  padding: 1.2rem 4rem;
  font-size: 1.6rem;
  transition: background-color 0.4s ease-in-out, color 0.4s ease-in-out, transform 0.2s ease;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 3px 3px 10px 0px rgba(0, 0, 0, 0.1);
  position: relative;
  margin: var(--space-xl) 0;
}

.cart__summary-order-btn:hover {
  background: var(--Slate-500);
}

/* --- Order Switch--- */
.order-switch {
  position: relative;
  margin: var(--space-xl) 0;
}

.order-switch__checkbox {
  display: none;
}

.order-switch__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--Slate-100);
  border-radius: 3rem;
  cursor: pointer;
  position: relative;
  user-select: none;
  height: 5rem;
}

.order-switch__option {
  flex: 1;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  transition: color 0.4s;
}

.order-switch__option--delivery {
  flex-direction: row;
  gap: 1rem;
}

.order-switch__option--pickup {
  gap: 1rem;
}

.order-switch__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.4rem;
  color: var(--Slate);
}

.order-switch__option--delivery i,
.order-switch__option--pickup i {
  color: var(--Slate);
}

.order-switch__time {
  color: var(--Slate);
  font-size: 1.2rem;
}

.order-switch__slider {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  left: 0.3rem;
  width: calc(50% - 0.3rem);
  background: var(--White);
  border-radius: 2.6rem;
  transition: transform 0.5s ease;
}

.order-switch__checkbox:checked + .order-switch__label .order-switch__slider {
  transform: translateX(100%);
}

/* --- Cart Count Badge --- */
.cart-count {
  position: absolute;
  top: -0.7rem;
  right: +1.8rem;
  background-color: var(--Orange);
  color: var(--Slate-500);
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 57.5rem) {
  .cart-count {
    top: -0.7rem;
    right: calc(50% - 4.8rem);
  }
}

/* --- Cart Overlay --- */
.cart__order-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--Red);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

.cart__order-overlay__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--White);
  font-size: 1.6rem;
  font-weight: var(--font-weight-900);
  margin: 0 var(--space-md);
}

.cart__order-overlay__content img {
  border-radius: 1.6rem;
  width: 65%;
}

.cart__order-overlay__content p {
  margin-top: var(--space-md);
  text-align: center;
}
