.dfm-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
  visibility: hidden;
}

.dfm-cart-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.dfm-cart-drawer__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(11, 18, 28, 0);
  cursor: default;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

.dfm-cart-drawer.is-open .dfm-cart-drawer__overlay {
  background: rgba(11, 18, 28, 0.2);
  opacity: 1;
}

.dfm-cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(420px, 100vw);
  height: 100vh;
  background: #ffffff;
  color: #101828;
  box-shadow: -28px 0 60px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 220ms ease;
  outline: 0;
}

.dfm-cart-drawer.is-open .dfm-cart-drawer__panel {
  transform: translateX(0);
}

.dfm-cart-drawer__header {
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8edf2;
}

.dfm-cart-drawer__header h2 {
  margin: 0;
  color: #101828;
  font-size: 1.08rem;
  font-weight: 800;
  text-align: center;
}

.dfm-cart-drawer__close,
.dfm-cart-drawer__count {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 6px;
}

.dfm-cart-drawer__close {
  border: 0;
  background: #f3f7f6;
  color: #101828;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.dfm-cart-drawer__count {
  background: #eef4f2;
  color: #101828;
  font-size: 0.86rem;
  font-weight: 800;
}

.dfm-cart-drawer__body {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 18px;
}

.dfm-cart-drawer__items {
  display: grid;
  gap: 0;
}

.dfm-cart-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 16px;
  border-bottom: 1px solid #edf1f4;
}

.dfm-cart-item__image {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 6px;
  background: #f4f7f9;
}

.dfm-cart-item__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dfm-cart-item__main {
  min-width: 0;
}

.dfm-cart-item__title {
  display: block;
  color: #0f6b51;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.32;
  text-decoration: none;
}

.dfm-cart-item__title:hover {
  color: #0b4b39;
}

.dfm-cart-item__price {
  display: block;
  margin-top: 8px;
  color: #101828;
  font-size: 0.82rem;
  font-weight: 800;
}

.dfm-cart-item__remove {
  display: inline-block;
  margin-top: 8px;
  color: #0f6b51;
  font-size: 0.78rem;
  text-decoration: underline;
}

.dfm-cart-item__qty {
  display: inline-grid;
  grid-template-columns: 34px 40px 34px;
  width: max-content;
  min-height: 34px;
  margin-top: 12px;
  border: 1px solid #dfe6ec;
  border-radius: 6px;
  overflow: hidden;
}

.dfm-cart-item__qty button,
.dfm-cart-item__qty span {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 34px;
  min-height: 34px;
  border: 0;
  background: #ffffff;
  color: #101828;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
}

.dfm-cart-item__qty button {
  appearance: none;
  padding: 0;
  cursor: pointer;
}

.dfm-cart-item__qty button:hover {
  background: #f2f7f5;
}

.dfm-cart-item__qty button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.dfm-cart-drawer__footer {
  padding: 14px 16px 16px;
  border-top: 1px solid #e8edf2;
  background: #ffffff;
  box-shadow: 0 -16px 32px rgba(15, 23, 42, 0.05);
}

.dfm-cart-drawer__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f4;
  color: #101828;
  font-size: 0.92rem;
}

.dfm-cart-drawer__row strong {
  color: #101828;
}

.dfm-cart-drawer__checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 6px;
  background: #0f6b51;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.dfm-cart-drawer__checkout:hover {
  background: #0b4b39;
  color: #ffffff;
}

.dfm-cart-drawer__empty {
  display: grid;
  align-content: center;
  min-height: 260px;
  padding: 24px;
  text-align: center;
}

.dfm-cart-drawer__empty p {
  margin: 0 0 12px;
  color: #556070;
}

.dfm-cart-drawer.is-loading .dfm-cart-drawer__panel {
  cursor: wait;
}

.dfm-cart-drawer.is-loading .dfm-cart-drawer__body {
  opacity: 0.58;
}

html.dfm-cart-drawer-open,
html.dfm-cart-drawer-open body {
  overflow: hidden;
}

@media (max-width: 640px) {
  .dfm-cart-drawer__panel {
    width: min(390px, 100vw);
  }
}
