/* Casa Modesta - Unified Desktop Layout (1000px max width) */
@media (min-width: 900px) {
    .cm-homepage-wrapper,
    .cm-sleek-single-product,
    .cm-hall-of-queens-wrapper,
    .cm-master-account-wrapper {
        max-width: 1000px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .cm-sp-pill.cm-global-reviews-pill {
        max-width: 680px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 34px !important;
        clear: both !important;
    }

    /* 4-Columns on Desktop (1000px width) - Eliminates card stretching in New Arrivals, Shop & Single Product */
    ul.products,
    .woocommerce ul.products,
    .cm-related-pill ul.products,
    .cm-sleek-single-product .cm-related-pill ul.products,
    .cm-2x2-panel-slide,
    .cm-campaign-products-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Big cards: 3-line readable title; Parent aisle cards: single-line marquee */
    .cm-home-card .cm-grid-title {
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        white-space: normal !important;
        word-break: break-word !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        height: 42px !important;
        line-height: 14px !important;
        margin: 4px 0 2px 0 !important;
        font-size: 11.5px !important;
        font-weight: 700 !important;
        text-align: center !important;
    }

    .cm-naked-aisle-pill .cm-home-card .cm-grid-title,
    .cm-aisle-swiper .cm-home-card .cm-grid-title {
        display: block !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: initial !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: clip !important;
        height: 18px !important;
        line-height: 18px !important;
        margin: 4px 0 2px 0 !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        text-align: center !important;
    }

    /* Equal Product Card Dimensions Across Sections */
    ul.products li.product,
    .woocommerce ul.products li.product,
    .cm-2x2-panel-slide .cm-home-card,
    .cm-campaign-products-grid .cm-home-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    /* Unified Image Heights on Desktop for All Product Cards */
    .cm-home-card img.cm-grid-img,
    .cm-home-card img.cm-naked-img,
    .cm-related-pill li.product img,
    .cm-campaign-products-grid img,
    ul.products li.product img {
        width: 100% !important;
        height: 180px !important;
        max-height: 180px !important;
        object-fit: cover !important;
        border-radius: 12px !important;
        margin-bottom: 8px !important;
    }

    /* Inner Hall of Queens content uses full width */
    .cm-hall-of-queens-wrapper .cm-queen-showcase-container,
    .cm-hall-of-queens-wrapper .cm-queen-competitors-pill,
    .cm-hall-of-queens-wrapper .cm-sp-pill {
        max-width: 1000px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Hall of Queens Wall Grid - 5 columns on desktop */
    .cm-hall-of-queens-wrapper .cm-wall-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 22px 16px !important;
    }

    /* Queen of the Week Headline Crown Alignment */
    .cm-queen-headline-wrap {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .cm-queen-headline-title {
        margin: 0 !important;
        display: inline-block !important;
    }

    /* Single Product Editorial Column (matches 680px Reviews width so Attributes & Stock sit tightly while Related stays 1000px 4-up) */
    .cm-sleek-single-product .cm-hero-group,
    .cm-sleek-single-product .cm-bnpl-pill,
    .cm-sleek-single-product .cm-action-row-locked,
    .cm-sleek-single-product .cm-trust-pill,
    .cm-sleek-single-product .cm-desc-pill {
        max-width: 680px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
}
