.tne-cps,
.tne-cps * {
    box-sizing: border-box;
}

.tne-cps {
    --tne-cps-cat-cols: 6;
    --tne-cps-cat-gap: 14px;
    --tne-cps-cat-custom-width: 180px;
    --tne-cps-cat-icon-gap: 10px;
    --tne-cps-cat-icon-size: 24px;
    --tne-cps-product-cols: 5;
    --tne-cps-product-gap: 16px;
    --tne-cps-image-hover-scale: 1.06;
    --tne-cps-image-hover-blur: 0px;
    direction: rtl;
    width: 100%;
}

.tne-cps-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: var(--tne-cps-cat-gap);
    margin-bottom: 18px;
}

.tne-cps-cat-button {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--tne-cps-cat-icon-gap);
    min-height: 48px;
    padding: 10px 18px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 12px;
    background: #f7f2ef;
    color: #333;
    text-decoration: none;
    line-height: 1.5;
    transition: color .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
    cursor: pointer;
    user-select: none;
}

.tne-cat-width-equal .tne-cps-cat-button {
    flex: 0 1 calc((100% - (var(--tne-cps-cat-gap) * (var(--tne-cps-cat-cols) - 1))) / var(--tne-cps-cat-cols));
}

.tne-cat-width-auto .tne-cps-cat-button {
    flex: 0 0 auto;
}

.tne-cat-width-custom .tne-cps-cat-button {
    flex: 0 0 var(--tne-cps-cat-custom-width);
}

.tne-cps-cat-button:hover,
.tne-cps-cat-button:focus {
    color: #fff;
    background: #8f7ab9;
    border-color: #8f7ab9;
    transform: translateY(-1px);
    text-decoration: none;
    outline: none;
}

.tne-cps-cat-button.is-active {
    color: #fff;
    background: #8871b2;
    border-color: #8871b2;
}

.tne-cps-cat-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tne-cps-cat-icon,
.tne-cps-all-icon {
    width: var(--tne-cps-cat-icon-size);
    height: var(--tne-cps-cat-icon-size);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tne-cps-cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tne-cps-all-icon svg,
.tne-cps-all-icon i {
    width: var(--tne-cps-cat-icon-size);
    height: var(--tne-cps-cat-icon-size);
    font-size: var(--tne-cps-cat-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    fill: currentColor;
}

.tne-icon-position-before .tne-cps-cat-button {
    flex-direction: row;
}

.tne-icon-position-after .tne-cps-cat-button {
    flex-direction: row-reverse;
}

.tne-cps-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    color: #333;
}

.tne-cps-field,
.tne-cps-stock-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    white-space: nowrap;
}

.tne-cps-toolbar select {
    min-width: 105px;
    height: 38px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    background: #fff;
    color: #222;
    padding: 4px 10px;
    outline: none;
}

.tne-cps-stock-field input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    border-radius: 4px;
    accent-color: #8871b2;
}

.tne-cps-products-shell {
    position: relative;
    min-height: 80px;
}

.tne-cps-products-shell.is-loading {
    pointer-events: none;
}

.tne-cps-products-shell.is-loading:before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(2px);
    border-radius: 16px;
}

.tne-cps-products-shell.is-loading:after {
    content: "";
    position: absolute;
    z-index: 5;
    top: 42px;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, .12);
    border-top-color: #8871b2;
    animation: tne-cps-spin .8s linear infinite;
}

@keyframes tne-cps-spin {
    to { transform: rotate(360deg); }
}

.tne-cps-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--tne-cps-product-cols), minmax(0, 1fr));
    gap: var(--tne-cps-product-gap, 16px);
}

.tne-cps-product-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .04);
    transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.tne-cps-product-card:hover {
    transform: translateY(-3px);
}

.tne-cps-product-image-wrap {
    position: relative;
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #fafafa;
    text-decoration: none;
}

.tne-cps-product-image-wrap:after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    pointer-events: none;
    transition: background-color .25s ease;
}

.tne-cps-product-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}

.tne-cps-product-card:hover .tne-cps-product-image-wrap img {
    transform: scale(var(--tne-cps-image-hover-scale));
    filter: blur(var(--tne-cps-image-hover-blur));
}

.tne-cps-sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #d83434;
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
}

.tne-cps-product-content {
    padding: 12px;
    text-align: center;
}

.tne-cps-wishlist {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}

.tne-cps-product-title {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.7;
    font-weight: 500;
}

.tne-cps-product-title a {
    color: #333;
    text-decoration: none;
    transition: color .2s ease;
}

.tne-cps-product-title a:hover {
    color: #8871b2;
}

.tne-cps-rating {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.tne-cps-rating .star-rating {
    float: none;
    margin: 0 auto;
}

.tne-cps-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #222;
    font-weight: 700;
    margin-bottom: 10px;
}

.tne-cps-price del {
    opacity: .65;
    font-weight: 400;
}

.tne-cps-price ins {
    text-decoration: none;
}

.tne-cps-product-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tne-cps-action-button,
.tne-cps-action-button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--tne-cps-cart-icon-gap, 6px);
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.tne-cps-add-to-cart,
.tne-cps-add-to-cart.button {
    display: inline-flex !important;
    white-space: nowrap;
    flex-wrap: nowrap;
    gap: var(--tne-cps-cart-icon-gap, 6px);
}

.tne-cps-cart-button-text {
    display: inline-block;
    white-space: nowrap;
    line-height: inherit;
}

.tne-cps-cart-button-icon {
    width: 1em;
    height: 1em;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    line-height: 1;
    position: relative;
    top: var(--tne-cps-cart-icon-top, 0);
    margin: 0;
}

.tne-cps-cart-button-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
}

.tne-cps-add-to-cart-icon-after {
    flex-direction: row-reverse;
}

.tne-cps-add-to-cart-icon-before,
.tne-cps-add-to-cart-icon-after {
    flex-direction: row !important;
    direction: rtl;
}

.tne-cps-add-to-cart-icon-before .tne-cps-cart-button-icon {
    order: 1;
}

.tne-cps-add-to-cart-icon-before .tne-cps-cart-button-text {
    order: 2;
}

.tne-cps-add-to-cart-icon-after .tne-cps-cart-button-text {
    order: 1;
}

.tne-cps-add-to-cart-icon-after .tne-cps-cart-button-icon {
    order: 2;
}

.tne-cps-add-to-cart,
.tne-cps-add-to-cart.button {
    background: #8871b2;
    color: #fff;
}

.tne-cps-add-to-cart:hover,
.tne-cps-add-to-cart.button:hover {
    background: #6f5998;
    color: #fff;
    text-decoration: none;
}

.tne-cps-more-button {
    background: #f1edf7;
    color: #69518f;
}

.tne-cps-more-button:hover {
    background: #e7ddf2;
    color: #4e3a75;
    text-decoration: none;
}

.tne-cps-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tne-cps-page-link {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 999px;
    background: #fff;
    color: #333;
    cursor: pointer;
    line-height: 1;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.tne-cps-page-link:hover,
.tne-cps-page-link.is-active {
    background: #8871b2;
    color: #fff;
    border-color: #8871b2;
}

.tne-cps-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 34px;
    color: #777;
}

.tne-cps-empty,
.tne-notice {
    width: 100%;
    grid-column: 1 / -1;
    padding: 18px;
    border-radius: 14px;
    background: #fafafa;
    color: #555;
    text-align: center;
}

@media (max-width: 1024px) {
    .tne-cps {
        --tne-cps-cat-cols: 3;
        --tne-cps-product-cols: 3;
    }
}

@media (max-width: 767px) {
    .tne-cps {
        --tne-cps-cat-cols: 2;
        --tne-cps-product-cols: 2;
    }

    .tne-cps-categories {
        gap: 10px;
    }

    .tne-cps-cat-button {
        min-height: 44px;
        padding: 9px 12px;
    }

    .tne-cps-toolbar {
        justify-content: stretch;
    }

    .tne-cps-field,
    .tne-cps-stock-field {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .tne-cps-toolbar select {
        flex: 0 0 150px;
        max-width: 58%;
    }

    .tne-cps-product-image-wrap {
        height: 150px;
    }

    .tne-cps-product-content {
        padding: 10px;
    }
}

/* Template: card with site logo */
.tne-cps-product-image-link {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.tne-cps-product-card-logo {
    border-color: rgba(0, 207, 181, .28);
}

.tne-cps-card-logo {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.tne-cps-card-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.tne-cps-product-card-logo .tne-cps-sale-badge {
    right: auto;
    left: 10px;
    background: #10c8bc;
    color: #fff;
}

.tne-cps-hover-actions {
    position: absolute;
    top: 50%;
    left: 10px;
    z-index: 7;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translate(-8px, -50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
}

.tne-cps-product-card-logo:hover .tne-cps-hover-actions,
.tne-cps-product-card-logo:focus-within .tne-cps-hover-actions {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
}

.tne-cps-hover-icon,
.tne-cps-hover-icon.button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 999px;
    background: #fff;
    color: #0b2340;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.tne-cps-hover-icon:hover,
.tne-cps-hover-icon:focus {
    background: #0b2340;
    color: #fff;
    border-color: #0b2340;
    transform: translateY(-1px);
    text-decoration: none;
    outline: none;
}

.tne-cps-hover-icon svg {
    width: 52%;
    height: 52%;
    display: block;
    fill: currentColor;
}

.tne-cps-qv-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    direction: rtl;
}

.tne-cps-qv-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 12, 22, .58);
    backdrop-filter: blur(4px);
}

.tne-cps-qv-dialog {
    position: relative;
    z-index: 1;
    width: min(1040px, 96vw);
    max-height: min(760px, 92vh);
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}

.tne-cps-qv-close {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 4;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .25s ease, color .25s ease;
}

.tne-cps-qv-close:hover {
    background: #0f172a;
    color: #fff;
}

.tne-cps-qv-body {
    max-height: min(760px, 92vh);
    overflow: auto;
}

.tne-cps-qv-body.is-loading {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tne-cps-qv-loader {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(0, 0, 0, .12);
    border-top-color: #0b2340;
    border-radius: 50%;
    animation: tne-cps-spin .8s linear infinite;
}

.tne-cps-qv-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
    gap: 28px;
    padding: 34px;
}

.tne-cps-qv-gallery {
    min-width: 0;
}

.tne-cps-qv-image-stage {
    min-height: 420px;
    border-radius: 20px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow: hidden;
}

.tne-cps-qv-main-img {
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background: #fff;
    border: 10px solid #fff;
    border-radius: 16px;
}

.tne-cps-qv-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 6px;
}

.tne-cps-qv-thumb {
    flex: 0 0 66px;
    width: 66px;
    height: 66px;
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 12px;
    background: #fff;
    padding: 5px;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.tne-cps-qv-thumb.is-active,
.tne-cps-qv-thumb:hover {
    border-color: #0b2340;
    box-shadow: 0 8px 20px rgba(11, 35, 64, .12);
}

.tne-cps-qv-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.tne-cps-qv-summary {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 8px 18px 0;
}

.tne-cps-qv-title {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1.6;
    font-weight: 700;
}

.tne-cps-qv-rating {
    margin-bottom: 14px;
}

.tne-cps-qv-rating .star-rating {
    float: none;
}

.tne-cps-qv-excerpt {
    color: #475569;
    line-height: 2;
    margin-bottom: 18px;
}

.tne-cps-qv-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
}

.tne-cps-qv-price ins {
    text-decoration: none;
}

.tne-cps-qv-price del {
    opacity: .6;
    font-weight: 400;
}

.tne-cps-qv-cart .tne-cps-action-button {
    min-width: 180px;
}

body.tne-cps-qv-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .tne-cps-qv-modal {
        padding: 12px;
    }

    .tne-cps-qv-grid {
        grid-template-columns: 1fr;
        padding: 22px 16px;
        gap: 18px;
    }

    .tne-cps-qv-image-stage {
        min-height: 260px;
    }

    .tne-cps-qv-main-img {
        max-height: 280px;
    }

    .tne-cps-qv-summary {
        padding: 0;
    }

    .tne-cps-qv-title {
        font-size: 21px;
    }

    .tne-cps-hover-actions {
        opacity: 1;
        visibility: visible;
        transform: translate(0, -50%);
    }
}

.tne-cps-product-card-logo:before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    width: 54px;
    height: 54px;
    pointer-events: none;
    background: linear-gradient(225deg, transparent 0 49%, rgba(0, 207, 181, .85) 50%, transparent 51%);
}

/* Template: discount percentage card */
.tne-cps-product-card-discount {
    overflow: hidden;
}

.tne-cps-product-card-discount .tne-cps-product-image-wrap {
    background: #f8fafc;
}

.tne-cps-product-card-discount .tne-cps-sale-badge {
    right: auto;
    left: 12px;
    top: 12px;
    min-width: 42px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-weight: 700;
    direction: ltr;
    transition: opacity .25s ease, transform .25s ease;
}

.tne-cps-product-card-discount:hover .tne-cps-sale-badge,
.tne-cps-product-card-discount:focus-within .tne-cps-sale-badge {
    opacity: 0;
    transform: translateY(-6px);
}

.tne-cps-discount-hover-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
}

.tne-cps-product-card-discount:hover .tne-cps-discount-hover-actions,
.tne-cps-product-card-discount:focus-within .tne-cps-discount-hover-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tne-cps-product-card-discount .tne-cps-product-content {
    padding: 14px;
    text-align: right;
}

.tne-cps-product-card-discount .tne-cps-product-title {
    margin-bottom: 10px;
    text-align: right;
}

.tne-cps-product-card-discount .tne-cps-price {
    width: 100%;
    margin-bottom: 12px;
}

.tne-cps-discount-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    direction: rtl;
}

.tne-cps-discount-price-row.tne-cps-discount-price-single {
    justify-content: center;
    text-align: center;
}

.tne-cps-discount-price-special,
.tne-cps-discount-price-special .amount,
.tne-cps-discount-price-special ins,
.tne-cps-discount-price-special ins .amount {
    color: #e53935;
    font-weight: 800;
    text-decoration: none;
}

.tne-cps-discount-price-regular,
.tne-cps-discount-price-regular .amount,
.tne-cps-discount-price-regular del,
.tne-cps-discount-price-regular del .amount {
    color: #8a8f98;
    font-weight: 500;
}

.tne-cps-product-card-discount .tne-cps-product-actions {
    margin-top: 12px;
}

.tne-cps-product-card-discount .tne-cps-add-to-cart,
.tne-cps-product-card-discount .tne-cps-add-to-cart.button {
    width: 100%;
}
