.yl-cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4990;
  display: none;
  background: rgba(15, 23, 42, .22);
  opacity: 0;
  transition: opacity .24s ease;
}

.yl-cart-drawer-backdrop.is-visible {
  display: block;
  opacity: 1;
}

.yl-cart-drawer.is-drawer {
  position: fixed !important;
  inset: 0 0 0 auto !important;
  z-index: 5000 !important;
  width: min(420px, calc(100vw - 16px)) !important;
  height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 24px 0 0 24px !important;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: -22px 0 60px rgba(15, 23, 42, .25) !important;
  transform: translateX(105%);
  transition: transform .3s cubic-bezier(.22, .8, .24, 1);
  pointer-events: none;
}

.yl-cart-drawer.is-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 !important;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, #0f172a 0%, #123047 54%, #0e7490 100%);
  overflow: hidden;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-head::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -100px;
  border-radius: 50%;
  background: rgba(45, 212, 191, .2);
  filter: blur(4px);
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-head-copy,
.yl-cart-drawer.is-drawer .yl-cart-drawer-close { position: relative; z-index: 1; }

.yl-cart-drawer.is-drawer .yl-cart-drawer-kicker {
  margin-bottom: .18rem;
  color: #99f6e4;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-subtitle {
  margin-top: .35rem;
  color: rgba(255, 255, 255, .74);
  font-size: .82rem;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  font-size: 1.05rem;
  transition: background-color .18s ease, transform .18s ease;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-close:hover,
.yl-cart-drawer.is-drawer .yl-cart-drawer-close:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .22);
  transform: rotate(4deg);
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > .d-flex.align-items-center.justify-content-between {
  margin: 0 !important;
  padding: 1rem 1.25rem .7rem;
  color: #0f172a;
  background: #fff;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > .d-flex.align-items-center.justify-content-between .fw-semibold {
  font-size: 1rem;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > #ylMiniCartItems {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  padding: 0 1.25rem 1rem;
  overflow-x: hidden !important;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  overflow-y: auto;
  background: #fff;
}

.yl-cart-drawer.is-drawer .yl-mini-cart-item {
  padding: .8rem;
  border-color: #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .04);
}

.yl-cart-drawer.is-drawer .yl-mini-cart-thumb {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  border-radius: 14px;
  background: #f8fafc;
}

.yl-cart-drawer.is-drawer .yl-mini-cart-name { font-size: .92rem; font-weight: 700; color: #172033; }
.yl-cart-drawer.is-drawer .yl-mini-cart-price { color: #0e7490; font-size: .9rem !important; }

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > hr {
  margin: 0 !important;
  border-color: #e2e8f0;
  opacity: 1;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > .d-flex.align-items-center.justify-content-between.mb-2 {
  margin: 0 !important;
  padding: .95rem 1.25rem .65rem;
  background: #fff;
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > .d-grid.gap-2:last-child {
  gap: .6rem !important;
  padding: .9rem 1.25rem 1.2rem;
  background: #fff;
  box-shadow: 0 -12px 24px rgba(15, 23, 42, .07);
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > .d-grid.gap-2:last-child .btn-dark {
  border: 0;
  border-radius: 14px;
  padding: .8rem 1rem;
  background: linear-gradient(135deg, #0f172a, #0e7490);
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(14, 116, 144, .18);
}

.yl-cart-drawer.is-drawer .yl-cart-drawer-body > .d-grid.gap-2:last-child .btn-outline-danger {
  border-radius: 14px;
  font-weight: 700;
}

body.yl-cart-drawer-open { overflow: hidden; }

  .yl-mini-cart-item.yl-cart-item-new {
    animation: yl-cart-item-pulse .72s ease-in-out 3 both;
    border-color: rgba(14, 116, 144, .62) !important;
    background: linear-gradient(90deg, rgba(207, 250, 254, .72), rgba(255, 255, 255, .98)) !important;
  }

.yl-cart-new-badge {
  display: inline-flex;
  align-items: center;
  margin-left: .45rem;
  padding: .16rem .42rem;
  border-radius: 999px;
  color: #075985;
  background: #cffafe;
  font-size: .64rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
    animation: yl-cart-new-badge .72s ease-in-out 3 both;
}

@keyframes yl-cart-item-pulse {
  0%, 100% { box-shadow: 0 5px 16px rgba(15, 23, 42, .04); }
  18%, 52% { box-shadow: 0 0 0 5px rgba(45, 212, 191, .18), 0 10px 26px rgba(14, 116, 144, .18); }
  35%, 70% { box-shadow: 0 0 0 2px rgba(45, 212, 191, .08), 0 7px 20px rgba(14, 116, 144, .10); }
}

@keyframes yl-cart-new-badge {
  0%, 100% { opacity: .35; transform: scale(.92); }
  22%, 58% { opacity: 1; transform: scale(1.04); }
  40%, 76% { opacity: .7; transform: scale(.98); }
}

/* Hover keeps the original compact dropdown; click switches to the drawer. */
.yl-cart-drawer:not(.is-drawer) {
  position: absolute !important;
  inset: auto 0 auto auto !important;
  top: calc(100% + 8px) !important;
  width: min(420px, 92vw) !important;
  height: auto !important;
  max-height: none !important;
  border: 1px solid rgba(15, 23, 42, .12) !important;
  border-radius: var(--yl-nav-radius-lg) !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18) !important;
  transform: none;
  pointer-events: auto;
}

.yl-cart-drawer:not(.is-drawer) .yl-cart-drawer-body {
  display: block;
  height: auto;
  padding: 1rem !important;
}

.yl-cart-drawer:not(.is-drawer) .yl-cart-drawer-head { display: none; }
.yl-cart-drawer:not(.is-drawer) .yl-cart-drawer-body > .d-flex.align-items-center.justify-content-between,
.yl-cart-drawer:not(.is-drawer) .yl-cart-drawer-body > .d-flex.align-items-center.justify-content-between.mb-2 {
  padding: 0;
  background: transparent;
}

.yl-cart-drawer:not(.is-drawer) .yl-cart-drawer-body > #ylMiniCartItems {
  display: grid;
  flex: none;
  max-height: 320px !important;
  padding: 0;
  align-content: start;
  overflow-y: auto;
}

.yl-cart-drawer:not(.is-drawer) .yl-cart-drawer-body > .d-grid.gap-2:last-child {
  padding: 0;
  box-shadow: none;
}

@media (max-width: 575.98px) {
  .yl-cart-drawer.is-drawer {
    width: 100vw !important;
    border-radius: 0 !important;
  }
  .yl-cart-drawer-head { padding: 1.1rem 1rem; }
  .yl-cart-drawer-body > .d-flex.align-items-center.justify-content-between,
  .yl-cart-drawer-body > #ylMiniCartItems,
  .yl-cart-drawer-body > .d-flex.align-items-center.justify-content-between.mb-2,
  .yl-cart-drawer-body > .d-grid.gap-2:last-child { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .yl-cart-drawer,
  .yl-cart-drawer-backdrop,
  .yl-cart-drawer-close { transition: none; }
}
