.services-index-page,
.service-detail-page {
    background: #f9f8f6;
    color: #35261a;
}

.services-page-shell,
.service-detail-shell {
    padding: 118px 0 72px;
}

.service-detail-shell > .container,
.services-page-shell > .container,
.service-pages-wrap {
    max-width: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.services-page-title,
.service-detail-header {
    padding-bottom: 28px;
    text-align: center;
}

.services-page-title h1,
.service-detail-header h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #000000 !important;
    margin-bottom: 0;
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif !important;
    font-weight: 400 !important;
    letter-spacing: 0.08em;
}

.services-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.services-card {
    display: block;
    text-decoration: none;
    background: #f9f8f6;
    border: 1px solid rgba(139, 69, 19, 0.06);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(139, 69, 19, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.services-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(139, 69, 19, 0.1);
}

.services-card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
    padding: 16px;
    background: #f9f8f6;
}

.services-card span {
    display: block;
    padding: 14px 16px 16px;
    font-size: 1rem;
    color: #3f2f22 !important;
    text-align: center;
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif !important;
}

.service-detail-copy {
    max-width: 980px;
    margin-bottom: 26px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.service-detail-copy p {
    font-size: 1rem;
    line-height: 1.95;
    color: #564334 !important;
}

.service-page[data-layout="entryway"],
.service-page[data-layout="bookcases"],
.service-page[data-layout="bathroom"] {
    max-width: 1460px;
    margin: 0 auto;
}

.service-pager-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 26px;
}

.pager-btn {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: 50%;
    background: #f9f8f6;
    color: #1a1a1a;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(139, 69, 19, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.pager-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(139, 69, 19, 0.08);
}

.pager-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pager-dots {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(139, 69, 19, 0.08);
}

.pager-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.14);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.pager-dot.active {
    background: #111111;
    transform: scale(1.25);
}

.service-pages {
    position: relative;
}

.service-page {
    display: none;
    background: #f9f8f6;
    border: 1px solid rgba(139, 69, 19, 0.08);
    border-radius: 28px;
    padding: 34px 32px 30px;
    box-shadow: 0 16px 34px rgba(139, 69, 19, 0.06);
}

.service-page.active {
    display: block;
}

.service-art-title {
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif !important;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 400 !important;
    color: #000000 !important;
    letter-spacing: 0.12em;
    text-align: center;
    margin-bottom: 18px;
}

.service-description {
    max-width: 980px;
    margin: 0 auto 26px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.95;
    color: #564334 !important;
}

.service-gallery {
    --service-media-height: clamp(172px, 16vw, 220px);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    max-width: min(1320px, 100%);
    margin: 0 auto;
}

.service-page[data-layout="entryway"] .service-gallery,
.service-page[data-layout="bookcases"] .service-gallery,
.service-page[data-layout="bathroom"] .service-gallery {
    max-width: min(1400px, 100%);
}

.media-card {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    height: var(--service-media-height);
    max-width: 100%;
    aspect-ratio: var(--service-card-aspect, 4 / 3);
    background: transparent;
    border: none;
    border-radius: 20px;
    padding: 0;
    box-shadow: none;
    display: block;
    overflow: hidden;
    line-height: 0;
    cursor: zoom-in;
}

.media-card.media-video {
    --service-card-aspect: 16 / 9;
    cursor: default;
}

.gallery-row {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: nowrap;
}

.gallery-row:last-child {
    margin-bottom: 0;
}

.gallery-row.is-landscape .media-card,
.gallery-row.is-video .media-card {
    max-width: 851px;
    min-height: 358px;
}

.gallery-row.is-portrait .media-card {
    flex: 0 1 403px;
    max-width: 403px;
    min-height: 470px;
}

.gallery-row.is-portrait.single .media-card {
    flex-basis: 403px;
}

.gallery-row.is-landscape.single .media-card,
.gallery-row.is-video.single .media-card {
    flex: 0 1 760px;
}

.gallery-row.triple-portraits .media-card {
    flex: 0 1 358px;
    max-width: 358px;
    min-height: 493px;
    height: 493px;
}

.gallery-row.entryway-pairs .media-card {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
    min-height: 0;
    height: auto;
    align-items: flex-start;
}

.gallery-row.entryway-hero .media-card {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
}

.gallery-row.entryway-hero img {
    display: block;
    width: auto !important;
    height: 566px !important;
    max-width: none !important;
    margin: 0 auto;
}

.gallery-row.entryway-triple .media-card {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
    min-height: 0;
    height: auto;
    align-items: flex-start;
}

.gallery-row.entryway-triple img {
    display: block;
    width: auto !important;
    height: 370px !important;
    max-width: none !important;
    margin: 0 auto;
}

.gallery-row.pair-portraits .media-card {
    flex: 0 1 526px;
    max-width: 526px;
    min-height: 560px;
    height: 560px;
}

.gallery-row.bookcases-feature .media-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
}

.gallery-row.bookcases-feature .media-card:first-child {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-height: 0;
    height: auto;
}

.gallery-row.bookcases-feature .media-card:last-child {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-height: 0;
    height: auto;
}

.gallery-row.pair-portraits.enlarged .media-card {
    flex-basis: 470px;
    max-width: 470px;
    min-height: 526px;
}

.gallery-row.bathroom-balanced {
    align-items: stretch;
    flex-wrap: nowrap;
}

.gallery-row.bathroom-balanced .media-card {
    min-height: 0;
    height: auto;
    align-items: flex-start;
}

.gallery-row.bathroom-balanced .media-card:nth-child(1),
.gallery-row.bathroom-balanced .media-card:nth-child(3) {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

.gallery-row.bathroom-balanced .media-card:nth-child(2) {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

.gallery-row.no-frame .media-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
}

.gallery-row.fixed-three,
.gallery-row.fixed-two,
.gallery-row.bathroom-balanced.fixed-three {
    flex-wrap: nowrap;
}

.gallery-row.entryway-pairs img {
    display: block;
    width: auto !important;
    height: 470px !important;
    max-width: none !important;
    margin: 0 auto;
}

.gallery-row.triple-portraits.fixed-three img,
.gallery-row.pair-portraits.fixed-two img,
.gallery-row.bookcases-feature.fixed-two img,
.gallery-row.bathroom-balanced.fixed-three img {
    width: auto;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
}

.gallery-row.bookcases-feature.fixed-two img {
    display: block;
    width: auto !important;
    height: 470px !important;
    max-width: none !important;
}

.gallery-row.bathroom-balanced.fixed-three img {
    display: block;
    width: auto !important;
    height: 457px !important;
    max-width: none !important;
}

.gallery-row.video-small .media-card {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-height: 0;
    height: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
}

.gallery-row.video-small video {
    display: block;
    width: 582px !important;
    height: 327px !important;
}

.media-card img,
.media-card video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(17, 12, 8, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 3000;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    width: auto;
    max-width: min(94vw, 1600px);
    max-height: 90vh;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(32, 22, 14, 0.7);
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
}

.service-media-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 130px;
    gap: 14px;
}

.service-media-card {
    grid-column: span 4;
    overflow: hidden;
    border-radius: 20px;
    background: #f9f8f6;
    border: 1px solid rgba(139, 69, 19, 0.06);
    box-shadow: 0 10px 24px rgba(139, 69, 19, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.service-media-card.hero {
    grid-column: span 8;
    grid-row: span 3;
}

.service-media-card.tall {
    grid-column: span 4;
    grid-row: span 3;
}

.service-media-card.wide {
    grid-column: span 8;
    grid-row: span 2;
}

.service-media-card.medium {
    grid-column: span 4;
    grid-row: span 2;
}

.service-media-card img,
.service-media-card video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f8f5ef;
}

@media (max-width: 960px) {
    .service-gallery {
        --service-media-height: clamp(160px, 22vw, 196px);
        gap: 10px;
        max-width: 100%;
    }

    .gallery-row.is-landscape .media-card,
    .gallery-row.is-video .media-card {
        max-width: 762px;
        min-height: 314px;
    }

    .gallery-row.is-portrait .media-card {
        flex-basis: 336px;
        max-width: 336px;
        min-height: 403px;
    }

    .gallery-row.triple-portraits .media-card {
        flex-basis: 291px;
        max-width: 291px;
        min-height: 414px;
        height: 414px;
    }

    .gallery-row.entryway-pairs .media-card {
        width: auto;
        max-width: none;
    }

    .gallery-row.entryway-hero img {
        height: 493px !important;
    }

    .gallery-row.entryway-triple img {
        height: 325px !important;
    }

    .gallery-row.pair-portraits .media-card {
        flex-basis: 426px;
        max-width: 426px;
        min-height: 482px;
        height: 482px;
    }

    .gallery-row.bookcases-feature .media-card:first-child {
        width: auto;
        max-width: none;
    }

    .gallery-row.bookcases-feature .media-card:last-child {
        width: auto;
        max-width: none;
    }

    .gallery-row.pair-portraits.enlarged .media-card {
        flex-basis: 381px;
        max-width: 381px;
        min-height: 459px;
    }

    .gallery-row.bathroom-balanced .media-card:nth-child(1),
    .gallery-row.bathroom-balanced .media-card:nth-child(3) {
        width: auto;
        max-width: none;
    }

    .gallery-row.bathroom-balanced .media-card:nth-child(2) {
        width: auto;
        max-width: none;
    }

    .gallery-row.video-small .media-card {
        width: auto;
        max-width: none;
    }

    .gallery-row.entryway-pairs img {
        height: 403px !important;
    }

    .gallery-row.bookcases-feature.fixed-two img {
        height: 403px !important;
    }

    .gallery-row.bathroom-balanced.fixed-three img {
        height: 385px !important;
    }

    .gallery-row.video-small video {
        width: 484px !important;
        height: 271px !important;
    }

    .service-page[data-layout="entryway"],
    .service-page[data-layout="bookcases"],
    .service-page[data-layout="bathroom"] {
        max-width: 1478px;
    }

    .services-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 180px;
    }

    .service-media-card,
    .service-media-card.hero,
    .service-media-card.tall,
    .service-media-card.wide,
    .service-media-card.medium {
        grid-column: span 1;
        grid-row: span 1;
    }

    .service-media-card.hero,
    .service-media-card.wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .service-pager-controls {
        gap: 10px;
    }

    .pager-dots {
        gap: 8px;
        padding: 10px 12px;
    }

    .service-page {
        padding: 24px 18px 22px;
        border-radius: 22px;
    }

    .service-art-title {
        letter-spacing: 0.08em;
    }

    .service-gallery {
        --service-media-height: clamp(168px, 50vw, 198px);
        gap: 10px;
    }

    .media-card {
        max-width: calc(100vw - 36px);
    }

    .gallery-row {
        flex-direction: column;
        align-items: center;
    }

    .gallery-row.is-portrait .media-card,
    .gallery-row.is-landscape .media-card,
    .gallery-row.is-video .media-card {
        flex-basis: auto;
        max-width: 100%;
        width: 100%;
        min-height: 240px;
    }

    .gallery-row.triple-portraits .media-card,
    .gallery-row.entryway-pairs .media-card,
    .gallery-row.entryway-hero .media-card,
    .gallery-row.entryway-triple .media-card,
    .gallery-row.pair-portraits .media-card,
    .gallery-row.bookcases-feature .media-card,
    .gallery-row.pair-portraits.enlarged .media-card,
    .gallery-row.bathroom-balanced .media-card:nth-child(1),
    .gallery-row.bathroom-balanced .media-card:nth-child(2),
    .gallery-row.bathroom-balanced .media-card:nth-child(3),
    .gallery-row.video-small .media-card {
        max-width: 100%;
        width: 100%;
        min-height: 240px;
        height: auto;
    }

    .media-card img,
    .media-card video {
        height: 100%;
    }

    .lightbox {
        padding: 0;
    }

    .services-page-shell,
    .service-detail-shell {
        padding: 108px 0 56px;
    }

    .service-detail-shell > .container,
    .services-page-shell > .container,
    .service-pages-wrap {
        padding-left: 0;
        padding-right: 0;
    }

    .services-card-grid {
        grid-template-columns: 1fr;
    }

    .services-card img {
        height: 224px;
    }

    .service-media-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .service-media-card,
    .service-media-card.hero,
    .service-media-card.tall,
    .service-media-card.wide,
    .service-media-card.medium {
        grid-column: span 1;
        grid-row: span 1;
    }

    .service-media-card img,
    .service-media-card video {
        height: 269px;
    }
}
