/*
 * Magnacrete Colors comparison page.
 * Intentionally scoped: no generic body, header, footer, img or button resets.
 */
.mc-colors-page,
.mc-colors-page *,
.mc-colors-modal,
.mc-colors-modal * {
    box-sizing: border-box;
}

.mc-colors-page {
    --mc-colors-red: #ed1524;
    --mc-colors-black: #151515;
    --mc-colors-muted: #666;
    --mc-colors-line: #ececec;
    width: 100%;
    max-width: 1530px;
    margin: 0 auto;
    padding: 32px 15px 115px;
    color: #101010;
    background: #fff;
    font-family: inherit;
}

.mc-colors-page button,
.mc-colors-modal button {
    cursor: pointer;
    font-family: inherit;
}

.mc-colors-page button:focus-visible,
.mc-colors-modal button:focus-visible {
    outline: 2px solid var(--mc-colors-red, #ed1524);
    outline-offset: 3px;
}

.mc-colors-layout {
    display: grid;
    grid-template-columns: minmax(210px, 292px) minmax(0, 1fr);
    column-gap: clamp(28px, 4vw, 65px);
    align-items: start;
    margin-top:5rem;
}

/* Left FINISHES navigation. */
.mc-colors-sidebar {
    min-width: 0;
	position: sticky;
    top: 0;
}

.mc-colors-sidebar-inner {
    position: sticky;
    top: 100px;
}

.mc-colors-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 51px;
    padding: 0 15px 0 10px;
    border: 0;
    border-bottom: 1px solid #aaa;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #808080;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-transform: uppercase;
    transition: color .2s ease;
}

.mc-colors-nav-toggle:hover {
    background: transparent;
    color: #333;
}

.mc-colors-nav-toggle svg {
    flex: none;
    color: #ec1e2b;
    transition: transform .2s ease;
}

.mc-colors-nav-toggle[aria-expanded="false"] svg {
    transform: rotate(180deg);
}

.mc-colors-finish-nav {
    display: flex;
    flex-direction: column;
    padding-top: 41px;
}

.mc-colors-finish-nav[hidden] {
    display: none !important;
}

.mc-colors-page .mc-colors-finish-link {
    display: block;
    width: 100%;
    min-height: 39px;
    padding: 8px 17px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: #5a5a5a;
    text-align: left;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
    text-transform: none;
    transition: background .18s ease, color .18s ease;
}

.mc-colors-page .mc-colors-finish-link:hover,
.mc-colors-page .mc-colors-finish-link.is-active {
    background: #f4f4f4;
    color: #222;
}

/* Category heading and 3-column rows. */
.mc-colors-catalog {
    min-width: 0;
}

.mc-colors-section {
    scroll-margin-top: 120px;
    margin: 0 0 44px;
}

.mc-colors-section-heading {
    margin: 0 0 34px;
    color: #080808;
    font-size: clamp(22px, 2.3vw, 29px);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
}

.mc-colors-column-head,
.mc-colors-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(115px, .37fr) minmax(0, 1fr);
    column-gap: 16px;
}

.mc-colors-column-head {
    align-items: center;
    margin-bottom: 12px;
    font-size: clamp(13px, 1.3vw, 16px);
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    color: #0a0a0a;
}

.mc-colors-row {
    position: relative;
    align-items: end;
    min-width: 0;
    width: 100%;
    margin: 0 0 21px;
    padding: 0 0 13px;
    border: 1px solid transparent;
    border-bottom-color: var(--mc-colors-line);
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s ease, box-shadow .18s ease, border-color .18s ease, padding .18s ease;
}

/* Match the original site: only checked colors receive a framed row. */
.mc-colors-page .mc-colors-row.is-selected {
    padding: 8px 8px 12px 18px;
    border-color: #d8d8d8;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .09);
}

.mc-colors-page .mc-colors-row:not(.is-selected):hover {
    background: #fff;
}

.mc-colors-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 26px;
    height: 26px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.mc-colors-check-icon {
    position: absolute;
    top: 5px;
    left: -8px;
    display: grid;
    place-items: center;
    z-index: 3;
    width: 26px;
    height: 26px;
    border: 1px solid #a9a9a9;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    color: transparent;
    font-size: 15px;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
    /* Hide the circle entirely until this color is checked. */
    opacity: 0;
    visibility: hidden;
    transform: scale(.85);
    transition: opacity .18s ease, transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, visibility .18s ease;
}

/* :checked keeps the tick in sync even if another script changes the checkbox. */
.mc-colors-page .mc-colors-checkbox:checked + .mc-colors-check-icon {
    border-color: #858585;
    background: #858585;
    color: #fff;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Keep the checkbox visible to keyboard users while it has focus. */
.mc-colors-page .mc-colors-checkbox:focus-visible + .mc-colors-check-icon {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    outline: 2px solid var(--mc-colors-red);
    outline-offset: 3px;
}

.mc-colors-front-cell,
.mc-colors-top-cell,
.mc-colors-product-name {
    display: block;
    min-width: 0;
}

/* Real image frame. The front image below can also use an optional CSS slab. */
.mc-colors-photo {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1.93 / 1;
    overflow: hidden;
    background: #fff;
}

.mc-colors-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
}

/* Top texture: subtle original-site image edge/shadow. */
.mc-colors-photo--top {
    border: 1px solid #e7e7e7;
    box-shadow: 0 1px 4px rgba(0,0,0,.16);
}

/* Front slab: turn any flat ACF texture into an angled slab with thickness.
   Disable with $mc_colors_front_css_slab=false if the uploaded asset is 3D already. */
.mc-colors-photo.mc-colors-css-slab,
.mc-colors-compare-photo.mc-colors-css-slab {
    position: relative;
    overflow: visible;
    background: transparent;
    filter: drop-shadow(1px 2px 2px rgba(0,0,0,.25));
}

.mc-colors-photo.mc-colors-css-slab > img,
.mc-colors-compare-photo.mc-colors-css-slab > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 93%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    clip-path: polygon(0 0, 87% 0, 100% 100%, 0 100%);
}

.mc-colors-photo.mc-colors-css-slab::after,
.mc-colors-compare-photo.mc-colors-css-slab::after {
    content: '';
    position: absolute;
    z-index: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 7%;
    background: linear-gradient(180deg, #c6bab0 0%, #a99b90 48%, #91857c 100%);
    box-shadow: inset 0 1px 1px rgba(60, 43, 29, .24);
}

/* Stronger shadows on selected row, without dimming images. */
.mc-colors-row.is-selected .mc-colors-photo--top {
    box-shadow: 0 2px 6px rgba(0,0,0,.24);
}

.mc-colors-row.is-selected .mc-colors-css-slab {
    filter: drop-shadow(1px 3px 3px rgba(0,0,0,.29));
}

/* Actual Top View field is empty: Front texture is a preview, not real Top View. */
.mc-colors-photo--fallback::after {
    content: 'Texture preview';
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 3px 6px;
    background: rgba(0,0,0,.64);
    color: #fff;
    font: 10px/1.2 Arial, sans-serif;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}
.mc-colors-row:hover .mc-colors-photo--fallback::after,
.mc-colors-row:focus-within .mc-colors-photo--fallback::after {
    opacity: 1;
}

.mc-colors-image-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    background: #f1f1f1;
    color: #757575;
    font-size: 12px;
    text-align: center;
}

.mc-colors-product-name {
    padding: 0 5px 3px;
    color: #111;
    font-size: clamp(14px, 1.3vw, 17px);
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
}

.mc-colors-no-posts,
.mc-colors-empty {
    color: var(--mc-colors-muted);
    font-size: 16px;
}

.mc-colors-empty {
    padding: 50px 15px;
    text-align: center;
}

.mc-colors-admin-help {
    max-width: 640px;
    margin: 15px auto;
    padding: 15px;
    background: #fff9df;
    color: #4a3b13;
}

/* Fixed bottom selection summary. */
.mc-colors-comparebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9990;
    width: 100%;
    min-height: 70px;
    background: #242021;
    color: #fff;
    box-shadow: 0 -2px 10px rgb(0 0 0 / 12%);
}

.mc-colors-comparebar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    width: 100%;
    max-width: 1530px;
    min-height: 70px;
    margin: 0 auto;
    padding: 10px 15px;
}

.mc-colors-count,
.mc-colors-page .mc-colors-count {
    margin: 0;
    color: #fff;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.25;
    white-space: nowrap;
}

.mc-colors-count strong {
    font-weight: 400;
}

.mc-colors-page .mc-colors-compare-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 177px;
    min-height: 50px;
    padding: 10px 23px;
    border: 0;
    border-radius: 0;
    background: #e91625;
    box-shadow: none;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    transition: background .2s ease;
}

.mc-colors-page .mc-colors-compare-button:hover,
.mc-colors-page .mc-colors-compare-button:focus-visible {
    background: #c5101e;
    color: #fff;
}

.mc-colors-notice {
    position: absolute;
    right: max(15px, calc((100vw - 1500px) / 2 + 15px));
    bottom: calc(100% + 10px);
    max-width: 300px;
    margin: 0;
    padding: 9px 12px;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 3px 12px rgb(0 0 0 / 18%);
    color: #a20000;
    font-size: 14px;
}

.mc-colors-notice[hidden] {
    display: none !important;
}

/* Comparison modal: purposefully moved outside theme layout by JS. */
.mc-colors-modal[hidden],
.mc-colors-panel[hidden] {
    display: none !important;
}

.mc-colors-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 999999;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 7px 6px 60px;
    -webkit-overflow-scrolling: touch;
}

.mc-colors-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 50%);
}

body.mc-colors-modal-open {
    overflow: hidden !important;
}

.mc-colors-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1480px;
    min-height: 280px;
    padding: 0 16px 20px;
    border: 1px solid #ddd;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 3px 22px rgb(0 0 0 / 12%);
    color: #111;
}

.mc-colors-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-bottom: 1px solid #d8dfe3;
}

.mc-colors-tabs {
    display: flex;
    gap: 0;
    justify-content: center;
    min-height: 48px;
}

.mc-colors-modal .mc-colors-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    margin: 0 0 -1px;
    padding: 0 16px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #5c5c5c;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
}

.mc-colors-modal .mc-colors-tab:hover,
.mc-colors-modal .mc-colors-tab.is-active {
    border-bottom-color: #ed1524;
    background: #fff;
    color: #ed1524;
}

.mc-colors-modal .mc-colors-modal-close {
    position: absolute;
    right: -23px;
    top: -1px;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ed1524;
    box-shadow: none;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 27px;
    font-weight: 600;
    line-height: 1;
}

.mc-colors-modal .mc-colors-modal-close:hover {
    background: #c5101e;
    color: #fff;
}

.mc-colors-panel {
    padding-top: 23px;
}

.mc-colors-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px 28px;
    align-items: start;
}

.mc-colors-compare-card {
    min-width: 0;
    margin: 0;
    text-align: center;
}

.mc-colors-compare-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1.93 / 1;
    overflow: hidden;
    background: #fff;
}

.mc-colors-compare-photo--top {
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 5px rgba(0,0,0,.13);
}

.mc-colors-compare-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mc-colors-compare-preview-label {
    display: block;
    padding-top: 2px;
    color: #777;
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
}

.mc-colors-compare-card figcaption {
    padding-top: 4px;
    color: #0e0e0e;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.mc-colors-compare-finish {
    display: block;
    padding-top: 2px;
    color: #6f6f6f;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
}

.mc-colors-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 1250px) {
    .mc-colors-compare-grid {
        grid-template-columns: repeat(auto-fit, minmax(270px, 330px));
    }
}

@media (max-width: 1080px) {
    .mc-colors-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        column-gap: 20px;
    }

    .mc-colors-column-head,
    .mc-colors-row {
        grid-template-columns: minmax(0, 1fr) minmax(85px, .35fr) minmax(0, 1fr);
        column-gap: 9px;
    }

    .mc-colors-product-name {
        font-size: 14px;
    }
}

@media (max-width: 740px) {
    .mc-colors-page {
        padding: 15px 12px 105px;
    }

    .mc-colors-layout {
        display: block;
    }

    .mc-colors-sidebar {
        margin-bottom: 28px;
    }

    .mc-colors-sidebar-inner {
        position: relative;
        top: auto;
    }

    .mc-colors-finish-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px;
        padding: 8px 0 0;
    }

    .mc-colors-page .mc-colors-finish-link {
        padding: 10px 8px;
        font-size: 13px;
    }

    .mc-colors-section {
        scroll-margin-top: 85px;
        margin-bottom: 40px;
    }

    .mc-colors-section-heading {
        margin-bottom: 24px;
        font-size: 23px;
    }

    .mc-colors-column-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        font-size: 13px;
    }

    .mc-colors-column-head span:nth-child(2) {
        display: none;
    }

    .mc-colors-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px 12px;
        padding-bottom: 15px;
        margin-bottom: 17px;
        align-items: start;
    }

    .mc-colors-page .mc-colors-row.is-selected {
        padding: 6px 6px 13px 9px;
    }

    .mc-colors-front-cell {
        grid-column: 1;
        grid-row: 1;
    }

    .mc-colors-top-cell {
        grid-column: 2;
        grid-row: 1;
    }

    .mc-colors-product-name {
        grid-column: 1 / -1;
        grid-row: 2;
        padding: 3px 8px 0;
        font-size: 15px;
    }

    .mc-colors-photo {
        aspect-ratio: 1.7 / 1;
    }

    .mc-colors-check-icon {
        left: 1px;
        top: 2px;
        width: 24px;
        height: 24px;
    }

    .mc-colors-comparebar-inner {
        min-height: 66px;
    }

    .mc-colors-count {
        font-size: 15px !important;
    }

    .mc-colors-page .mc-colors-compare-button {
        min-width: 130px;
        min-height: 45px;
        padding: 9px 14px;
        font-size: 16px;
    }

    .mc-colors-modal {
        padding: 7px 5px 55px;
    }

    .mc-colors-dialog {
        padding: 0 12px 18px;
    }

    .mc-colors-modal .mc-colors-modal-close {
        right: -14px;
    }

    .mc-colors-compare-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
    }

    .mc-colors-compare-card figcaption {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .mc-colors-comparebar-inner {
        gap: 9px;
    }

    .mc-colors-page .mc-colors-compare-button {
        min-width: 115px;
    }

    .mc-colors-compare-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mc-colors-page *,
    .mc-colors-modal * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}