@media (max-width: 767px) {
  html,
  body {
    height: 100%;
  }

  body.mpk-cart-modal-open,
  body.mpk-popup-open {
    overflow: hidden;
  }

  .mpk-cart-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    z-index: 2147483647;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 74px 0 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    box-sizing: border-box;
    overflow: hidden;
  }

  .mpk-cart-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mpk-cart-modal {
    position: relative;
    width: 100%;
    height: calc(100vh - 74px);
    height: calc(100dvh - 74px);
    max-height: calc(100vh - 74px);
    max-height: calc(100dvh - 74px);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    z-index: 2;
  }

  @supports (-webkit-touch-callout: none) {
    .mpk-cart-modal {
      height: calc(100svh - 74px);
      max-height: calc(100svh - 74px);
    }
  }

  .mpk-cart-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 16px 52px 16px 16px;
    border-bottom: 1px solid #ececec;
    box-sizing: border-box;
    flex: 0 0 auto;
  }

  .mpk-cart-modal-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 700;
    color: #111111;
    text-align: center;
  }

  .mpk-cart-modal-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
  }

  .mpk-cart-modal-close::before,
  .mpk-cart-modal-close::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 9px;
    width: 20px;
    height: 2px;
    background: #111111;
    border-radius: 2px;
  }

  .mpk-cart-modal-close::before {
    transform: rotate(45deg);
  }

  .mpk-cart-modal-close::after {
    transform: rotate(-45deg);
  }

  .mpk-cart-modal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    box-sizing: border-box;
  }

  .mpk-cart-modal-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 8px;
  }

  .mpk-cart-item {
    position: relative;
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 28px 12px 0;
    border-bottom: 1px solid #efefef;
  }

  .mpk-cart-item-image img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
  }

  .mpk-cart-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .mpk-cart-item-name {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
    color: #111111;
  }

  .mpk-cart-item-name a {
    color: #111111;
    text-decoration: none;
  }

  .mpk-cart-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mpk-cart-item-availability {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    color: #111111;
    font-weight: 600;
  }

  .mpk-cart-item-price {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    color: #111111;
    text-align: right;
    white-space: nowrap;
  }

  .mpk-cart-item-price strong {
    font-weight: 700;
  }

  .mpk-cart-item-remove {
    position: absolute;
    top: 10px;
    right: 0;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
  }

  .mpk-cart-item-remove::before,
  .mpk-cart-item-remove::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 3px;
    width: 16px;
    height: 2px;
    background: #111111;
    border-radius: 2px;
  }

  .mpk-cart-item-remove::before {
    transform: rotate(45deg);
  }

  .mpk-cart-item-remove::after {
    transform: rotate(-45deg);
  }

  .mpk-cart-empty {
    padding: 24px 8px;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
    color: #111111;
  }

  .mpk-cart-modal-footer {
    flex: 0 0 auto;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid #ececec;
    background: #ffffff;
  }

  .mpk-cart-free-shipping {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.45;
    color: #111111;
  }

  .mpk-cart-free-shipping strong {
    color: #3c840f;
    font-weight: 700;
  }

  .mpk-cart-modal-total {
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 16px;
    line-height: 1.3;
    color: #111111;
  }

  .mpk-cart-modal-total strong {
    font-size: 18px;
    font-weight: 700;
  }

  .mpk-cart-modal-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
    border-radius: 14px;
    text-decoration: none;
    background: #000000;
    color: #ffffff;
    border: 1px solid #000000;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
  }

  .mpk-cart-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 74px 16px 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    box-sizing: border-box;
  }

  .mpk-cart-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mpk-cart-popup {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border-radius: 22px;
    padding: 28px 20px 20px;
    box-sizing: border-box;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(-10px);
    transition: transform 0.25s ease;
  }

  .mpk-cart-popup-overlay.is-visible .mpk-cart-popup {
    transform: translateY(0);
  }

  .mpk-cart-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
  }

  .mpk-cart-popup-close::before,
  .mpk-cart-popup-close::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 9px;
    width: 20px;
    height: 2px;
    background: #1f1f1f;
    border-radius: 2px;
  }

  .mpk-cart-popup-close::before {
    transform: rotate(45deg);
  }

  .mpk-cart-popup-close::after {
    transform: rotate(-45deg);
  }

  .mpk-cart-popup-title {
    margin: 0 0 18px;
    font-size: 31px;
    line-height: 1.1;
    font-weight: 700;
    color: #111111;
    text-align: center;
  }

  .mpk-cart-popup-product {
    margin: 0 0 16px;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    color: #111111;
    text-align: center;
  }

  .mpk-cart-popup-delivery {
    display: none;
    margin: 0 0 20px;
    padding: 0;
    border-radius: 14px;
    background: #ffffff;
  }

  .mpk-cart-popup-delivery.is-visible {
    display: block;
  }

  .mpk-cart-popup-delivery-text {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.45;
    color: #111111;
    text-align: left;
  }

  .mpk-cart-popup-delivery-text strong {
    font-weight: 700;
    color: #3c840f !important;
  }

  .mpk-cart-popup-progress {
    width: 100%;
    height: 6px;
    background: #d9d9d9;
    border-radius: 999px;
    overflow: hidden;
  }

  .mpk-cart-popup-progress-bar {
    width: 0;
    height: 100%;
    background: #000000 !important;
    border-radius: 999px;
    transition: width 0.3s ease;
  }

  .mpk-cart-popup-buttons {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
  }

  .mpk-cart-popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(50% - 5px);
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 600;
    box-sizing: border-box;
    transition: all 0.2s ease;
    text-align: center;
  }

  .mpk-cart-popup-btn-back {
    background: #f3f3f3;
    color: #111111;
    border: 1px solid #e5e5e5;
  }

  .mpk-cart-popup-btn-cart {
    background: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
  }
}
@media (max-width: 767px) {
  a[data-testid="headerCart"] {
    position: relative;
  }

  .mpk-cart-count-badge {
    position: absolute;
    top: 2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ebebeb;
    border: 1.5px solid #000000;
    color: #000000;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    z-index: 5;
    display: none;
  }

  .mpk-cart-count-badge.is-visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}