/* EcommerceFull3 product cards: administrator-selectable mobile badges.
   Applies only to product listings, never the product details page. */
.ecf-mobile-labels-below,
.ecf-mobile-labels-icons { display: none; }

@media (max-width: 767px) {
  /* A - Compact overlays. Keep theme-defined label colors and icons. */
  .ecf-mobile-labels-a .product-layout .product-thumb .image > .product-labels {
    position: absolute !important;
    top: 5px !important; right: 5px !important;
    bottom: auto !important; left: auto !important;
    width: auto !important; max-width: calc(100% - 10px);
    display: flex !important; flex-direction: column;
    align-items: flex-end; gap: 3px; z-index: 5;
    pointer-events: none;
  }
  .ecf-mobile-labels-a .product-layout .image > .product-labels > .product-label {
    position: static !important; transform: none !important;
    inset: auto !important; margin: 0 !important;
    width: auto !important; max-width: 100%; min-width: 0 !important;
  }
  .ecf-mobile-labels-a .product-layout .image > .product-labels .product-label strong {
    box-sizing: border-box; display: block !important;
    max-width: 100%; min-width: 0 !important; min-height: 0 !important;
    padding: 3px 5px !important; font-size: 10px !important;
    line-height: 1.25 !important; text-align: right;
    white-space: normal !important; overflow-wrap: anywhere;
  }

  /* B - Only accessible icon buttons over the photo. Tap to expand. */
  .ecf-mobile-labels-b .product-layout .image > .product-labels {
    display: none !important;
  }
  .ecf-mobile-labels-b .product-layout .image-group {
    position: relative;
  }
  .ecf-mobile-labels-b .product-layout .ecf-mobile-labels-icons {
    position: absolute; z-index: 8; top: 5px; right: 5px;
    max-width: calc(100% - 10px);
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px;
  }
  .ecf-mobile-labels-b .product-layout .ecf-mobile-label-icon {
    position: relative; margin: 0; padding: 0;
  }
  .ecf-mobile-labels-b .product-layout .ecf-mobile-label-icon summary {
    display: flex; align-items: center; justify-content: center;
    list-style: none; cursor: pointer;
    width: 30px; height: 30px; border: 1px solid #d5d5d5;
    border-radius: 50%; background: #fff; color: #222;
    font-size: 16px; line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  }
  .ecf-mobile-labels-b .product-layout .ecf-mobile-label-icon summary::-webkit-details-marker { display: none; }
  .ecf-mobile-labels-b .product-layout .ecf-mobile-label-icon summary:focus-visible {
    outline: 2px solid #1b68ba; outline-offset: 2px;
  }
  .ecf-mobile-labels-b .product-layout .ecf-mobile-label-explanation {
    position: absolute; top: calc(100% + 4px); right: 0;
    display: block; width: max-content; max-width: min(220px, 80vw);
    padding: 6px 8px; border-radius: 5px;
    background: #202020; color: #fff; font: 500 12px/1.35 system-ui, sans-serif;
    text-align: left; white-space: normal; overflow-wrap: anywhere;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .2);
  }

  /* C - Labels below the picture, no overlay and no loss of legibility. */
  .ecf-mobile-labels-c .product-layout .image > .product-labels {
    display: none !important;
  }
  .ecf-mobile-labels-c .product-layout .ecf-mobile-labels-below {
    box-sizing: border-box;
    display: flex !important; flex-flow: row wrap;
    align-items: center; justify-content: center;
    gap: 4px; padding: 5px 2px 2px;
    width: 100%; max-width: 100%;
    min-width: 0; position: relative !important;
    inset: auto !important; transform: none !important;
    overflow: visible;
  }
  .ecf-mobile-labels-c .product-layout .ecf-mobile-labels-below > .product-label {
    display: inline-flex !important;
    position: static !important; inset: auto !important;
    transform: none !important; margin: 0 !important;
    width: auto !important; max-width: 100%; min-width: 0 !important;
  }
  .ecf-mobile-labels-c .product-layout .ecf-mobile-labels-below .product-label strong {
    display: inline-block !important;
    box-sizing: border-box; min-width: 0 !important;
    min-height: 0 !important; max-width: 100%;
    padding: 3px 5px !important; font-size: 10px !important;
    line-height: 1.3 !important;
    white-space: normal !important; overflow-wrap: anywhere;
  }
}
