:root {
    --ns-compare-bg: #f4f5f6;
    --ns-compare-surface: #ffffff;
    --ns-compare-dark: #101820;
    --ns-compare-text: #263241;
    --ns-compare-muted: #6b7280;
    --ns-compare-line: rgba(16, 24, 32, .09);
    --ns-compare-accent: #00a046;
    --ns-compare-accent-2: #21c063;
    --ns-compare-danger: #dc2626;
    --ns-compare-radius: 22px;
    --ns-compare-shadow: 0 14px 40px rgba(16, 24, 32, .08);
    --ns-compare-shadow-hover: 0 20px 54px rgba(16, 24, 32, .13);
}

.ns-compare-page {
    --ns-compare-card-width: 276px;
    --ns-compare-attribute-width: 232px;
    --ns-compare-card-height: 0px;
    background: var(--ns-compare-bg);
    color: var(--ns-compare-text);
    padding: 28px 0 78px;
}

.ns-compare-page *,
.ns-compare-page *::before,
.ns-compare-page *::after {
    box-sizing: border-box;
}

.ns-compare-container {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.ns-compare-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.ns-compare-hero__content,
.ns-compare-summary,
.ns-compare-empty,
.ns-compare-actions,
.ns-compare-scroll {
    border: 1px solid var(--ns-compare-line);
    border-radius: var(--ns-compare-radius);
    background: var(--ns-compare-surface);
    box-shadow: var(--ns-compare-shadow);
}

.ns-compare-hero__content {
    padding: clamp(24px, 4vw, 42px);
    background: radial-gradient(circle at 0 0, rgba(0, 160, 70, .14), transparent 34%), #fff;
}

.ns-compare-eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--ns-compare-accent);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.ns-compare-hero h1 {
    margin: 0 0 12px;
    color: var(--ns-compare-dark);
    font-size: clamp(34px, 5vw, 68px);
    line-height: .96;
    letter-spacing: -.06em;
}

.ns-compare-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--ns-compare-muted);
    line-height: 1.75;
}

.ns-compare-summary {
    display: grid;
    place-items: center;
    align-content: center;
    padding: 24px;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(0,160,70,.30), transparent 44%), linear-gradient(145deg, #101820, #1f2933);
    color: #fff;
}

.ns-compare-summary strong {
    font-size: 58px;
    line-height: 1;
    letter-spacing: -.06em;
}

.ns-compare-summary span {
    color: rgba(255,255,255,.72);
    font-weight: 800;
}

.ns-compare-empty {
    padding: clamp(26px, 5vw, 54px);
    text-align: center;
}

.ns-compare-empty h2 {
    margin: 0 0 10px;
    color: var(--ns-compare-dark);
    font-size: clamp(26px, 4vw, 44px);
    letter-spacing: -.04em;
}

.ns-compare-empty p {
    max-width: 560px;
    margin: 0 auto 22px;
    color: var(--ns-compare-muted);
    line-height: 1.7;
}

.ns-compare-empty a,
.ns-compare-page .ns-product-more {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ns-compare-accent), var(--ns-compare-accent-2));
    color: #fff;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.ns-compare-actions {
    position: sticky;
    top: 86px;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(16px);
}

.ns-compare-tabs {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: thin;
}

.ns-compare-tab {
    flex: 0 0 auto;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    background: #f7f8f9;
    color: #4b5563;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .22s ease, background .22s ease, color .22s ease;
}

.ns-compare-tab span {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--ns-compare-dark);
    font-size: 12px;
}

.ns-compare-tab:hover,
.ns-compare-tab.is-active,
.ns-compare-tab.active {
    transform: translateY(-1px);
    background: rgba(0,160,70,.12);
    color: #008a3d;
}

.ns-compare-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ns-compare-tools button {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--ns-compare-line);
    border-radius: 14px;
    background: #fff;
    color: var(--ns-compare-dark);
    font-weight: 900;
    cursor: pointer;
    transition: transform .22s ease, border-color .22s ease, background .22s ease, color .22s ease;
}

.ns-compare-tools button:hover,
.ns-compare-tools button.active,
.ns-compare-tools button.is-active {
    transform: translateY(-1px);
    border-color: rgba(0,160,70,.25);
    background: var(--ns-compare-dark);
    color: #fff;
}

.ns-compare-tools .remove_all_compare {
    color: var(--ns-compare-danger);
}

.ns-compare-tools .remove_all_compare:hover {
    background: #fff0f0;
    border-color: rgba(220,38,38,.18);
    color: var(--ns-compare-danger);
}

.ns-compare-scroll-note {
    display: inline-flex;
    margin: 0 0 10px;
    color: var(--ns-compare-muted);
    font-size: 13px;
    font-weight: 850;
}

.ns-compare-scroll {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    cursor: grab;
}

.ns-compare-scroll.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.ns-compare-grid {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-width: max-content;
}

.ns-compare-product {
    flex: 0 0 var(--ns-compare-card-width);
    width: var(--ns-compare-card-width);
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
}

.ns-compare-product[hidden] {
    display: none !important;
}

.ns-compare-product__sticky {
    position: sticky;
    top: 154px;
    z-index: 12;
    margin-bottom: 12px;
}

.ns-compare-card.ns-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 398px;
    overflow: hidden;
    border: 1px solid var(--ns-compare-line);
    border-radius: var(--ns-compare-radius);
    background: #fff;
    box-shadow: 0 10px 28px rgba(16, 24, 32, .07);
    transition: transform .22s ease, box-shadow .22s ease;
}

.ns-compare-card.ns-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ns-compare-shadow-hover);
}

.ns-compare-page .ns-product-card__top {
    position: absolute;
    z-index: 4;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.ns-compare-page .ns-product-badges,
.ns-compare-page .ns-product-actions {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    pointer-events: auto;
}

.ns-compare-page .ns-product-badge {
    display: inline-flex;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(16,24,32,.10);
}

.ns-compare-page .ns-product-badge--new {
    background: var(--ns-compare-accent);
    color: #fff;
}

.ns-compare-page .ns-product-badge--sale {
    background: #ffcc00;
    color: #101820;
}

.ns-compare-page .ns-product-image {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / .72;
    min-height: 188px;
    padding: 26px 18px 12px;
    background: #fff;
    border-bottom: 1px solid rgba(16,24,32,.06);
    text-decoration: none;
}

.ns-compare-page .ns-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .28s ease;
}

.ns-compare-page .ns-product-image:hover img {
    transform: scale(1.03);
}

.ns-compare-page .ns-product-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 12px 14px 14px;
}

.ns-compare-page .ns-product-category {
    min-height: 15px;
    margin-bottom: 6px;
    color: var(--ns-compare-muted);
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ns-compare-page .ns-product-category a {
    color: inherit;
    text-decoration: none;
}

.ns-compare-page .ns-product-title {
    display: -webkit-box;
    min-height: 44px;
    max-height: 44px;
    margin: 0 0 8px;
    overflow: hidden;
    color: var(--ns-compare-dark);
    font-size: 17px;
    line-height: 1.29;
    letter-spacing: -.025em;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ns-compare-page .ns-product-title a {
    color: inherit;
    text-decoration: none;
}

.ns-compare-page .ns-product-meta {
    margin-top: auto;
    margin-bottom: 10px;
}

.ns-compare-page .ns-stock {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.ns-compare-page .ns-stock--in {
    background: #e9f8ef;
    color: #008a3d;
}

.ns-compare-page .ns-stock--out {
    background: #fff0f0;
    color: var(--ns-compare-danger);
}

.ns-compare-page .ns-product-footer {
    display: grid;
    gap: 10px;
    width: 100%;
}

.ns-compare-page .ns-product-price {
    min-height: 28px;
    overflow: hidden;
    color: var(--ns-compare-dark);
    font-size: 21px;
    font-weight: 950;
    letter-spacing: -.035em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.ns-compare-page .ns-product-price del {
    display: block;
    color: var(--ns-compare-muted);
    font-size: 13px;
    font-weight: 700;
}

.ns-compare-page .ns-product-price ins {
    text-decoration: none;
}

.ns-compare-page .ns-product-buttons {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 8px;
}

.ns-compare-page .ns-product-more {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 13px;
    font-size: 14px;
}

.ns-compare-specs {
    display: none;
    overflow: hidden;
    border: 1px solid var(--ns-compare-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16,24,32,.045);
}

.ns-compare-page.is-category-products .ns-compare-specs {
    display: grid;
}

.ns-compare-spec {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 10px 13px;
    border-bottom: 1px solid rgba(16,24,32,.06);
    background: #fff;
}

.ns-compare-spec:nth-child(even) {
    background: #f8fafb;
}

.ns-compare-spec:last-child {
    border-bottom: 0;
}

.ns-compare-spec .name {
    display: none !important;
}

.ns-compare-spec .value {
    display: block;
    width: 100%;
    color: var(--ns-compare-dark);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ns-compare-spec.is-empty .value {
    color: #9ca3af;
}

.ns-compare-spec.is-same-hidden {
    display: none !important;
}

.product_attribute.ns-compare-attribute-head {
    display: none;
    position: sticky;
    left: 0;
    z-index: 20;
    flex: 0 0 var(--ns-compare-attribute-width);
    width: var(--ns-compare-attribute-width);
    min-width: var(--ns-compare-attribute-width);
    pointer-events: none;
}

.ns-compare-page.is-category-products .product_attribute.ns-compare-attribute-head {
    display: block;
}

.ns-compare-attribute-spacer {
    height: calc(var(--ns-compare-card-height) + 12px);
    min-height: 0;
}

.attribute-container {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background: radial-gradient(circle at top right, rgba(0,160,70,.22), transparent 38%), linear-gradient(145deg, #101820, #1f2933);
    color: #fff;
    box-shadow: 0 12px 34px rgba(16,24,32,.15);
}

.attribute-item {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    color: rgba(255,255,255,.82);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.28;
}

.attribute-item:last-child {
    border-bottom: 0;
}

.attribute-item.is-same-hidden {
    display: none !important;
}

.ns-compare-toggle,
.ns-product-action-btn.compare,
.ns-product-action-btn.ns-compare-toggle,
.ns-compare-remove {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border: 1px solid rgba(16, 24, 32, .10);
    border-radius: 14px;
    background: rgba(255, 255, 255, .94);
    color: #101820;
    box-shadow: 0 10px 28px rgba(16, 24, 32, .08);
    backdrop-filter: blur(14px);
    cursor: pointer;
    text-decoration: none;
    transition: transform .22s ease, border-color .22s ease, background .22s ease, color .22s ease, box-shadow .22s ease;
}

.ns-compare-toggle svg,
.ns-product-action-btn.compare svg,
.ns-product-action-btn.ns-compare-toggle svg,
.ns-compare-remove svg {
    display: block;
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
}

.ns-compare-toggle svg path,
.ns-product-action-btn.compare svg path,
.ns-product-action-btn.ns-compare-toggle svg path,
.ns-compare-remove svg path,
.ns-header-action svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ns-compare-toggle span,
.ns-product-action-btn.compare span,
.ns-product-action-btn.ns-compare-toggle span,
.ns-compare-remove span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

.ns-compare-toggle:hover,
.ns-product-action-btn.compare:hover,
.ns-product-action-btn.ns-compare-toggle:hover,
.ns-compare-remove:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 160, 70, .28);
    background: #fff;
    color: #008a3d;
    box-shadow: 0 16px 38px rgba(0, 160, 70, .14);
}

.ns-compare-toggle.in-compare,
.ns-compare-toggle.is-active,
.ns-product-action-btn.compare.in-compare,
.ns-product-action-btn.compare.is-active,
.ns-product-action-btn.ns-compare-toggle.in-compare,
.ns-product-action-btn.ns-compare-toggle.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #00a046, #21c063);
    color: #fff;
    box-shadow: 0 16px 38px rgba(0, 160, 70, .22);
}

.ns-compare-remove,
.ns-compare-remove.in-compare,
.ns-compare-remove.is-active {
    background: rgba(255,255,255,.94);
    color: #101820;
}

.ns-compare-remove:hover {
    border-color: rgba(220,38,38,.18);
    background: #fff0f0;
    color: var(--ns-compare-danger);
    box-shadow: 0 16px 38px rgba(220, 38, 38, .12);
}

.ns-compare-toggle.is-loading {
    pointer-events: none;
    opacity: .65;
}

.ns-compare-count,
.ns-header-action .compare-counter,
.ns-header-action .ns-compare-count {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffcc00;
    color: #101820;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.ns-product-action-btn .ns-compare-count,
.ns-compare-toggle .ns-compare-count {
    position: absolute;
    top: -8px;
    right: -8px;
}

.ns-compare-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    max-width: min(360px, calc(100% - 36px));
    padding: 14px 16px;
    border-radius: 16px;
    background: #101820;
    color: #fff;
    font-weight: 850;
    box-shadow: 0 18px 54px rgba(0,0,0,.24);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .24s ease, transform .24s ease;
}

.ns-compare-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1080px) {
    .ns-compare-actions {
        top: 70px;
        grid-template-columns: 1fr;
    }

    .ns-compare-tools {
        justify-content: flex-start;
    }

    .ns-compare-product__sticky {
        top: 132px;
    }
}

@media (max-width: 980px) {
    .ns-compare-hero {
        grid-template-columns: 1fr;
    }

    .ns-compare-summary {
        min-height: 150px;
    }

    .ns-compare-actions {
        position: relative;
        top: auto;
    }

    .ns-compare-product__sticky {
        position: relative;
        top: auto;
    }
}

@media (max-width: 760px) {
    .ns-compare-page {
        --ns-compare-card-width: 252px;
        --ns-compare-attribute-width: 180px;
    }

    .ns-compare-scroll {
        gap: 12px;
        padding: 12px;
    }

    .ns-compare-grid {
        gap: 12px;
    }

    .ns-compare-card.ns-product-card {
        min-height: 366px;
        border-radius: 18px;
    }

    .ns-compare-page .ns-product-image {
        min-height: 164px;
        padding: 24px 14px 10px;
    }

    .ns-compare-page .ns-product-content {
        padding: 11px 12px 12px;
    }

    .ns-compare-page .ns-product-title {
        font-size: 16px;
        min-height: 42px;
        max-height: 42px;
    }
}

@media (max-width: 640px) {
    .ns-compare-page {
        --ns-compare-card-width: 244px;
        --ns-compare-attribute-width: 164px;
        padding-top: 16px;
    }

    .ns-compare-container {
        width: min(100% - 22px, 1240px);
    }

    .ns-compare-hero__content,
    .ns-compare-empty,
    .ns-compare-actions,
    .ns-compare-scroll {
        border-radius: 18px;
    }

    .ns-compare-hero__content,
    .ns-compare-empty {
        padding: 22px;
    }

    .ns-compare-hero h1 {
        font-size: 34px;
    }

    .ns-compare-tools {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ns-compare-tools button {
        width: 100%;
    }

    .ns-compare-scroll {
        margin-left: -4px;
        margin-right: -4px;
    }

    .ns-compare-tab {
        min-height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }

    .attribute-item,
    .ns-compare-spec {
        min-height: 54px;
        padding: 9px 11px;
        font-size: 12px;
    }

    .ns-compare-spec .value {
        font-size: 12px;
    }

    .ns-compare-toggle,
    .ns-product-action-btn.compare,
    .ns-product-action-btn.ns-compare-toggle,
    .ns-compare-remove {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 13px;
    }
}
