/* ============================================================
   SECTIONS — Full-width top/bottom lines
   ============================================================ */
.section-line {
    position: relative;
    padding: 50px 0;
}

.section-line::before,
.section-line::after {
    content: '';
    position: absolute;
    left: calc(-1 * var(--line-ext));
    right: calc(-1 * var(--line-ext));
    height: 1px;
    background: var(--line-px);
    z-index: 0;
}

.section-line::before { top: 0; }
.section-line::after { bottom: 0; }

.section-line:first-of-type::before { display: none; }
.section-line:last-of-type::after { display: none; }

.section-line .inner {
    position: relative;
    padding: 0 36px;
    z-index: 1;
}

.section-line .inner::before,
.section-line .inner::after {
    content: '';
    position: absolute;
    top: -50px;
    bottom: -50px;
    width: 1px;
    background: var(--line-px);
    z-index: 0;
}

.section-line .inner::before { left: 0; }
.section-line .inner::after { right: 0; }

.section-line .inner .dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--dot-empty);
    border: 1px solid var(--line-strong);
    z-index: 2;
}

.section-line .inner .dot.filled {
    background: var(--dot-filled);
    border-color: var(--line-strong);
}

.section-line .inner .dot.tl { top: -2.5px; left: -2.5px; }
.section-line .inner .dot.tr { top: -2.5px; right: -2.5px; }
.section-line .inner .dot.bl { bottom: -2.5px; left: -2.5px; }
.section-line .inner .dot.br { bottom: -2.5px; right: -2.5px; }

/* Section-specific tweaks */
.trust-section { padding: 16px 0; }
.trust-content { padding: 4px 0; position: relative; z-index: 1; }
.stats-section { padding: 30px 0; }
.cta-section { border-bottom: none; }
.hero-content { padding: 16px 0; position: relative; z-index: 1; }

/* ============================================================
   GRID
   ============================================================ */
.grid-cross {
    display: grid;
    gap: 0;
    position: relative;
    z-index: 1;
}

.grid-cross-2 { grid-template-columns: 1fr 1fr; }
.grid-cross-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-cross-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.grid-cross-5 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }

.grid-cross > * {
    padding: 20px 24px;
    position: relative;
    border-right: 1px solid var(--line-strong);
}

/* ستون آخر: خط لبه‌ی راست را خودِ .grid-cross می‌کشد؛
   حذف این border از دوبار کشیده شدن و پررنگ شدنِ لبه جلوگیری می‌کند */
.grid-cross > *:last-child {
    border-right-color: transparent;
}

.grid-cross > *::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line-px);
}

.grid-cross > * .cell-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--dot-empty);
    border: 1px solid var(--line-strong);
}

.grid-cross > * .cell-dot.filled {
    background: var(--dot-filled);
    border-color: var(--line-strong);
}

.grid-cross > * .cell-dot.tr { top: -2.5px; right: -2.5px; }
.grid-cross > * .cell-dot.bl { bottom: -2.5px; left: -2.5px; }
.grid-cross > * .cell-dot.br { bottom: -2.5px; right: -2.5px; }

.grid-cross > * .cell-line-h,
.grid-cross > * .cell-line-v {
    position: absolute;
    background: var(--line);
    opacity: 0.6;
    z-index: 1;
}

.grid-cross > * .cell-line-h { left: 12px; right: 12px; height: 1px; }
.grid-cross > * .cell-line-h.top { top: 25%; }
.grid-cross > * .cell-line-h.bottom { bottom: 25%; }

.grid-cross > * .cell-line-v { top: 12px; bottom: 12px; width: 1px; }
.grid-cross > * .cell-line-v.left { left: 25%; }
.grid-cross > * .cell-line-v.right { right: 25%; }

.grid-cross > * .cell-dot-inner {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--dot-empty);
    border: 1px solid var(--line);
    z-index: 2;
}

.grid-cross > * .cell-dot-inner.filled {
    background: var(--dot-filled);
    border-color: var(--line);
}

.grid-cross > * .cell-dot-inner.d1 { top: 25%; left: 25%; }
.grid-cross > * .cell-dot-inner.d2 { top: 25%; right: 25%; }
.grid-cross > * .cell-dot-inner.d3 { bottom: 25%; left: 25%; }
.grid-cross > * .cell-dot-inner.d4 { bottom: 25%; right: 25%; }

.grid-cross-3 > *:nth-child(3n),
.grid-cross-2 > *:nth-child(2n),
.grid-cross-4 > *:nth-child(4n),
.grid-cross-5 > *:nth-child(5n) { border-right: none; }

.grid-cross > *:last-child::after { display: none; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
    margin-bottom: 36px;
    position: relative;
    z-index: 1;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.section-header h2 .highlight,
.hero h1 .highlight,
.cta-box h2 .highlight,
.stat-item h4,
.process-item .num {
    /* گرادیان هر سکشن از --hl-1 / --hl-2 می‌آید (در rails.css تعریف شده) */
    background-image: linear-gradient(100deg, var(--hl-1, var(--accent)), var(--hl-2, #2d9fff));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 0.95rem;
    opacity: 0.4;
    max-width: 480px;
}

.section-header.center { text-align: center; }
.section-header.center p { margin: 0 auto; }

/* ============================================================
   GRID CROSS — complete framed cells (homepage wireframe)
   Keeps every row and column inside the section container.
   ============================================================ */
.grid-cross {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-inline-end: 1px solid var(--line-strong);
    border-block-end: 1px solid var(--line-strong);
}

.grid-cross > * {
    min-width: 0;
    box-sizing: border-box;
    border: 0 !important;
    border-inline-start: 1px solid var(--line-strong) !important;
    border-block-start: 1px solid var(--line-strong) !important;
    overflow-wrap: anywhere;
}

.grid-cross > *::after {
    display: none !important;
}

.grid-cross > *::before {
    content: '';
    position: absolute;
    z-index: 2;
    inset-block-start: -3px;
    inset-inline-start: -3px;
    width: 5px;
    height: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--dot-empty);
    pointer-events: none;
}

.grid-cross > *:first-child::before,
.grid-cross > *:nth-child(1)::before {
    background: var(--dot-filled);
}

@media (max-width: 768px) {
    .grid-cross-2,
    .grid-cross-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .grid-cross-4,
    .grid-cross-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-cross > * {
        border-inline-start: 1px solid var(--line-strong) !important;
        border-block-start: 1px solid var(--line-strong) !important;
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .grid-cross-2,
    .grid-cross-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .grid-cross-4,
    .grid-cross-5 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Try-On information grids: carry the top and bottom frame rules from the rail grid to both viewport edges. */
#services .grid-cross::before,
#services .grid-cross::after,
#expectations .grid-cross::before,
#expectations .grid-cross::after,
#process .grid-cross::before,
#process .grid-cross::after {
    content: '';
    position: absolute;
    left: 50%;
    right: auto;
    width: 100vw;
    transform: translateX(-50%);
    height: 1px;
    background: var(--line-strong);
    pointer-events: none;
    z-index: 2;
}

#services .grid-cross::before,
#expectations .grid-cross::before,
#process .grid-cross::before {
    top: 0;
}

#services .grid-cross::after,
#expectations .grid-cross::after,
#process .grid-cross::after {
    bottom: 0;
}

/* Try-On: extend the section's top and bottom rules to the viewport edges */
.core-services-section.section-line::before,
.core-services-section.section-line::after {
    left: 50%;
    right: auto;
    width: 100vw;
    transform: translateX(-50%);
}
