/* Eye Sight City: contained Bag/Wishlist popup + visible close controls. */

/* The cart/wishlist controls in the main page are empty buttons; render a clear cross. */
button.icon-btn[aria-label*="Close"] {
  box-sizing: border-box !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  flex: 0 0 40px !important;
  color: #202425 !important;
  background: #f1eee8 !important;
  border: 1px solid rgba(32, 36, 37, .18) !important;
  border-radius: 50% !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
  line-height: 1 !important;
  overflow: visible !important;
}

button.icon-btn[aria-label*="Close"]:empty::before {
  content: "×" !important;
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  color: #202425 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 30px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Preserve the existing position/interaction of dynamically-created close buttons,
   but give their X a high-contrast surface and visible text. */
.vnext-account-close,
.vnext-flow-close,
.vnext-mobile-close,
.mobile-menu-close,
.esc-cart-recovery-close {
  color: #202425 !important;
  background: #f1eee8 !important;
  border: 1px solid rgba(32, 36, 37, .18) !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  display: inline-grid !important;
  place-items: center !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #202425 !important;
}

/* More specific than the dynamically injected mobile-menu colour rule. */
.vnext-mobile-menu .vnext-mobile-close,
.mobile-menu-drawer .mobile-menu-close,
.vnext-account-popup .vnext-account-close,
.vnext-flow-card .vnext-flow-close {
  color: #202425 !important;
  background: #f1eee8 !important;
  border-color: rgba(32, 36, 37, .18) !important;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: #202425 !important;
}

/* Keep the existing desktop side-drawer behavior. On phones, use the old contained
   centered-popup treatment instead of allowing Bag/Wishlist to fill the viewport. */
@media (max-width: 700px) {
  .cart-panel,
  .wishlist-panel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: min(92vw, 420px) !important;
    max-width: 420px !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 82vh !important;
    max-height: 82dvh !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    border: 1px solid rgba(32, 36, 37, .10) !important;
    border-radius: 24px !important;
    background: #fbfaf7 !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .26) !important;
    transform: translate(-50%, -50%) scale(.97) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: 120010 !important;
    transition: opacity .24s ease, transform .24s ease, visibility .24s ease !important;
  }

  .cart-panel.active,
  .wishlist-panel.active {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .cart-panel .cart-header,
  .wishlist-panel .cart-header {
    flex: 0 0 auto !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding-bottom: 14px !important;
  }

  .cart-panel .cart-header > div,
  .wishlist-panel .cart-header > div {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .cart-panel .cart-header h2,
  .wishlist-panel .cart-header h2 {
    font-size: clamp(24px, 7vw, 30px) !important;
    line-height: 1.05 !important;
  }

  .cart-panel .cart-items,
  .wishlist-panel .wishlist-items {
    min-height: 0 !important;
    flex: 0 1 auto !important;
    max-height: 38vh !important;
    max-height: 38dvh !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  .cart-panel .cart-empty,
  .wishlist-panel .wishlist-empty {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    padding: 24px 0 !important;
  }

  .cart-panel .cart-addons {
    flex: 0 0 auto !important;
    max-height: 160px !important;
    overflow: auto !important;
  }

  .cart-panel .cart-summary {
    flex: 0 0 auto !important;
    margin-top: 10px !important;
    padding-top: 12px !important;
  }

  .cart-panel .cart-header .icon-btn,
  .wishlist-panel .cart-header .icon-btn {
    flex: 0 0 40px !important;
  }
}
