/* FAVORITES-COMPARE-1D: favorites and compare pages */
.sc-product-collection-page {
    background: #f5f7fa;
}

.sc-product-collection-page .sc-page-hero {
    padding: 34px 0 18px;
}

.sc-product-collection-page .sc-page-hero .sc-container {
    background: #ffffff;
    border: 1px solid #e3e8ef;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .07);
    padding: 28px;
}

.sc-product-collection-page h1 {
    margin: 0 0 10px;
    color: #101827;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
}

.sc-product-collection-page .sc-page-hero p {
    max-width: 720px;
    margin: 0 0 18px;
    color: #64748b;
}

.sc-product-collection-page button,
.sc-product-collection-page a {
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.sc-product-collection-page button {
    cursor: pointer;
}

[data-product-collection-counter] {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-right: 10px;
    padding: 7px 12px;
    border: 1px solid #e3e8ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
}

[data-product-collection-clear] {
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid #e3e8ef;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    font-weight: 700;
    font-size: 13px;
}

[data-product-collection-clear]:hover {
    border-color: #f97316;
    color: #ea580c;
}

[data-product-collection-empty],
.sc-collection-error {
    margin-top: 18px;
    padding: 28px;
    border: 1px solid #e3e8ef;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
}

[data-product-collection-empty] h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 24px;
}

[data-product-collection-empty] p {
    max-width: 560px;
    margin: 0 0 18px;
    color: #64748b;
}

[data-product-collection-empty] a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #f97316;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.sc-collection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.sc-collection-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #e3e8ef;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.sc-collection-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 142px;
    border-radius: 18px;
    background: #f8fafc;
    overflow: hidden;
    color: #94a3b8;
    font-weight: 900;
    text-decoration: none;
}

.sc-collection-card__image img {
    width: 100%;
    height: 142px;
    object-fit: contain;
}

.sc-collection-card__type {
    margin: 0 0 6px;
    color: #f97316;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sc-collection-card h2 {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.24;
}

.sc-collection-card h2 a {
    color: #111827;
    text-decoration: none;
}

.sc-collection-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 12px;
}

.sc-collection-card__meta span {
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f5f9;
}

.sc-collection-card__price {
    margin-bottom: 12px;
    color: #111827;
    font-size: 18px;
    font-weight: 900;
}

.sc-collection-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sc-collection-card__actions button,
.sc-collection-card__actions a {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.sc-collection-card__actions button:hover,
.sc-collection-card__actions a:hover,
.sc-collection-card__actions button.is-active {
    border-color: #f97316;
    color: #ea580c;
}

.sc-compare-scroll {
    width: 100%;
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid #e3e8ef;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
}

.sc-compare-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.sc-compare-table th,
.sc-compare-table td {
    width: 220px;
    padding: 14px;
    border-bottom: 1px solid #e3e8ef;
    border-right: 1px solid #e3e8ef;
    vertical-align: top;
    text-align: left;
}

.sc-compare-table th:first-child,
.sc-compare-table td:first-child {
    width: 180px;
    background: #f8fafc;
    color: #334155;
    font-weight: 900;
}

.sc-compare-table th:last-child,
.sc-compare-table td:last-child {
    border-right: 0;
}

.sc-compare-table tr[data-different="true"] td {
    background: #fff7ed;
}

.sc-compare-table__image {
    display: block;
    width: 100%;
    height: 116px;
    margin-bottom: 10px;
    object-fit: contain;
    border-radius: 14px;
    background: #f8fafc;
}

.sc-compare-table__type {
    display: block;
    margin-bottom: 5px;
    color: #f97316;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.sc-compare-table__title {
    display: block;
    margin-bottom: 8px;
    color: #111827;
    font-weight: 900;
    text-decoration: none;
}

.sc-compare-table th button {
    margin-top: 10px;
    padding: 7px 10px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    font-weight: 800;
}

[data-product-compare-notice] {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #fed7aa;
    border-radius: 16px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
}

.sc-product-collection-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    max-width: 320px;
    padding: 13px 15px;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
    font-size: 14px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.sc-product-collection-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1180px) {
    .sc-collection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sc-product-collection-page .sc-page-hero {
        padding-top: 18px;
    }

    .sc-product-collection-page .sc-page-hero .sc-container {
        padding: 20px;
        border-radius: 20px;
    }

    .sc-collection-grid {
        grid-template-columns: 1fr;
    }

    .sc-collection-card {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
        border-radius: 18px;
    }

    .sc-collection-card__image {
        min-height: 112px;
    }

    .sc-collection-card__image img {
        height: 112px;
    }

    .sc-collection-card h2 {
        font-size: 15px;
    }

    .sc-collection-card__actions button,
    .sc-collection-card__actions a {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .sc-compare-scroll {
        margin-inline: -12px;
        width: calc(100% + 24px);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .sc-product-collection-toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
    }
}

/* FAVORITES-COMPARE-WIDTH-FIX: align collection pages with storefront header width */
.sc-product-collection-page {
    --sc-collection-container-width: 1560px;
}

.sc-product-collection-page > .sc-page-hero,
.sc-product-collection-page > .sc-section {
    padding-left: 16px;
    padding-right: 16px;
}

.sc-product-collection-page > .sc-page-hero > .sc-container,
.sc-product-collection-page > .sc-section > .sc-container {
    width: 100%;
    max-width: var(--sc-collection-container-width);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 760px) {
    .sc-product-collection-page > .sc-page-hero,
    .sc-product-collection-page > .sc-section {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* FAVORITES-COMPARE-2A: compare product actions and attributes readability */
.sc-compare-table__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.sc-compare-table__actions button,
.sc-compare-table__actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 10px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.sc-compare-table__actions button:hover,
.sc-compare-table__actions a:hover {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
}

.sc-compare-table tr[data-different="true"] td:first-child::after {
    content: "отличается";
    display: inline-flex;
    margin-left: 8px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}

@media (max-width: 760px) {
    .sc-compare-table__actions {
        flex-direction: column;
    }
}

/* FAVORITES-COMPARE-2C: compare table readability polish */
.sc-compare-scroll {
    position: relative;
    max-width: 100%;
    border-radius: 24px;
    background:
        linear-gradient(90deg, rgba(248,250,252,1), rgba(248,250,252,0)) left top / 28px 100% no-repeat,
        #ffffff;
}

.sc-compare-table {
    table-layout: fixed;
}

.sc-compare-table th,
.sc-compare-table td {
    width: 260px;
}

.sc-compare-table th:first-child,
.sc-compare-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    width: 245px;
    min-width: 245px;
    max-width: 245px;
    box-shadow: 10px 0 22px rgba(15, 23, 42, .045);
}

.sc-compare-table th:first-child {
    z-index: 6;
    background: #f8fafc;
    color: #0f172a;
    font-size: 15px;
}

.sc-compare-table th:not(:first-child) {
    background: #ffffff;
}

.sc-compare-table tr[data-different="true"] td:first-child {
    background: #fff7ed;
}

.sc-compare-table tr[data-different="true"] td:not(:first-child) {
    background: #fffaf5;
}

.sc-compare-table tr:not([data-different="true"]) td:not(:first-child) {
    background: #ffffff;
}

.sc-compare-table tr[data-different="true"] td:first-child::after {
    content: "разница";
    margin-left: 0;
    margin-top: 6px;
    width: fit-content;
    display: flex;
    padding: 3px 7px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sc-compare-table__image {
    height: 96px;
    padding: 10px;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    background: #f8fafc;
}

.sc-compare-table__type {
    min-height: 24px;
    color: #f97316;
    font-size: 10px;
    line-height: 1.2;
}

.sc-compare-table__title {
    min-height: 38px;
    font-size: 14px;
    line-height: 1.25;
}

.sc-compare-table th strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.2;
}

.sc-compare-table__actions {
    gap: 6px;
}

.sc-compare-table__actions button,
.sc-compare-table__actions a {
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 9px;
    font-size: 11px;
}

.sc-compare-table__actions button[data-cart-add] {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.sc-compare-table td {
    color: #1f2937;
    font-size: 14px;
    line-height: 1.35;
}

.sc-compare-table td:first-child {
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 760px) {
    .sc-compare-table {
        min-width: 980px;
    }

    .sc-compare-table th,
    .sc-compare-table td {
        width: 230px;
    }

    .sc-compare-table th:first-child,
    .sc-compare-table td:first-child {
        width: 185px;
        min-width: 185px;
        max-width: 185px;
    }

    .sc-compare-table__image {
        height: 82px;
    }

    .sc-compare-table__title {
        font-size: 13px;
    }
}

/* FAVORITES-COMPARE-2D: restore readable first column labels */
.sc-compare-table th:first-child,
.sc-compare-table td:first-child {
    position: static;
    left: auto;
    z-index: auto;
    width: 245px;
    min-width: 245px;
    max-width: 245px;
    box-shadow: none;
    color: #0f172a;
    font-weight: 900;
    visibility: visible;
    opacity: 1;
}

.sc-compare-table td:first-child {
    background: #f8fafc;
    font-size: 13px;
    line-height: 1.3;
}

.sc-compare-table tr[data-different="true"] td:first-child {
    background: #fff7ed;
    color: #0f172a;
}

.sc-compare-table tr[data-different="true"] td:first-child::after {
    content: "разница";
    display: inline-flex;
    vertical-align: middle;
    margin-left: 8px;
    margin-top: 0;
    padding: 3px 7px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

@media (max-width: 760px) {
    .sc-compare-table th:first-child,
    .sc-compare-table td:first-child {
        position: static;
        width: 185px;
        min-width: 185px;
        max-width: 185px;
    }
}

/* FAVORITES-COMPARE-2E: mobile compare table polish */
@media (max-width: 760px) {
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-page-hero .sc-container {
        padding: 18px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] h1 {
        font-size: 28px;
        line-height: 1.08;
        max-width: 260px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-page-hero p {
        font-size: 13px;
        line-height: 1.45;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] [data-product-collection-counter],
    .sc-product-collection-page[data-product-collection-page="compare"] [data-product-collection-clear] {
        min-height: 30px;
        padding: 6px 10px;
        font-size: 11px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] label {
        display: flex;
        align-items: center;
        gap: 5px;
        margin-top: 8px;
        font-size: 12px;
        line-height: 1.25;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-section {
        padding-left: 0;
        padding-right: 0;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-section > .sc-container {
        padding-left: 0;
        padding-right: 0;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-scroll {
        margin: 12px 0 0;
        width: 100%;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        box-shadow: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-scroll::before {
        content: "Листайте таблицу в сторону";
        position: sticky;
        left: 8px;
        top: 0;
        z-index: 7;
        display: inline-flex;
        margin: 8px;
        padding: 5px 8px;
        border: 1px solid #fed7aa;
        border-radius: 999px;
        background: #fff7ed;
        color: #c2410c;
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table {
        min-width: 690px;
        table-layout: fixed;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table th,
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table td {
        width: 175px;
        padding: 9px 8px;
        font-size: 11px;
        line-height: 1.28;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table th:first-child,
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table td:first-child {
        width: 126px;
        min-width: 126px;
        max-width: 126px;
        padding-left: 8px;
        padding-right: 7px;
        font-size: 10.5px;
        line-height: 1.18;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table__image {
        height: 68px;
        margin-bottom: 7px;
        padding: 6px;
        border-radius: 12px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table__type {
        min-height: 18px;
        margin-bottom: 4px;
        font-size: 8.5px;
        line-height: 1.1;
        letter-spacing: .02em;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table__title {
        min-height: 30px;
        margin-bottom: 6px;
        font-size: 11px;
        line-height: 1.18;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table th strong {
        margin-top: 4px;
        font-size: 13px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table__actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 5px;
        margin-top: 8px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table__actions button,
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table__actions a {
        min-height: 28px;
        padding: 5px 7px;
        border-radius: 8px;
        font-size: 10px;
        line-height: 1.1;
        white-space: nowrap;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table tr[data-different="true"] td:first-child::after {
        display: flex;
        width: fit-content;
        margin: 5px 0 0;
        padding: 2px 5px;
        font-size: 8px;
        line-height: 1;
    }
}

@media (max-width: 390px) {
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table {
        min-width: 650px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table th,
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table td {
        width: 166px;
    }

    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table th:first-child,
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-table td:first-child {
        width: 112px;
        min-width: 112px;
        max-width: 112px;
        font-size: 10px;
    }
}

/* FAVORITES-COMPARE-2F: remove mobile compare scroll hint */
@media (max-width: 760px) {
    .sc-product-collection-page[data-product-collection-page="compare"] .sc-compare-scroll::before {
        content: none;
        display: none;
    }
}
