/* =========================================================
   CABINETRO — MODERN STYLE
   CR-Precision 2026 / Production
   Scope: /kitchens/Modern-Cabinet
   ========================================================= */

.crms-page{
    --crms-brand:#d31818;
    --crms-brand-dark:#b61515;
    --crms-ink:#171715;
    --crms-muted:#73746f;
    --crms-muted-2:#92938e;
    --crms-bg:#f4f1eb;
    --crms-surface:#ffffff;
    --crms-surface-warm:#eee8df;
    --crms-line:#e6e1d9;
    --crms-line-strong:#d7d1c8;
    --crms-success:#2f7a48;
    --crms-preview:#8f8172;
    --crms-active:#4f5558;
    --crms-shadow-1:0 12px 34px rgba(37,32,25,.045);
    --crms-shadow-2:0 20px 48px rgba(37,32,25,.075);

    direction:rtl;
    background:linear-gradient(
        180deg,
        #f8f6f1 0,
        #f4f1eb 38%,
        #f3f0e9 100%
    );
    color:var(--crms-ink);
    padding:0 0 1px;
}

.crms-page *,
.crms-page *::before,
.crms-page *::after{
    box-sizing:border-box;
}

.crms-page a{
    color:inherit;
    text-decoration:none;
}

.crms-page button{
    font:inherit;
    color:inherit;
}

.crms-page img{
    display:block;
    max-width:100%;
}

.crms-page :focus-visible{
    outline:2px solid var(--crms-brand);
    outline-offset:3px;
}

/* =========================
   MAIN SHELL
   ========================= */

.crms-wrap{
    max-width:1240px;
    margin:auto;
    padding:0 30px;
}

.crms-breadcrumb{
    max-width:1180px;
    margin:auto;
    padding-top:20px;
    display:flex;
    align-items:center;
    gap:7px;
    font-size:10px;
    color:var(--crms-muted-2);
}

.crms-breadcrumb a:hover{
    color:var(--crms-brand);
}

/* =========================
   INTRO
   ========================= */

.crms-intro{
    max-width:1180px;
    margin:auto;
    padding:36px 0 27px;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(320px,430px);
    align-items:end;
    gap:56px;
}

.crms-intro h1{
    margin:0;
    font-size:46px;
    font-weight:800;
    line-height:1.2;
    letter-spacing:-1.5px;
}

.crms-intro p{
    margin:0 0 3px;
    font-size:13px;
    line-height:2;
    color:var(--crms-muted);
}

/* =========================
   HERO
   ========================= */

.crms-hero{
    max-width:1180px;
    margin:auto;
    display:grid;
    grid-template-columns:minmax(0,1fr) 264px;
    background:var(--crms-surface);
    box-shadow:var(--crms-shadow-2);
}

.crms-hero-photo{
    position:relative;
    aspect-ratio:4/3;
    overflow:hidden;
    background:#e9e6e0;
}

.crms-hero-photo img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.crms-hero-mask{
    position:absolute;
    inset:0;
    background:var(--crms-active);
    opacity:.72;
    mix-blend-mode:color;
    pointer-events:none;

    -webkit-mask-image:var(--crms-mask);
    mask-image:var(--crms-mask);

    -webkit-mask-size:100% 100%;
    mask-size:100% 100%;

    -webkit-mask-repeat:no-repeat;
    mask-repeat:no-repeat;

    transition:
        background .18s ease,
        opacity .18s ease;
}

/* =========================
   COLOR PANEL
   ========================= */

.crms-color-rail{
    background:var(--crms-surface-warm);
    padding:16px;
}

.crms-color-panel{
    height:100%;
    background:#fff;
    padding:14px;
    display:flex;
    flex-direction:column;
    border:1px solid rgba(0,0,0,.045);
}

.crms-color-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size:10px;
    color:#797872;
    margin-bottom:10px;
}

.crms-status-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:var(--crms-success);
    box-shadow:0 0 0 3px #edf5ef;
    transition:.18s;
}

.crms-status-dot.is-preview{
    background:var(--crms-preview);
    box-shadow:0 0 0 3px #f0ece7;
}

.crms-door-preview{
    aspect-ratio:110/158;
    background:
        linear-gradient(
            118deg,
            rgba(255,255,255,.15),
            transparent 30%,
            transparent 75%,
            rgba(0,0,0,.045)
        ),
        var(--crms-active);

    border:1px solid #dfddd7;
    transition:background .18s ease;
}

.crms-color-meta{
    padding-top:13px;
    display:flex;
    flex-direction:column;
    flex:1;
}

.crms-color-meta > small{
    font-size:9px;
    color:var(--crms-muted-2);
}

.crms-color-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin:2px 0 0;
}

.crms-color-title-row strong{
    font-size:19px;
    line-height:1.45;
}

.crms-state{
    font-size:9px;
    font-weight:700;
    border-radius:999px;
    padding:4px 7px;
    white-space:nowrap;
}

.crms-state--ok{
    color:#27643b;
    background:#edf5ef;
}

.crms-state--preview{
    color:#715e47;
    background:#f1ece5;
}

.crms-color-tip{
    min-height:0;
    margin:6px 0 0;
    font-size:10px;
    line-height:1.8;
    color:var(--crms-muted);
}

.crms-color-tip:empty{
    display:none;
}

/* =========================
   SELLABLE COLORS
   ========================= */

.crms-inline-colors{
    margin-top:11px;
    padding-top:11px;
    border-top:1px solid var(--crms-line);
}

.crms-inline-colors-label{
    display:block;
    font-size:9px;
    color:var(--crms-muted-2);
    margin-bottom:7px;
}

.crms-inline-colors-grid{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.crms-inline-color{
    width:100%;
    min-height:46px;
    border:1px solid var(--crms-line);
    background:#fff;
    padding:4px 7px;
    cursor:pointer;

    display:grid;
    grid-template-columns:36px 1fr 18px;
    align-items:center;
    gap:8px;

    text-align:right;

    transition:
        background .16s,
        border-color .16s;
}

.crms-inline-color:hover{
    border-color:#cbc5bc;
    background:#faf8f4;
}

.crms-inline-color.is-active{
    border-color:var(--crms-brand);
    background:#fffafa;
}

.crms-inline-chip{
    width:36px;
    height:36px;
    background:var(--crms-color);
    border:1px solid rgba(0,0,0,.06);
}

.crms-inline-color.is-wood .crms-inline-chip{
    background:
        repeating-linear-gradient(
            96deg,
            var(--crms-color) 0 6px,
            var(--crms-color-2) 6px 11px,
            var(--crms-color) 11px 16px
        );
}

.crms-inline-name{
    display:block;
    font-size:10px;
    font-weight:800;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.crms-inline-check{
    width:18px;
    height:18px;
    border-radius:50%;
    display:grid;
    place-items:center;
    color:transparent;
    font-size:10px;
    font-weight:800;
}

.crms-inline-color.is-active .crms-inline-check{
    background:var(--crms-brand);
    color:#fff;
}

.crms-inline-color.is-active .crms-inline-name{
    color:var(--crms-brand);
}

/* =========================
   PRIMARY CTA
   ========================= */

.crms-primary-btn{
    margin-top:11px;
    min-height:46px;

    border:1px solid var(--crms-ink);
    background:var(--crms-ink);
    color:#fff !important;

    padding:0 14px;

    display:flex;
    align-items:center;
    justify-content:space-between;

    cursor:pointer;
    font-size:11px;
    font-weight:800;

    transition:.18s;
}

.crms-primary-btn:hover{
    background:var(--crms-brand);
    border-color:var(--crms-brand);
}

.crms-primary-btn.is-browse-only{
    background:#fff;
    color:var(--crms-ink) !important;
    border-color:var(--crms-line-strong);
}

.crms-primary-btn.is-browse-only:hover{
    color:var(--crms-brand) !important;
    border-color:var(--crms-brand);
}

/* =========================
   OTHER PALETTE
   ========================= */

.crms-palette{
    max-width:1180px;
    margin:30px auto 0;
    padding:20px 24px 21px;

    background:#fff;
    box-shadow:var(--crms-shadow-1);
}

.crms-other-head{
    display:flex;
    align-items:end;
    justify-content:space-between;
    gap:20px;
    margin-bottom:12px;
}

.crms-other-head strong{
    font-size:15px;
}

.crms-other-head span{
    font-size:9px;
    color:var(--crms-muted-2);
}

.crms-other-colors{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
}

.crms-swatch{
    width:32px;
    height:32px;

    border:1px solid #ddd8d0;
    background:var(--crms-color);

    padding:0;
    cursor:pointer;
    opacity:.78;

    transition:
        opacity .15s,
        transform .15s,
        box-shadow .15s;
}

.crms-swatch.is-wood{
    background:
        repeating-linear-gradient(
            96deg,
            var(--crms-color) 0 7px,
            var(--crms-color-2) 7px 13px,
            var(--crms-color) 13px 18px
        );
}

.crms-swatch:hover{
    opacity:1;
    transform:translateY(-1px);
}

.crms-swatch.is-active{
    opacity:1;
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 3px var(--crms-brand);
}

/* =========================
   PURCHASE ROUTES
   ========================= */

.crms-purchase{
    max-width:1180px;
    margin:auto;
    padding:76px 0 0;
}

.crms-purchase::before{
    content:"";
    display:block;
    width:72px;
    height:2px;
    background:var(--crms-brand);
    margin-bottom:16px;
}

.crms-section-head{
    max-width:720px;
    margin-bottom:24px;
}

.crms-section-head > span{
    display:block;
    font-size:10px;
    color:#8c8983;
    margin-bottom:5px;
}

.crms-section-head h2{
    font-size:34px;
    line-height:1.4;
    letter-spacing:-.8px;
    margin:0 0 5px;
}

.crms-section-head p{
    margin:0;
    font-size:11px;
    color:var(--crms-muted);
}

.crms-routes{
    display:grid;
    grid-template-columns:1.35fr repeat(3,1fr);
    gap:14px;
}

.crms-route{
    min-width:0;
    background:#fff;
    box-shadow:var(--crms-shadow-1);

    transition:
        transform .2s,
        box-shadow .2s;
}

.crms-route:hover{
    transform:translateY(-4px);
    box-shadow:var(--crms-shadow-2);
}

.crms-route--featured{
    background:#f5f1ea;
}

.crms-route-photo{
    position:relative;
    height:188px;
    overflow:hidden;
    background:#ebe8e2;
}

.crms-route--featured .crms-route-photo{
    height:226px;
}

.crms-route-photo img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.crms-route-badge{
    position:absolute;
    top:11px;
    right:11px;

    background:#fff;
    border:1px solid #ebe5dc;

    padding:5px 8px;

    font-size:8px;
    font-weight:800;
}

.crms-route-body{
    padding:17px 16px 15px;
}

.crms-route-body h3{
    font-size:18px;
    margin:0 0 4px;
}

.crms-route--featured .crms-route-body h3{
    font-size:20px;
}

.crms-route-body p{
    font-size:10px;
    color:var(--crms-muted);
    margin:0 0 13px;
}

.crms-route-link{
    border-top:1px solid var(--crms-line);
    padding-top:12px;

    display:flex;
    justify-content:space-between;
    align-items:center;

    font-size:10px;
    font-weight:800;
}

.crms-route:hover .crms-route-link{
    color:var(--crms-brand);
}

.crms-route-link span:last-child{
    font-size:15px;
    color:var(--crms-brand);
}

/* =========================
   ESTIMATE
   ========================= */

.crms-estimate{
    max-width:1180px;
    margin:44px auto 72px;

    background:#1d1e1b;
    color:#fff;

    border-top:4px solid var(--crms-brand);

    padding:27px 30px;

    display:grid;
    grid-template-columns:1.3fr 1fr auto;
    align-items:center;
    gap:26px;

    box-shadow:0 18px 38px rgba(31,27,22,.10);
}

.crms-estimate small{
    font-size:9px;
    color:#b8b5af;
}

.crms-estimate strong{
    display:block;
    font-size:22px;
    margin:3px 0;
}

.crms-estimate p{
    font-size:10px;
    color:#c7c5c0;
    margin:0;
}

.crms-estimate-steps{
    display:flex;
    gap:18px;
    font-size:9px;
    color:#d3d1cc;
}

.crms-estimate-steps span{
    display:flex;
    gap:6px;
    align-items:center;
    white-space:nowrap;
}

.crms-estimate-steps b{
    font-size:8px;
    color:#8f918c;
}

.crms-estimate-btn{
    min-height:44px;

    border:1px solid #fff;
    background:#fff;
    color:var(--crms-ink);

    padding:0 15px;

    display:flex;
    align-items:center;
    gap:18px;

    cursor:pointer;

    font-size:10px;
    font-weight:800;
}

.crms-estimate-btn:hover{
    color:var(--crms-brand);
}

/* =========================
   MODAL
   ========================= */

.crms-modal{
    position:fixed;
    inset:0;

    display:none;
    align-items:center;
    justify-content:center;

    background:rgba(0,0,0,.48);
    padding:20px;
    z-index:2000;
}

.crms-modal.is-open{
    display:flex;
}

.crms-modal-card{
    width:min(680px,100%);
    background:#fff;
    padding:24px;

    box-shadow:0 30px 90px rgba(0,0,0,.22);
}

.crms-modal-head{
    display:flex;
    align-items:start;
    justify-content:space-between;
    gap:12px;

    padding-bottom:12px;
    border-bottom:1px solid var(--crms-line);
    margin-bottom:14px;
}

.crms-modal-head h2{
    margin:0;
    font-size:21px;
}

.crms-modal-close{
    width:34px;
    height:34px;

    border:0;
    background:#f1f1ed;

    cursor:pointer;
    font-size:20px;
}

.crms-modal-close:hover{
    background:#ece7e0;
}

.crms-modal-card > p{
    font-size:12px;
    color:var(--crms-muted);
    line-height:1.9;
}

.crms-calc-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px;
    margin:14px 0;
}

.crms-calc-item{
    border:1px solid var(--crms-line);
    padding:11px 12px;
}

.crms-calc-item b{
    display:block;
    font-size:13px;
}

.crms-calc-item span{
    font-size:10px;
    color:var(--crms-muted);
}

.crms-modal-actions{
    display:flex;
    justify-content:flex-start;
}

.crms-modal-actions button{
    min-height:40px;

    border:1px solid var(--crms-ink);
    background:var(--crms-ink);
    color:#fff;

    padding:0 15px;

    cursor:pointer;
    font-weight:700;
}

/* =========================================================
   TABLET
   ========================================================= */

@media(max-width:1050px){

    .crms-intro{
        grid-template-columns:1fr;
        gap:9px;
    }

    .crms-hero{
        grid-template-columns:minmax(0,1fr) 222px;
    }

    .crms-routes{
        grid-template-columns:1fr 1fr;
    }

    .crms-route--featured{
        grid-column:1/3;
    }

    .crms-estimate{
        grid-template-columns:1fr auto;
    }

    .crms-estimate-steps{
        grid-column:1/3;
        order:3;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media(max-width:700px){

    .crms-wrap{
        padding:0 12px;
    }

    .crms-breadcrumb{
        display:none;
    }

    .crms-intro{
        display:block;
        padding:15px 0 11px;
    }

    .crms-intro h1{
        font-size:25px;
        letter-spacing:-.5px;
    }

    .crms-intro p{
        display:none;
    }

    /* HERO */

    .crms-hero{
        display:block;
        box-shadow:none;
        background:transparent;
    }

    .crms-hero-photo{
        aspect-ratio:4/3;
        box-shadow:var(--crms-shadow-1);
    }

    .crms-color-rail{
        margin-top:8px;
        padding:8px;
    }

    .crms-color-panel{
        height:auto;
        padding:11px;
        display:block;
    }

    /*
       در موبایل نمونه جداگانه درب حذف می‌شود.
       تصویر Hero خودش پیش‌نمایش اصلی است.
    */

    .crms-color-head,
    .crms-door-preview,
    .crms-color-meta > small,
    .crms-color-tip{
        display:none;
    }

    .crms-color-meta{
        padding:0;
    }

    .crms-color-title-row{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:8px;
        margin:0 0 8px;
    }

    .crms-color-title-row strong{
        font-size:18px;
    }

    .crms-state{
        font-size:8px;
        padding:3px 6px;
    }

    /* SELLABLE COLORS */

    .crms-inline-colors{
        margin-top:0;
        padding-top:9px;
    }

    .crms-inline-colors-label{
        font-size:9px;
        margin-bottom:6px;
    }

    .crms-inline-colors-grid{
        gap:5px;
    }

    .crms-inline-color{
        min-height:42px;
        grid-template-columns:32px 1fr 17px;
        padding:4px 6px;
    }

    .crms-inline-chip{
        width:32px;
        height:32px;
    }

    .crms-inline-name{
        font-size:10px;
    }

    .crms-inline-check{
        width:17px;
        height:17px;
        font-size:9px;
    }

    .crms-primary-btn{
        width:100%;
        min-height:42px;
        margin-top:8px;
        font-size:10px;
    }

    /* OTHER COLORS */

    .crms-palette{
        margin-top:10px;
        padding:12px 10px 11px;
    }

    .crms-other-head{
        margin-bottom:7px;
    }

    .crms-other-head span{
        display:none;
    }

    .crms-other-head strong{
        font-size:13px;
    }

    .crms-other-colors{
        flex-wrap:nowrap;
        overflow-x:auto;
        gap:5px;
        padding:2px 1px 5px;
        scrollbar-width:none;
    }

    .crms-other-colors::-webkit-scrollbar{
        display:none;
    }

    .crms-swatch{
        flex:0 0 28px;
        width:28px;
        height:28px;
    }

    /* PURCHASE */

    .crms-purchase{
        padding-top:38px;
    }

    .crms-purchase::before{
        width:46px;
        margin-bottom:10px;
    }

    .crms-section-head{
        margin-bottom:13px;
    }

    .crms-section-head > span,
    .crms-section-head p{
        display:none;
    }

    .crms-section-head h2{
        font-size:22px;
        margin:0;
    }

    /*
       در موبایل کارت‌ها عمداً تک‌ستونه‌اند.
       از فشردگی 2 ستونه جلوگیری می‌شود.
    */

    .crms-routes{
        display:flex;
        flex-direction:column;
        gap:10px;
    }

    .crms-route,
    .crms-route--featured{
        width:100%;
    }

    .crms-route-photo,
    .crms-route--featured .crms-route-photo{
        height:176px;
    }

    .crms-route-body{
        padding:12px 12px 11px;
    }

    .crms-route-body h3{
        font-size:16px;
        margin:0;
    }

    .crms-route-body p{
        display:none;
    }

    .crms-route-link{
        margin-top:9px;
        padding-top:9px;
    }

    /* ESTIMATE */

    .crms-estimate{
        margin:24px auto 38px;
        padding:17px;
        display:block;
    }

    .crms-estimate small,
    .crms-estimate p,
    .crms-estimate-steps{
        display:none;
    }

    .crms-estimate strong{
        font-size:18px;
        margin:0 0 11px;
    }

    .crms-estimate-btn{
        width:100%;
        justify-content:space-between;
    }

    /* MODAL */

    .crms-modal{
        padding:10px;
    }

    .crms-modal-card{
        padding:17px;
    }

    .crms-modal-card > p{
        display:none;
    }

    .crms-calc-grid{
        grid-template-columns:1fr;
    }
}
/* CRP2026 — Ready Cabinet featured card polish */
.crms-route--featured {
    border-color: #DFC3BC;
}

.crms-route--featured .crms-route-body {
    background: #F1DDD8;
}

.crms-route--featured .crms-route-link {
    color: #D31818;
}

.crms-route--featured .crms-route-badge {
    background: #D31818 !important;
    color: #fff !important;
}

/* Keep estimate section visible — only fix button text */
.crms-estimate .crms-estimate-btn,
.crms-estimate .crms-estimate-btn span {
    color: #171715 !important;
}
/* CRP2026 — Estimate modal shell polish only */
.crms-modal {
    padding: 20px !important;
    align-items: center !important;
    justify-content: center !important;
}

.crms-modal-card {
    width: min(760px, calc(100vw - 40px)) !important;
    max-height: calc(100vh - 40px) !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #fff !important;
    border-top: 3px solid #D31818 !important;
    border-bottom: 1px solid #e6e1d9 !important;
    box-shadow: 0 18px 55px rgba(0,0,0,.22) !important;
}

/* Header always visible */
.crms-modal-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: 18px 22px !important;
    margin: 0 !important;
    background: #fff !important;
    border-bottom: 1px solid #e6e1d9 !important;
}

.crms-modal-head h2 {
    margin: 0 !important;
    font-size: 19px !important;
    line-height: 1.6 !important;
}

/* Clear close button */
.crms-modal-close {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 1px solid #ddd8d0 !important;
    background: #f7f5f1 !important;
    color: #171715 !important;
    font-size: 25px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

/* Give internal content breathing room */
.crms-modal-card > div:not(.crms-modal-head):not(.crms-modal-actions),
.crms-modal-card > p,
.crms-modal-card > .crms-calc-grid {
    margin-left: 22px !important;
    margin-right: 22px !important;
}

/* Footer / bottom edge always clear */
.crms-modal-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 5 !important;
    margin-top: 20px !important;
    padding: 14px 22px !important;
    background: #fff !important;
    border-top: 1px solid #e6e1d9 !important;
}

.crms-modal-actions button {
    min-height: 42px !important;
}

/* Mobile */
@media (max-width: 700px) {
    .crms-modal {
        padding: 10px !important;
    }

    .crms-modal-card {
        width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 20px) !important;
    }

    .crms-modal-head {
        padding: 14px 15px !important;
    }

    .crms-modal-head h2 {
        font-size: 16px !important;
    }

    .crms-modal-card > div:not(.crms-modal-head):not(.crms-modal-actions),
    .crms-modal-card > p,
    .crms-modal-card > .crms-calc-grid {
        margin-left: 15px !important;
        margin-right: 15px !important;
    }

    .crms-modal-actions {
        padding: 12px 15px !important;
    }
}
/* CRP2026 — Keyboard focus visibility */
.crms-page a:focus-visible,
.crms-page button:focus-visible {
    outline: 3px solid #D31818 !important;
    outline-offset: 3px !important;
}

.crms-inline-color:focus-visible,
.crms-swatch:focus-visible {
    outline: 3px solid #D31818 !important;
    outline-offset: 2px !important;
}

.crms-route:focus-visible {
    outline: 3px solid #D31818 !important;
    outline-offset: 4px !important;
}