:root {
  --glass-blur: 20px;
  --glass-base: rgba(255,255,255,0.35);
  --glass-accent: rgba(255,255,255,0.4);
  --shadow-color: rgba(0,0,0,0.25);
  --sheet-max-height: 80vh;
  --sheet-peek-height: 100px;
  --transition-fast: 0.26s cubic-bezier(.25,.8,.5,1);
}

.cart-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--glass-base);
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 20px 40px var(--shadow-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cart-float:hover {
  box-shadow: 0 25px 50px var(--shadow-color);
}

.cart-float:active {
  transform: scale(0.93);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.cart-icon {
  font-size: 24px;
  position: relative;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: black;
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  transform-origin: center;
  transition: transform 0.2s ease-out;
}

.cart-count.bump {
  animation: bump 0.35s ease-out;
}

@keyframes bump {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.cart-sheet {
  position: fixed;
  left: 0;
  right: 0;
  
  height: var(--sheet-max-height);
  background: var(--glass-base);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -15px 40px var(--shadow-color);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  
}



.sheet-grabber {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
  margin: 6px auto 12px;
}

.sheet-title {
  font-size: 22px;
  margin: 0 0 12px;
  color: #000;
}

.sheet-items {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.sheet-buy {
  width: 100%;
  padding: 14px 0;
  margin-top: 14px;
  border: none;
  border-radius: 16px;
  background: #000;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sheet-buy:hover {
  background: #222;
}
/* ==============================
   ITEM DEL CARRITO
============================== */
.cart-item{
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 8px;

  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
}

/* TEXTO */
.cart-item span{
  font-size: 14px;
  color: #fff;
}

/* BOTÓN QUITAR ✕ */
.cart-remove{
  background: rgba(255,255,255,0.15);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;

  color: #fff;
  font-size: 14px;
  line-height: 1;

  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.cart-remove:active{
  transform: scale(.85);
  background: rgba(255,255,255,0.3);
}
/* ==============================
   OVERLAY CARRITO
============================== */
.cart-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 1.35s ease;
  z-index: 998;
}

/* visible */
.cart-overlay.show{
  opacity: 1;
  pointer-events: auto;
}

/* ==============================
   ANIMACIÓN PANEL
============================== */
.cart-sheet{
  transform: translateY(100%);
  transition: transform 0.8s cubic-bezier(.25,.8,.25,1);
  will-change: transform;
}

.cart-sheet.open{
  transform: translateY(0);
}
.cart-overlay{
  transition: opacity .5s ease;
}
.cart-sheet{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  height: var(--sheet-max-height);

  transform: translateY(100%);
  transition: transform 1.2s cubic-bezier(.25,.8,.25,1);
  will-change: transform;

  background: var(--glass-base);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -15px 40px var(--shadow-color);
  z-index: 9998;

  display: flex;
  flex-direction: column;
  padding: 14px 20px;
}

.cart-sheet.open{
  transform: translateY(0);
}
/* ==============================
   PANEL CARRITO – SOLO DESKTOP
============================== */
@media (min-width: 1024px){

  .cart-sheet{
    width: 380px;           /* 👈 ancho chico */
    max-height: 420px;      /* 👈 altura mucho menor */
    height: auto;

    right: 24px;
    left: auto;
    bottom: 96px;           /* queda flotando arriba del botón */

    border-radius: 24px;
    padding: 16px 18px;

    transform: translateY(20px) scale(0.96);
    transition: transform 0.45s cubic-bezier(.25,.8,.25,1),
                opacity 0.35s ease;

    opacity: 0;
  }

  .cart-sheet.open{
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .sheet-items{
    max-height: 240px;
  }
}
/* ==============================
   CARRITO MINI SOLO DESKTOP
============================== */
@media (min-width: 1024px){

  .cart-sheet{
    /* anula comportamiento mobile */
    left: auto !important;
    right: 24px !important;
    bottom: 96px !important;

    width: 360px !important;
    height: auto !important;
    max-height: 420px !important;

    border-radius: 22px !important;

    transform: translateY(20px) scale(0.95) !important;
    opacity: 0;

    transition:
      transform 0.45s cubic-bezier(.25,.8,.25,1),
      opacity 0.35s ease !important;
  }

  .cart-sheet.open{
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
  }

  .sheet-items{
    max-height: 240px;
  }
}
@media (min-width: 1024px){
  .cart-sheet{
    width: 360px;
    max-height: 420px;
    right: 24px;
    left: auto;
    bottom: 96px;
    border-radius: 22px;
  }
}

.cart-item{
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

/* HEADER ITEM */
.cart-main{
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.cart-text strong{
  display: block;
  font-size: 15px;
  color: #fff;
}

.cart-text small{
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

/* FLECHA */
.cart-arrow{
  font-size: 22px;
  transform: rotate(0deg) scaleX(1.4);
  transition: transform .45s cubic-bezier(.25,.8,.25,1);
  color: #fff;
}

.cart-arrow.open{
  transform: rotate(180deg) scaleX(1.4);
}

/* CONTENIDO OCULTO */
.cart-extra{
  max-height: 0;
  opacity: 0;
  transition: all .6s cubic-bezier(.25,.8,.25,1);
}

.cart-extra.show{
  max-height: 300px;
  opacity: 1;
}

.cart-extra img{
  width: 100%;
  border-radius: 14px;
  margin-top: 10px;
}

/* BOTÓN QUITAR */
.cart-remove{
  position: absolute;
  top: 10px;
  right: 10px;
}