.asw-collections {
    --asw-collections-accent: #315c49;
    --asw-collections-muted: #737b75;
    --asw-collections-divider: rgba(36, 49, 41, .12);
    --asw-collections-panel-width: 620px;
    position: relative;
    display: inline-flex;
    max-width: 100%;
    direction: inherit;
    color: #243129;
    font: inherit;
}

.asw-collections *,
.asw-collections *::before,
.asw-collections *::after,
.asw-collection-toggle,
.asw-collection-toggle * {
    box-sizing: border-box;
}

.asw-collections button,
.asw-collection-toggle {
    font: inherit;
}

.asw-collections__triggers {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.asw-collections__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 46px;
    min-height: 46px;
    padding: 8px 12px;
    border: 1px solid rgba(36, 49, 41, .14);
    border-radius: 14px;
    color: #243129;
    background: #fff;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.asw-collections__trigger:hover,
.asw-collections__trigger.is-active {
    color: #fff;
    background: #315c49;
}

.asw-collections__trigger:focus-visible,
.asw-collections__close:focus-visible,
.asw-collections__tab:focus-visible,
.asw-collections__remove:focus-visible,
.asw-collections__clear:focus-visible,
.asw-collection-toggle:focus-visible {
    outline: 2px solid var(--asw-collections-accent);
    outline-offset: 3px;
}

.asw-collections__trigger-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.asw-collections__trigger-icon svg,
.asw-collections__trigger-icon i {
    width: 100%;
    height: 100%;
    font-size: 20px;
}

.asw-collections__trigger-icon svg {
    fill: currentColor;
}

.asw-collections__trigger-label {
    white-space: nowrap;
}

.asw-collections--hide-trigger-labels .asw-collections__trigger-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.asw-collections__count {
    position: absolute;
    inset-block-start: -5px;
    inset-inline-end: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding-inline: 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #e44747;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.asw-collections__count[data-count="0"] {
    opacity: .7;
}

.asw-collections__surface {
    position: fixed;
    z-index: 100020;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 20px;
    border: 0;
    background: rgba(10, 16, 12, .48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}

.asw-collections--open .asw-collections__surface {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.asw-collections__surface[popover] {
    color: inherit;
}

.asw-collections__surface[popover]::backdrop {
    background: transparent;
}

.asw-collections__dialog {
    --asw-collections-panel-width: 620px;
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(var(--asw-collections-panel-width), calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: min(82vh, 780px);
    overflow: hidden;
    border: 1px solid var(--asw-collections-divider);
    border-radius: 22px;
    background: #fff;
    color: inherit;
    box-shadow: 0 30px 90px rgba(15, 25, 18, .22);
    transform: translateY(14px) scale(.985);
    opacity: 0;
    transition: transform .24s ease, opacity .24s ease;
}

.asw-collections--open .asw-collections__dialog {
    transform: none;
    opacity: 1;
}

.asw-collections__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--asw-collections-divider);
}

.asw-collections__title {
    margin: 0;
    color: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}

.asw-collections__close,
.asw-collections__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: var(--asw-collections-muted);
    background: rgba(36, 49, 41, .06);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}

.asw-collections__close:hover,
.asw-collections__remove:hover {
    color: #c33b3b;
    background: rgba(195, 59, 59, .09);
}

.asw-collections__close svg,
.asw-collections__remove svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.asw-collections__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 22px 0;
    border-bottom: 1px solid var(--asw-collections-divider);
}

.asw-collections__tab:only-child {
    grid-column: 1 / -1;
}

.asw-collections__tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 12px 12px;
    border: 0;
    color: var(--asw-collections-muted);
    background: transparent;
    cursor: pointer;
}

.asw-collections__tab::after {
    content: "";
    position: absolute;
    inset-inline: 10%;
    inset-block-end: -1px;
    height: 2px;
    border-radius: 999px 999px 0 0;
    background: var(--asw-collections-accent);
    transform: scaleX(0);
    transition: transform .2s ease;
}

.asw-collections__tab.is-active {
    color: var(--asw-collections-accent);
    font-weight: 700;
}

.asw-collections__tab.is-active::after {
    transform: scaleX(1);
}

.asw-collections__tab > span:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding-inline: 6px;
    border-radius: 999px;
    color: var(--asw-collections-accent);
    background: color-mix(in srgb, var(--asw-collections-accent) 10%, transparent);
    font-size: 11px;
    font-weight: 700;
}

.asw-collections__body {
    width: 100%;
    min-width: 0;
    min-height: 220px;
    overflow: auto;
    overscroll-behavior: contain;
}

.asw-collections__tabpanel {
    display: none;
}

.asw-collections__tabpanel.is-active {
    display: block;
}

.asw-collections__panel-content {
    width: 100%;
    min-width: 0;
    padding: 18px 22px 22px;
    overflow: hidden;
}

.asw-collections__list {
    display: grid;
    gap: 12px;
}

.asw-collections__item {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--asw-collections-divider);
    border-radius: 16px;
    background: color-mix(in srgb, currentColor 2.5%, transparent);
}

.asw-collections__item-image {
    display: block;
    width: 76px;
    height: 76px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(36, 49, 41, .05);
}

.asw-collections__item-image img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0;
    object-fit: cover;
}

.asw-collections__item-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 4px;
}

.asw-collections__item-title,
.asw-collections__compare-product {
    color: inherit;
    text-decoration: none;
}

.asw-collections__item-title {
    max-width: 100%;
    overflow: hidden;
    font-weight: 650;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asw-collections__item-title:hover,
.asw-collections__compare-product:hover strong {
    color: var(--asw-collections-accent);
}

.asw-collections__item-price {
    color: var(--asw-collections-accent);
    font-size: 13px;
    font-weight: 700;
}

.asw-collections__item-price del {
    color: var(--asw-collections-muted);
    font-weight: 400;
}

.asw-collections__item-link {
    color: var(--asw-collections-muted);
    font-size: 12px;
    text-decoration: none;
}

.asw-collections__item-link:hover {
    color: var(--asw-collections-accent);
}

.asw-collections__compare-scroll {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--asw-collections-divider);
    border-radius: 16px;
}

.asw-collections__compare-table {
    width: 100%;
    min-width: 560px;
    border: 0;
    border-collapse: collapse;
    table-layout: fixed;
    color: inherit;
    background: transparent;
}

.asw-collections__compare-table th,
.asw-collections__compare-table td {
    min-width: 150px;
    padding: 12px;
    border: 0;
    border-inline-start: 1px solid var(--asw-collections-divider);
    border-block-end: 1px solid var(--asw-collections-divider);
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.6;
}

.asw-collections__compare-table tr:last-child th,
.asw-collections__compare-table tr:last-child td {
    border-block-end: 0;
}

.asw-collections__compare-table .asw-collections__compare-label {
    position: sticky;
    inset-inline-start: 0;
    z-index: 2;
    min-width: 110px;
    width: 110px;
    color: var(--asw-collections-muted);
    background: #fafbfa;
    text-align: start;
    font-weight: 650;
}

.asw-collections__compare-head {
    position: relative;
}

.asw-collections__compare-head > .asw-collections__remove {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-end: -6px;
    z-index: 2;
    width: 28px;
    height: 28px;
}

.asw-collections__compare-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.asw-collections__compare-image {
    display: block;
    width: 84px;
    height: 84px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(36, 49, 41, .05);
}

.asw-collections__compare-image img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.asw-collections__compare-table .stock {
    margin: 0;
    font-size: inherit;
}

.asw-collections__clear {
    display: block;
    width: fit-content;
    margin: 16px auto 0;
    padding: 7px 10px;
    border: 0;
    color: var(--asw-collections-muted);
    background: transparent;
    font-size: 12px;
    cursor: pointer;
}

.asw-collections__clear:hover {
    color: #c33b3b;
}

.asw-collections__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 30px 20px;
    text-align: center;
}

.asw-collections__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin-bottom: 16px;
    border-radius: 22px;
    color: var(--asw-collections-accent);
    background: color-mix(in srgb, var(--asw-collections-accent) 9%, transparent);
}

.asw-collections__empty-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.asw-collections__empty strong {
    margin-bottom: 7px;
    font-size: 16px;
}

.asw-collections__empty > span:last-child {
    max-width: 390px;
    color: var(--asw-collections-muted);
    font-size: 13px;
    line-height: 1.8;
}

.asw-collections__message {
    display: none;
    padding: 10px 18px;
    border-top: 1px solid var(--asw-collections-divider);
    color: var(--asw-collections-accent);
    background: color-mix(in srgb, var(--asw-collections-accent) 6%, transparent);
    text-align: center;
    font-size: 12px;
}

.asw-collections__message:not(:empty) {
    display: block;
}

.asw-collections.is-loading .asw-collections__body {
    opacity: .55;
    pointer-events: none;
}

/*
 * Dropdown positioning is calculated by JavaScript against the viewport.
 * Fixed positioning prevents the panel width from inheriting the full page width
 * and avoids negative offsets when the widget is placed near either screen edge.
 */
.asw-collections[data-effective-mode="dropdown"] .asw-collections__surface {
    position: fixed;
    inset: auto;
    top: var(--asw-dropdown-top, 0px);
    left: var(--asw-dropdown-left, 12px);
    width: var(--asw-dropdown-width, min(var(--asw-collections-panel-width), calc(100vw - 24px)));
    max-width: calc(100vw - 24px);
    height: auto;
    padding: 0;
    background: transparent !important;
    align-items: flex-start;
    justify-content: flex-start;
}

.asw-collections[data-effective-mode="dropdown"] .asw-collections__dialog {
    width: 100%;
    max-width: 100%;
    max-height: min(var(--asw-dropdown-max-height, 72dvh), 680px);
    transform: translateY(-8px) scale(.99);
    transform-origin: top center;
}

.asw-collections[data-effective-mode="dropdown"].asw-collections--open .asw-collections__dialog {
    transform: none;
}

.asw-collections[data-effective-mode="drawer_end"] .asw-collections__surface,
.asw-collections[data-effective-mode="drawer_start"] .asw-collections__surface {
    padding: 0;
    align-items: stretch;
}

.asw-collections[data-effective-mode="drawer_end"] .asw-collections__surface {
    justify-content: flex-end;
}

.asw-collections[data-effective-mode="drawer_start"] .asw-collections__surface {
    justify-content: flex-start;
}

.asw-collections[data-effective-mode="drawer_end"] .asw-collections__dialog,
.asw-collections[data-effective-mode="drawer_start"] .asw-collections__dialog {
    width: min(var(--asw-collections-panel-width), 100%);
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    transform: translateX(100%);
}

[dir="rtl"] .asw-collections[data-effective-mode="drawer_end"] .asw-collections__dialog,
[dir="ltr"] .asw-collections[data-effective-mode="drawer_start"] .asw-collections__dialog {
    transform: translateX(-100%);
}

.asw-collections[data-effective-mode="drawer_end"].asw-collections--open .asw-collections__dialog,
.asw-collections[data-effective-mode="drawer_start"].asw-collections--open .asw-collections__dialog {
    transform: none;
}

.asw-collections[data-effective-mode="fullscreen"] .asw-collections__surface {
    padding: 0;
}

.asw-collections[data-effective-mode="fullscreen"] .asw-collections__dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
}

.asw-collections[data-effective-mode="drawer_bottom"] .asw-collections__surface {
    padding: 0;
    align-items: flex-end;
}

.asw-collections[data-effective-mode="drawer_bottom"] .asw-collections__dialog {
    width: 100%;
    max-width: none;
    max-height: min(84vh, 760px);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
}

.asw-collections[data-effective-mode="drawer_bottom"].asw-collections--open .asw-collections__dialog {
    transform: none;
}

html.asw-collections-page-locked,
html.asw-collections-page-locked body {
    overflow: hidden !important;
}

.asw-collection-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid rgba(36, 49, 41, .16);
    border-radius: 12px;
    color: #243129;
    background: #fff;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.asw-collection-toggle:hover,
.asw-collection-toggle.is-active {
    color: #fff;
    border-color: #315c49;
    background: #315c49;
}

.asw-collection-toggle__icon {
    display: inline-flex;
    width: 19px;
    height: 19px;
}

.asw-collection-toggle__icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.asw-collection-toggle.is-loading {
    opacity: .6;
    pointer-events: none;
}

@media (max-width: 767px) {
    .asw-collections__surface {
        padding: 10px;
    }

    .asw-collections__header {
        padding: 18px 18px 12px;
    }

    .asw-collections__tabs {
        padding-inline: 16px;
    }

    .asw-collections__panel-content {
        padding: 14px 14px 20px;
    }

    .asw-collections__item {
        grid-template-columns: 62px minmax(0, 1fr) 32px;
        gap: 10px;
        padding: 8px;
    }

    .asw-collections__item-image {
        width: 62px;
        height: 62px;
    }

    .asw-collections__item-title {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .asw-collections__surface,
    .asw-collections__dialog,
    .asw-collections__trigger,
    .asw-collections__tab::after,
    .asw-collection-toggle {
        transition: none !important;
    }
}
