/* ==========================================================================
   TM Promo Codes UI v1 (Catalog Cards, PDP, Quick-View, Shopping Cart)
   Shared across Top-Matras.ru & Matrasy-v-SPb.rf -- Pure 7-bit ASCII
   ========================================================================== */

/* --- 1. Catalog / Homepage / Related Card Top-Right Photo Sticker (0px flow height) --- */
.product-preview-cont {
    position: relative;
}

.inner-item-cont .tm-promo-card-wrap,
#oom-block .tm-promo-card-wrap,
.item-prewiew .tm-promo-card-wrap,
.product-preview-cont .tm-promo-card-wrap,
.tm-promo-card-wrap {
    position: absolute !important;
    top: 7px !important;
    right: 7px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 8 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: calc(100% - 52px) !important;
    pointer-events: auto !important;
}

.inner-item-cont .tm-promo-card-wrap.has-top-tag,
#oom-block .tm-promo-card-wrap.has-top-tag,
.item-prewiew .tm-promo-card-wrap.has-top-tag,
.tm-promo-card-wrap.has-top-tag {
    top: 31px !important;
}

.tm-promo-card-sticker {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 4px 7px;
    border-radius: 8px;
    border: 1px solid #6ac995;
    background: rgba(243, 252, 247, 0.96);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 3px 10px rgba(13, 92, 50, 0.13);
    cursor: pointer;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.18;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.tm-promo-card-sticker:hover {
    background: #e5f8ed;
    border-color: #3eb574;
    box-shadow: 0 4px 12px rgba(13, 92, 50, 0.2);
}

.tm-promo-card-sticker:active {
    transform: scale(0.97);
}

.tm-promo-card-sticker.is-copied {
    background: #169c56 !important;
    border-color: #169c56 !important;
    color: #ffffff !important;
    padding: 6px 9px;
    font-size: 11.5px;
    font-weight: 700;
}

.tm-promo-st-top {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tm-promo-card-pct {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 4px;
    background: #169c56;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.25;
}

.tm-promo-st-code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    font-weight: 800;
    color: #0f5f35;
    letter-spacing: 0.2px;
}

.tm-promo-st-sub {
    font-size: 10.5px;
    font-weight: 600;
    color: #336349;
    white-space: nowrap;
}

.tm-promo-st-sub strong {
    font-weight: 800;
    color: #0d753e;
    font-size: 11px;
}

/* Shared inline copy chip used in Cart hints */
.tm-promo-copy-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    border: 1px solid #9adbb7;
    background: #ffffff;
    color: #11683b;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.tm-promo-copy-chip:hover {
    background: #e2f7eb;
    border-color: #54bd85;
}

.tm-promo-copy-chip.is-copied {
    background: #169c56 !important;
    border-color: #169c56 !important;
    color: #ffffff !important;
}

@media screen and (max-width: 767px) {
    .inner-item-cont .tm-promo-card-wrap,
    #oom-block .tm-promo-card-wrap,
    .item-prewiew .tm-promo-card-wrap,
    .product-preview-cont .tm-promo-card-wrap,
    .tm-promo-card-wrap {
        top: 5px !important;
        right: 5px !important;
        max-width: calc(100% - 42px) !important;
    }
    .inner-item-cont .tm-promo-card-wrap.has-top-tag,
    #oom-block .tm-promo-card-wrap.has-top-tag,
    .item-prewiew .tm-promo-card-wrap.has-top-tag,
    .tm-promo-card-wrap.has-top-tag {
        top: 27px !important;
    }
    .tm-promo-card-sticker {
        padding: 3px 5px;
        border-radius: 6px;
        gap: 1px;
    }
    .tm-promo-card-pct {
        font-size: 9.5px;
        padding: 1px 3px;
    }
    .tm-promo-st-code {
        font-size: 10px;
    }
    .tm-promo-st-sub {
        font-size: 9.5px;
    }
    .tm-promo-st-sub strong {
        font-size: 10px;
    }
}

/* --- 2. Product Detail Page (PDP) & Quick-View Promo Box --- */
.tm-promo-pdp-box {
    margin: 10px 0 12px;
    padding: 11px 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f3fbf6 0%, #ebf7f0 100%);
    border: 1px solid #b6e4ca;
    box-sizing: border-box;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.tm-promo-pdp-box.is-manual-only {
    background: #f7fafd;
    border-color: #d7e4f2;
    padding: 9px 11px;
}

.tm-promo-pdp-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tm-promo-pdp-offer-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tm-promo-pdp-kicker {
    font-size: 11.5px;
    font-weight: 600;
    color: #2f6b4b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tm-promo-pdp-price-line {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.tm-promo-pdp-price {
    font-size: 19px;
    font-weight: 800;
    color: #0e7a42;
    letter-spacing: -0.2px;
}

.tm-promo-pdp-save {
    font-size: 11.5px;
    font-weight: 700;
    color: #ffffff;
    background: #169c56;
    padding: 2px 6px;
    border-radius: 6px;
}

.tm-promo-pdp-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px dashed #4db87e;
    background: #ffffff;
    color: #0f683a;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tm-promo-pdp-copy-btn code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    font-weight: 800;
    background: transparent;
    padding: 0;
    color: inherit;
}

.tm-promo-pdp-copy-btn:hover {
    background: #e3f6ec;
    border-style: solid;
}

.tm-promo-pdp-copy-btn.is-copied {
    background: #169c56 !important;
    border-color: #169c56 !important;
    border-style: solid !important;
    color: #ffffff !important;
}

.tm-promo-toggle-link {
    background: none;
    border: none;
    padding: 0;
    color: #1f5f99;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.tm-promo-toggle-link:hover {
    color: #123e6b;
}

.tm-promo-form-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.tm-promo-form-row.is-collapsed {
    display: none;
}

.tm-promo-inp {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #bdd3e8;
    background: #ffffff;
    color: #162b40;
    font-size: 16px !important;
    font-weight: 600;
    text-transform: uppercase;
    outline: none;
    box-sizing: border-box;
}

.tm-promo-inp:focus {
    border-color: #2670b8;
    box-shadow: 0 0 0 3px rgba(38, 112, 184, 0.14);
}

.tm-promo-apply-btn {
    flex: 0 0 auto;
    height: 36px;
    padding: 0 13px;
    border-radius: 8px;
    border: none;
    background: #1f67ab;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.tm-promo-apply-btn:hover {
    background: #17528a;
}

.tm-promo-apply-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.tm-promo-applied-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #dff5e8;
    border: 1px solid #8fd6ae;
    color: #0d6235;
    font-size: 12.5px;
    font-weight: 700;
    margin-top: 6px;
}

.tm-promo-remove-btn {
    background: none;
    border: none;
    color: #8c2a2a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 5px;
}

.tm-promo-remove-btn:hover {
    background: rgba(180, 35, 35, 0.1);
}

.tm-promo-msg {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.35;
}

.tm-promo-msg.is-err {
    color: #c22525;
    font-weight: 600;
}

.tm-promo-msg.is-ok {
    color: #0f703d;
    font-weight: 600;
}

/* Highlighted active promo price near main PDP / QV price */
.tm-pdp-price-struck {
    text-decoration: line-through !important;
    opacity: 0.72 !important;
}

.tm-pdp-active-price-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 4px 11px;
    border-radius: 8px;
    background: linear-gradient(135deg, #169c56 0%, #0f7c43 100%);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 17px;
    line-height: 1.2;
    vertical-align: middle;
    box-shadow: 0 4px 12px rgba(15, 124, 67, 0.25);
    z-index: 5;
    white-space: nowrap;
}

.tm-pdp-active-price-pill.is-abs-under {
    position: absolute !important;
    right: 0 !important;
    margin-left: 0 !important;
}

/* --- 3. Shopping Cart Promo Box & Recalculated Totals --- */
.tm-promo-cart-wrap {
    margin: 16px 0;
    padding: 16px 18px;
    border-radius: 14px;
    background: #f7fafd;
    border: 1px solid #d5e4f2;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.tm-promo-cart-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tm-promo-cart-hint {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 10px;
    background: #ecf9f2;
    border: 1px dashed #7bcba2;
    font-size: 13px;
    color: #165936;
}

.tm-promo-cart-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tm-promo-cart-title {
    font-size: 14px;
    font-weight: 700;
    color: #193654;
    margin-right: 4px;
}

.tm-promo-cart-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 280px;
    max-width: 440px;
}

.tm-promo-cart-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tm-promo-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #def5e8;
    border: 1px solid #87d3ab;
    color: #0e6336;
    font-size: 13px;
    font-weight: 700;
}

.tm-cart-item-old-price {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #7c8d9e;
    text-decoration: line-through;
    line-height: 1.2;
}

.tm-cart-item-new-price {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #107c43;
    line-height: 1.25;
}

.tm-cart-item-promo-tag {
    display: inline-block;
    margin-top: 3px;
    padding: 2px 6px;
    border-radius: 5px;
    background: #e6f7ee;
    color: #11733f;
    font-size: 11px;
    font-weight: 700;
}

.tm-cart-summary-breakdown {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #496179;
}

.tm-cart-summary-discount {
    color: #117c44;
    font-weight: 700;
}

@media screen and (max-width: 640px) {
    .tm-promo-cart-wrap {
        padding: 13px 14px;
    }
    .tm-promo-cart-form {
        max-width: 100%;
        width: 100%;
    }
    .tm-cart-summary-breakdown {
        align-items: flex-start;
    }
}

/* ==========================================================================
   4. Unified Fav / Compare / Single-Star Reviews Pill Row (PDP & Quick-View)
   Shared across Top-Matras.ru & Matrasy-v-SPb.rf
   ========================================================================== */

/* Hide legacy bulky bottom rating box everywhere */
.cmtx_average_rating_block_show,
.cmtx_average_rating_block_show222,
#main_container.topm-no-sidebar .item-single .cmtx_average_rating_block_show,
#main_container.topm-no-sidebar .item-single .cmtx_average_rating_block_show222,
.product_qv_info .cmtx_average_rating_block_show,
.product_qv_info .cmtx_average_rating_block_show222 {
    display: none !important;
}

/* Clean card container for Quick-View manufacturer + actions (matches PDP) */
.product_qv_info .column-photo .manufacturer {
    margin-top: 10px !important;
    padding: 10px 12px !important;
    background: #f8fbfe !important;
    border: 1px solid #dce8f4 !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.product_qv_info .column-photo .manufacturer > img,
.product_qv_info .column-photo .manufacturer > picture {
    display: none !important;
}

.product_qv_info .column-photo .manufacturer > span.cena_2 {
    order: 1 !important;
    margin: 0 !important;
    font-size: 12px !important;
    color: #546d85 !important;
    white-space: nowrap !important;
}

.product_qv_info .column-photo .manufacturer > font#currentPrice {
    order: 1 !important;
    margin-right: auto !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
}

.product_qv_info .column-photo .manufacturer > font#currentPrice a {
    padding: 2px 8px !important;
    font-size: 12.5px !important;
    border-radius: 6px !important;
}

/* Action pills row inside .manufacturer on both PDP and Quick-View */
.item-single .manufacturer .tm-prod-meta-actions,
.product_qv_info .manufacturer .tm-prod-meta-actions,
.tm-prod-meta-actions {
    order: 2 !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.tm-prod-meta-actions .prod-fav-comp {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tm-prod-meta-actions .tm-prod-rating-slot {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Harmonize Fav & Compare pills across TOPM (.custom-ic) & MSPB (.to-favorites / .to-compare) */
.tm-prod-meta-actions .prod-fav-comp .dobSr,
#main_container.topm-no-sidebar .item-single .manufacturer-lg .tm-prod-meta-actions .prod-fav-comp .dobSr,
.product_qv_info .tm-prod-meta-actions .prod-fav-comp .dobSr {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    height: 30px !important;
    padding: 0 9px !important;
    margin: 0 !important;
    border-radius: 7px !important;
    border: 1px solid #d5e3f0 !important;
    background-color: #ffffff !important;
    color: #243b53 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

.tm-prod-meta-actions .prod-fav-comp .dobSr.custom-ic {
    padding-left: 26px !important;
    background-position: 7px center !important;
}

/* Crisp SVG icons for MSPB .to-favorites / .to-compare where .custom-ic is not used */
.tm-prod-meta-actions .prod-fav-comp .dobSr.to-favorites:not(.custom-ic)::before,
.tm-prod-meta-actions .prod-fav-comp .dobSr.to-compare:not(.custom-ic)::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px 13px;
}

.tm-prod-meta-actions .prod-fav-comp .dobSr.to-favorites:not(.custom-ic)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%233b76a8' stroke-width='1.9' stroke-linejoin='round'%3E%3Cpath d='M10 17.2s-6.7-4.2-6.7-8.9A3.9 3.9 0 0 1 10 5.6a3.9 3.9 0 0 1 6.7 2.7c0 4.7-6.7 8.9-6.7 8.9z'/%3E%3C/svg%3E");
}

.tm-prod-meta-actions .prod-fav-comp .dobSr.to-compare:not(.custom-ic)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%233b76a8' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='4.5' y1='16.5' x2='4.5' y2='9'/%3E%3Cline x1='10' y1='16.5' x2='10' y2='3.5'/%3E%3Cline x1='15.5' y1='16.5' x2='15.5' y2='11.5'/%3E%3C/svg%3E");
}

.tm-prod-meta-actions .prod-fav-comp .dobSr:hover,
.tm-prod-meta-actions .prod-fav-comp .dobSr.in,
#main_container.topm-no-sidebar .item-single .manufacturer-lg .tm-prod-meta-actions .prod-fav-comp .dobSr:hover,
#main_container.topm-no-sidebar .item-single .manufacturer-lg .tm-prod-meta-actions .prod-fav-comp .dobSr.in {
    background-color: #ebf5fe !important;
    border-color: #63ace0 !important;
    color: #135d90 !important;
}

/* Single-Star Rating & Reviews Pill */
.product_qv_info .column-photo a.tm-rating-pill,
.item-single .manufacturer a.tm-rating-pill,
a.tm-rating-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    height: 30px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    border-radius: 7px !important;
    border: 1px solid #f6c768 !important;
    background: #fffbeb !important;
    color: #1e293b !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease !important;
}

.product_qv_info .column-photo a.tm-rating-pill:hover,
.item-single .manufacturer a.tm-rating-pill:hover,
a.tm-rating-pill:hover {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    box-shadow: 0 2px 7px rgba(245, 158, 11, 0.18) !important;
    text-decoration: none !important;
}

.product_qv_info .column-photo a.tm-rating-pill:active,
.item-single .manufacturer a.tm-rating-pill:active,
a.tm-rating-pill:active {
    transform: scale(0.98) !important;
}

.product_qv_info .column-photo a.tm-rating-pill.is-empty,
.item-single .manufacturer a.tm-rating-pill.is-empty,
a.tm-rating-pill.is-empty {
    background: #ffffff !important;
    border-color: #d5e3f0 !important;
    color: #475569 !important;
}

.product_qv_info .column-photo a.tm-rating-pill.is-empty:hover,
.item-single .manufacturer a.tm-rating-pill.is-empty:hover,
a.tm-rating-pill.is-empty:hover {
    background: #f3f8fd !important;
    border-color: #9ec5e6 !important;
    box-shadow: none !important;
}

.tm-rating-pill__star {
    width: 14px !important;
    height: 14px !important;
    fill: #f59e0b !important;
    flex-shrink: 0 !important;
    display: block !important;
}

a.tm-rating-pill.is-empty .tm-rating-pill__star {
    fill: #fbbf24 !important;
    opacity: 0.85;
}

.tm-rating-pill__val {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    letter-spacing: -0.01em !important;
}

.tm-rating-pill__sep {
    color: #94a3b8 !important;
    font-weight: 700 !important;
    margin: 0 -1px !important;
}

.tm-rating-pill__cnt {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #334e68 !important;
}

/* Hide empty .item-single-controls wrapper in Quick-View when product has no delivery description */
.product_qv_info .item-single-controls:empty {
    display: none !important;
}

@media screen and (max-width: 767px) {
    .tm-prod-meta-actions {
        gap: 5px !important;
    }

    .tm-prod-meta-actions .prod-fav-comp {
        gap: 5px !important;
    }

    .tm-prod-meta-actions .prod-fav-comp .dobSr,
    #main_container.topm-no-sidebar .item-single .manufacturer-lg .tm-prod-meta-actions .prod-fav-comp .dobSr {
        height: 28px !important;
        padding: 0 7px !important;
        font-size: 11.5px !important;
        gap: 4px !important;
    }

    .tm-prod-meta-actions .prod-fav-comp .dobSr.custom-ic {
        padding-left: 23px !important;
        background-position: 6px center !important;
    }

    .product_qv_info .column-photo a.tm-rating-pill,
    .item-single .manufacturer a.tm-rating-pill,
    a.tm-rating-pill {
        height: 28px !important;
        padding: 0 8px !important;
        font-size: 11.5px !important;
        gap: 4px !important;
    }

    .tm-rating-pill__star {
        width: 13px !important;
        height: 13px !important;
    }

    .tm-rating-pill__val {
        font-size: 12px !important;
    }

    .tm-rating-pill__cnt {
        font-size: 11.5px !important;
    }
}
