/* Native YITH Compare mobile presentation. YITH retains table state and behavior. */
.yith-woocompare-popup-container,
body.yith-woocompare-popup {
  --ap-compare-font-body: var(--e-global-typography-text-font-family, sans-serif), sans-serif;
  --ap-compare-font-display: var(--e-global-typography-primary-font-family, sans-serif), sans-serif;
  --ap-compare-label-width: clamp(84px, 24vw, 96px);
  --ap-compare-product-width: clamp(220px, 68vw, 280px);
  --ap-compare-border: #e3e5e8;
  --ap-compare-muted: #5f6368;
  --ap-compare-surface: #ffffff;
  --ap-compare-surface-muted: #f6f7f8;
  --ap-compare-accent: var(--e-global-color-primary, #ea6a1f);
}

.ap-yith-compare-header {
  display: none;
}

body.admin-bar .yith-woocompare-popup-container {
  z-index: 100000;
}

body.yith-woocompare-popup-open #yith-woocompare-preview-bar {
  display: none !important;
}

@media (min-width: 992px) {
  .yith-woocompare-popup-container table.compare-list .image-wrap .image-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
  }

  .yith-woocompare-popup-container table.compare-list .image-wrap:is(:hover, :focus-within) .image-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .yith-woocompare-popup-container table.compare-list .image-wrap:focus-within .image-overlay .remove a {
    background: #fff;
    border-radius: 4px;
    bottom: 20px;
    display: block;
    font-size: 0;
    height: 30px;
    line-height: 30px;
    margin: 0;
    position: absolute;
    right: 20px;
    width: 30px;
  }

  .yith-woocompare-popup-container table.compare-list .image-wrap:focus-within .image-overlay .remove a > span {
    display: none;
  }

  .yith-woocompare-popup-container table.compare-list .image-wrap:focus-within .image-overlay .remove a::after {
    content: "×";
    font-size: 20px;
  }

  .yith-woocompare-popup-container table.compare-list .image-wrap .image-overlay .remove a:focus-visible {
    outline: 2px solid var(--ap-compare-accent);
    outline-offset: 3px;
  }
}

@media (max-width: 991px) {
  body.yith-woocompare-popup {
    box-sizing: border-box;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--ap-compare-surface) !important;
    color: #202124;
    font-family: var(--ap-compare-font-body);
  }

  .yith-woocompare-popup-container {
    overflow: hidden;
    background: var(--ap-compare-surface);
  }

  .yith-woocompare-popup-container .yith-woocompare-table-wrapper {
    height: 100vh;
    height: 100dvh;
    max-height: none;
    overflow: hidden;
  }

  .yith-woocompare-popup-container .yith-woocompare-table-scroll-wrapper {
    box-sizing: border-box;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--ap-compare-surface);
  }

  .yith-woocompare-popup-container #yith-woocompare,
  body.yith-woocompare-popup #yith-woocompare {
    box-sizing: border-box;
    margin: 0;
    padding: 0 0 24px;
  }

  .ap-yith-compare-header {
    position: sticky;
    top: 0;
    z-index: 1003;
    display: block;
    min-height: 76px;
    box-sizing: border-box;
    padding: max(14px, env(safe-area-inset-top)) 68px 12px 16px;
    border-bottom: 1px solid var(--ap-compare-border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 18px rgba(18, 24, 31, 0.06);
  }

  .ap-yith-compare-header__title {
    margin: 0;
    color: #202124;
    font-family: var(--ap-compare-font-display);
    font-size: clamp(20px, 6vw, 26px);
    font-weight: 700;
    line-height: 1.1;
  }

  .ap-yith-compare-header__hint {
    margin: 5px 0 0;
    color: var(--ap-compare-muted);
    font-size: 12px;
    line-height: 1.35;
  }

  a.yith-woocompare-popup-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    z-index: 1005;
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ap-compare-border);
    border-radius: 50%;
    background: #fff;
    color: #202124;
    box-shadow: 0 4px 14px rgba(18, 24, 31, 0.12);
    font-size: 0;
    line-height: 1;
    text-decoration: none;
  }

  a.yith-woocompare-popup-close::before,
  a.yith-woocompare-popup-close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 21px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    pointer-events: none;
    transform-origin: center;
  }

  a.yith-woocompare-popup-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  a.yith-woocompare-popup-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  a.yith-woocompare-popup-close:hover,
  a.yith-woocompare-popup-close:focus-visible {
    border-color: var(--ap-compare-accent);
    color: var(--ap-compare-accent);
    outline: 3px solid rgba(234, 106, 31, 0.24);
    outline: 3px solid color-mix(in srgb, var(--ap-compare-accent) 24%, transparent);
    outline-offset: 2px;
  }

  .ap-yith-compare-loading {
    display: flex;
    min-height: 52vh;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--ap-compare-muted);
    font: 600 14px/1.4 var(--ap-compare-font-body);
    text-align: center;
  }

  .ap-yith-compare-loading::before {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 3px solid #e3e5e8;
    border-top-color: var(--ap-compare-accent);
    border-radius: 50%;
    content: "";
    animation: ap-yith-compare-spin 0.8s linear infinite;
  }

  .yith-woocompare-popup-container #yith-woocompare-table_wrapper,
  body.yith-woocompare-popup #yith-woocompare-table_wrapper {
    margin: 0;
  }

  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollHead,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollHead,
  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollFoot,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollFoot,
  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollBody > table.compare-list > thead,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollBody > table.compare-list > thead,
  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollBody > table.compare-list > tfoot,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollBody > table.compare-list > tfoot {
    display: none !important;
  }

  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollHeadInner,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollHeadInner,
  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollHeadInner table,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollHeadInner table,
  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollBody table,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollBody table {
    width: var(--ap-compare-table-width, max-content) !important;
    min-width: 100% !important;
    table-layout: fixed !important;
  }

  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollHeadInner,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollHeadInner {
    padding-right: 0 !important;
  }

  .yith-woocompare-popup-container #yith-woocompare .DTFC_LeftWrapper,
  body.yith-woocompare-popup #yith-woocompare .DTFC_LeftWrapper {
    display: none !important;
  }

  .yith-woocompare-popup-container #yith-woocompare col.ap-yith-compare-column--label,
  body.yith-woocompare-popup #yith-woocompare col.ap-yith-compare-column--label {
    width: var(--ap-compare-label-width);
  }

  .yith-woocompare-popup-container #yith-woocompare col.ap-yith-compare-column--product,
  body.yith-woocompare-popup #yith-woocompare col.ap-yith-compare-column--product {
    width: var(--ap-compare-product-width);
  }

  .yith-woocompare-popup-container #yith-woocompare col.ap-yith-compare-column--filler,
  body.yith-woocompare-popup #yith-woocompare col.ap-yith-compare-column--filler {
    width: 0;
  }

  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollBody,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: visible !important;
    overscroll-behavior-x: contain;
    scrollbar-color: var(--ap-compare-accent) #eceff1;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollBody::-webkit-scrollbar,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollBody::-webkit-scrollbar {
    height: 6px;
  }

  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollBody::-webkit-scrollbar-thumb,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollBody::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--ap-compare-accent);
  }

  .yith-woocompare-popup-container #yith-woocompare .dataTables_scrollBody:focus-visible,
  body.yith-woocompare-popup #yith-woocompare .dataTables_scrollBody:focus-visible {
    outline: 3px solid rgba(234, 106, 31, 0.24);
    outline: 3px solid color-mix(in srgb, var(--ap-compare-accent) 24%, transparent);
    outline-offset: -3px;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list tbody th:not(.filler),
  body.yith-woocompare-popup #yith-woocompare table.compare-list tbody th:not(.filler) {
    position: sticky;
    left: 0;
    z-index: 3;
    box-sizing: border-box;
    width: var(--ap-compare-label-width) !important;
    min-width: var(--ap-compare-label-width) !important;
    max-width: var(--ap-compare-label-width) !important;
    padding: 12px 8px !important;
    overflow: hidden;
    background: var(--ap-compare-surface-muted);
    color: #34373b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-align: left;
    white-space: normal;
    box-shadow: 1px 0 0 var(--ap-compare-border);
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list thead th,
  body.yith-woocompare-popup #yith-woocompare table.compare-list thead th,
  .yith-woocompare-popup-container #yith-woocompare table.compare-list tfoot th,
  body.yith-woocompare-popup #yith-woocompare table.compare-list tfoot th {
    width: var(--ap-compare-label-width) !important;
    min-width: var(--ap-compare-label-width) !important;
    max-width: var(--ap-compare-label-width) !important;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list td:not(.filler),
  body.yith-woocompare-popup #yith-woocompare table.compare-list td:not(.filler) {
    box-sizing: border-box;
    width: var(--ap-compare-product-width) !important;
    min-width: var(--ap-compare-product-width) !important;
    max-width: var(--ap-compare-product-width) !important;
    padding: 12px 16px !important;
    color: #34373b;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list thead td:not(.filler),
  body.yith-woocompare-popup #yith-woocompare table.compare-list thead td:not(.filler),
  .yith-woocompare-popup-container #yith-woocompare table.compare-list tfoot td:not(.filler),
  body.yith-woocompare-popup #yith-woocompare table.compare-list tfoot td:not(.filler) {
    width: var(--ap-compare-product-width) !important;
    min-width: var(--ap-compare-product-width) !important;
    max-width: var(--ap-compare-product-width) !important;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list tr.product_info th > *,
  body.yith-woocompare-popup #yith-woocompare table.compare-list tr.product_info th > * {
    display: none;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list tr.product_info td,
  body.yith-woocompare-popup #yith-woocompare table.compare-list tr.product_info td {
    padding-top: 16px !important;
    vertical-align: top;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap img,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap img {
    width: 100%;
    height: 168px;
    object-fit: contain;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .product_title,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .product_title {
    margin: 12px 0 0;
    color: #202124;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
    text-align: left;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap .image-overlay,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap .image-overlay {
    display: block;
    background: transparent;
    pointer-events: none;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a {
    position: absolute;
    top: 6px;
    right: 6px;
    bottom: auto;
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ap-compare-border);
    border-radius: 50%;
    background: #fff;
    color: #202124;
    box-shadow: 0 3px 10px rgba(18, 24, 31, 0.12);
    font-size: 0;
    line-height: 1;
    pointer-events: auto;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::before,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::before,
  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::after,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    pointer-events: none;
    transform-origin: center;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::before,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::after,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a:focus-visible,
  body.yith-woocompare-popup #yith-woocompare table.compare-list .image-wrap .image-overlay .remove a:focus-visible {
    border-color: var(--ap-compare-accent);
    outline: 3px solid rgba(234, 106, 31, 0.24);
    outline: 3px solid color-mix(in srgb, var(--ap-compare-accent) 24%, transparent);
    outline-offset: 2px;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list tr.stock td,
  body.yith-woocompare-popup #yith-woocompare table.compare-list tr.stock td {
    min-height: 0;
    background: #fff;
  }

  .yith-woocompare-popup-container #yith-woocompare table.compare-list tr.stock td .availability-label,
  body.yith-woocompare-popup #yith-woocompare table.compare-list tr.stock td .availability-label {
    display: inline;
    width: auto !important;
    max-width: 100%;
  }
}

@keyframes ap-yith-compare-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ap-yith-compare-loading::before {
    animation: none;
  }
}
