/* ── Compare bar (fixed bottom) ── */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(8, 129, 120, 0.18);
    box-shadow: 0 -16px 42px rgba(15, 23, 42, 0.12);
    padding: 12px 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.compare-bar--visible {
    transform: translateY(0);
}

.compare-bar__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── Slots ── */
.compare-bar__slots {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.compare-bar__slot {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    border: 1px solid #dbe5e4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fbfb 0%, #eef8f7 100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.compare-bar__slot--filled {
    border-color: rgba(8, 129, 120, 0.35);
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.compare-bar__slot--filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
}

.compare-bar__slot--empty {
    color: #9ca3af;
    font-size: 18px;
}

.compare-bar__slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-bar__slot-placeholder {
    color: #c0cac9;
    font-size: 22px;
}

.compare-bar__slot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    border: none;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    padding: 0;
    line-height: 1;
}

.compare-bar__slot--filled:hover .compare-bar__slot-remove {
    opacity: 1;
}

.compare-bar__slot-remove:hover {
    transform: scale(1.05);
}

/* ── Meta & actions ── */
.compare-bar__meta {
    flex-shrink: 0;
}

.compare-bar__count {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}

.compare-bar__count strong {
    color: #0f766e;
    font-size: 16px;
}

.compare-bar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.compare-bar__btn-compare.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.compare-bar__btn-clear {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #dbe5e4;
    background: #fff;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.compare-bar__btn-clear:hover {
    color: #ef4444;
    border-color: #fecaca;
    transform: translateY(-1px);
}

/* ── Product card compare button active state ── */
.sw-act[data-act="compare"].is-active {
    color: #0f766e;
    background: rgba(15, 118, 110, 0.10);
}

/* ── Compare page ── */
.compare-page {
    color: #253d4e;
}

.compare-toolbar {
    padding-bottom: 12px;
}

.compare-toolbar h3 {
    color: #253d4e;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

.compare-table-responsive {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
}

.compare-table {
    margin-bottom: 0;
    min-width: 760px;
}

.compare-table tbody tr td {
    vertical-align: middle;
}

.compare-table tbody tr + tr td,
.compare-table tbody tr + tr th {
    border-top: 1px solid #ececec;
}

.compare-row-label {
    width: 180px;
    min-width: 180px;
    background: #f7f8f9;
    color: #253d4e;
    text-align: left;
    padding-left: 20px;
    white-space: nowrap;
}

.compare-product-cell {
    padding: 22px 16px;
    background: #fff;
}

.compare-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.compare-product-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ececec;
    background: #fff;
    color: #253d4e;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.compare-product-remove:hover {
    color: #3bb77e;
    border-color: #3bb77e;
}

.compare-product-img-wrap {
    width: 120px;
    height: 120px;
    border: 1px solid #ececec;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.compare-product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-product-img-placeholder {
    color: #b4b9c1;
    font-size: 34px;
}

.product_name h5 {
    margin-bottom: 0;
    font-size: 15px;
    font-weight: 600;
}

.product_name h5 a {
    color: #253d4e;
}

.product_name h5 a:hover {
    color: #3bb77e;
}

.compare-price,
.compare-price-sale {
    color: #3bb77e;
    font-weight: 700;
    font-size: 18px;
}

.compare-price-sale {
    display: block;
}

.compare-price-was {
    display: inline-flex;
    margin-top: 4px;
    font-size: 12px;
    color: #7e7e7e;
    text-decoration: line-through;
}

.compare-col-desc {
    color: #7e7e7e;
    font-size: 13px;
    line-height: 1.7;
    text-align: left;
}

.compare-empty {
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
}

.compare-empty__icon {
    font-size: 64px;
    color: #b4b9c1;
}

.compare-mobile-grid {
    display: none;
}

.compare-mobile-card {
    position: relative;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.compare-mobile-card + .compare-mobile-card {
    margin-top: 14px;
}

.compare-mobile-card__remove {
    top: 12px;
    right: 12px;
    z-index: 2;
}

.compare-mobile-card__top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.compare-mobile-card__image {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    border: 1px solid #ececec;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
}

.compare-mobile-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-mobile-card__head {
    min-width: 0;
    flex: 1;
    padding-right: 28px;
}

.compare-mobile-card__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 6px;
}

.compare-mobile-card__title {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
}

.compare-mobile-card__title a {
    color: #253d4e;
}

.compare-mobile-card__title a:hover {
    color: #3bb77e;
}

.compare-mobile-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.compare-mobile-card__price .compare-price,
.compare-mobile-card__price .compare-price-sale {
    font-size: 16px;
}

.compare-mobile-card__list {
    margin: 14px 0 16px;
    padding: 0;
}

.compare-mobile-card__item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
}

.compare-mobile-card__item:first-child {
    border-top: 0;
    padding-top: 0;
}

.compare-mobile-card__item dt {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.compare-mobile-card__item dd {
    margin: 0;
    color: #253d4e;
    font-size: 13px;
    line-height: 1.6;
}

.compare-mobile-card__item--desc dd {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compare-row-label,
.compare-product-cell {
    border-color: #ececec !important;
}

.compare-row.pr_add_to_cart .compare-product-cell {
    padding-bottom: 26px;
}

@media (max-width: 575px) {
    .compare-toolbar {
        align-items: stretch !important;
    }

    .compare-toolbar__meta {
        width: 100%;
    }

    .compare-toolbar h3 {
        font-size: 22px;
    }

    .compare-toolbar .btn {
        width: 100%;
    }

    .compare-row-label {
        width: 130px;
        min-width: 130px;
        padding-left: 14px;
        font-size: 12px;
    }

    .compare-product-cell {
        padding: 16px 10px;
    }

    .compare-product-img-wrap {
        width: 88px;
        height: 88px;
    }

    .product_name h5 {
        font-size: 13px;
    }

    .compare-table {
        min-width: 680px;
    }
}

@media (max-width: 767.98px) {
    .compare-bar {
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    }

    .compare-bar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .compare-bar__slots {
        justify-content: center;
        gap: 8px;
        width: 100%;
    }

    .compare-bar__slot {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .compare-bar__slot-placeholder {
        font-size: 18px;
    }

    .compare-bar__slot-remove {
        top: 3px;
        right: 3px;
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    .compare-bar__meta {
        width: 100%;
        text-align: center;
    }

    .compare-bar__count {
        display: block;
        font-size: 12px;
        white-space: normal;
    }

    .compare-bar__count strong {
        font-size: 14px;
    }

    .compare-bar__actions {
        width: 100%;
    }

    .compare-bar__btn-compare {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 40px;
    }

    .compare-bar__btn-clear {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 991.98px) {
    .compare-mobile-grid {
        display: block;
    }

    .compare-table-responsive {
        display: none !important;
    }

    .compare-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .compare-toolbar__meta p {
        font-size: 13px;
    }
}
