.ms-swiper {
        overflow: hidden;
        /* ← esto es lo crítico */
        width: 100%;
    }

/* Reserve final slide geometry before Swiper starts, avoiding a large first-paint shift. */
.ms-home .ms-swiper:not(.swiper-initialized) .swiper-slide {
    width: calc((100% - 32px) / 3);
    margin-right: 16px;
}
.ms-home [id^="ms-featured-swiper-"]:not(.swiper-initialized) .swiper-slide,
.ms-home .ms-home-gallery-swiper:not(.swiper-initialized) .swiper-slide {
    width: calc((100% - 24px) / 3);
    margin-right: 12px;
}
@media (max-width: 991px) {
    .ms-home .ms-swiper:not(.swiper-initialized) .swiper-slide { width: calc((100% - 16px) / 2); }
    .ms-home [id^="ms-featured-swiper-"]:not(.swiper-initialized) .swiper-slide,
    .ms-home .ms-home-gallery-swiper:not(.swiper-initialized) .swiper-slide { width: calc((100% - 12px) / 2); }
}
@media (max-width: 575px) {
    .ms-home .ms-swiper:not(.swiper-initialized) .swiper-slide,
    .ms-home [id^="ms-featured-swiper-"]:not(.swiper-initialized) .swiper-slide,
    .ms-home .ms-home-gallery-swiper:not(.swiper-initialized) .swiper-slide { width: 100%; }
}

    .ms-swiper .swiper-wrapper {
        display: flex;
        flex-wrap: nowrap;
    }

    .ms-swiper .swiper-slide {
        flex-shrink: 0;
    }
    .swiper-button-prev:after, .swiper-rtl .swiper-button-next:after, .swiper-button-next:after, .swiper-rtl .swiper-button-prev:after {
        font-size: 15px;
        margin-left: -5px;
    }

    .swiper-button-next:after, .swiper-rtl .swiper-button-prev:after {
        margin-left: 5px;
    }

    .ms-home button.ms-carousel-btn:not(:disabled) {
        border: none;
        background-color: #fff;
        margin-left: 14px;
    }

    .ms-carousel-btn:hover {
        background-color: #eee !important;
    }

    .ms-home button.ms-carousel-btn:not(:disabled){
        margin-right: 14px;
    }

/* ── Home page ─────────────────────────────────────────────── */
.ms-home {
    padding: 36px 48px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    /* centering */
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    align-self: center;
}

/* Hero card */
.ms-hero-card {
    background:
        radial-gradient(120% 140% at 0% 0%, var(--ms-accent) 0%, var(--ms-accent-strong) 55%, #053f5e 100%);
    border-radius: var(--ms-r-lg);
    display: flex;
    align-items: center;
    padding: 44px 52px;
    gap: 44px;
    min-height: 260px;
    box-shadow: var(--ms-shadow-md);
    position: relative;
    overflow: hidden;
}
/* Subtle depth so the panel isn't a flat block of color */
.ms-hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 80% at 85% 20%, rgba(255,255,255,0.14), transparent 70%);
    pointer-events: none;
}

.ms-hero-text {
    flex: 1;
    color: #fff;
    position: relative;
    z-index: 1;
}

.ms-hero-title {
    font-family: var(--ms-font-display);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #fff;
}

.ms-hero-desc {
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.88);
    margin: 0;
    max-width: 420px;
}

.ms-hero-image-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    max-width: 52%;
    position: relative;
    z-index: 1;
}

.ms-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--ms-r-md);
    box-shadow: 0 10px 30px rgba(5, 40, 60, 0.35);
}

.ms-hero-img-placeholder {
    width: 100%;
    height: 280px;
    background: rgba(255,255,255,0.12);
    border-radius: 16px;
}

/* Recent images section */
.ms-recent-section {
    display: flex;
    align-items: center;
    gap: 40px;
}

.ms-recent-label {
    flex-shrink: 0;
    width: 200px;
}

.ms-recent-title {
    font-family: var(--ms-font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--ms-text);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

.ms-recent-carousel-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    padding: 0 28px;
}

/* Carousel layout */
.ms-carousel-row {
    display: flex;
    gap: 16px;
}

.ms-carousel-img-wrap {
    flex: none;
    min-width: 0;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #dde5f0;
}

.ms-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Carousel controls */
.ms-carousel-btn {
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.10);
    border-radius: 50%;
    top: 42%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}
.ms-carousel-btn:hover { background: rgba(0,0,0,0.20); }
.ms-carousel-prev { left: -8px; }
.ms-carousel-next { right: -8px; }
.ms-carousel-btn i { font-size: 18px; color: #333; }

/* Dots */
.ms-carousel-dots {
    position: relative;
    bottom: auto;
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.ms-carousel-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    margin: 0;
}
.ms-carousel-dots button.active { background: var(--ms-accent); }

.ms-no-images { color: #999; font-size: 14px; padding: 20px; }

/* ── Featured galleries section ─────────────────────────────── */
.ms-featured-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.ms-featured-heading {
    font-size: 2rem;
    font-weight: 800;
    color: #111;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
}

/* One row per collection: label + carousel */
.ms-featured-row {
    display: flex;
    align-items: center;
    gap: 40px;
}

.ms-featured-label {
    flex-shrink: 0;
    width: 180px;
}

.ms-featured-col-name {
    font-size: 1rem;
    font-weight: 800;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.3;
    display: block;
    text-decoration: none;
}
.ms-featured-col-name:hover { color: #2d3b8e; }

.ms-featured-slide-link { display: block; }
.ms-featured-slide-link:hover .ms-featured-img { opacity: .88; transform: scale(1.02); }

.ms-featured-carousel-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    padding: 0 28px;
}

/* Slides */
.ms-featured-slide {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ms-featured-img {
    width: 100%;
    aspect-ratio: 4/3;
    transition: opacity .2s, transform .2s;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.ms-featured-img-caption {
    font-size: 0.82rem;
    color: #2d3b8e;
    text-align: center;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty state */
.ms-featured-empty {
    padding: 0 0 20px;
}

.ms-featured-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f0f2f8;
    border-radius: 12px;
    aspect-ratio: 4/3;
    color: #999;
    font-size: 0.9rem;
    max-width: 340px;
}

.ms-featured-placeholder-icon {
    font-size: 2rem;
    font-style: normal;
}

/* ── Mobile (≤ 767px) ───────────────────────────────────────── */
@media (max-width: 767px) {
    .ms-home {
        padding: 20px 16px 20px;
        gap: 28px;
    }

    /* Hero: stack vertically */
    .ms-hero-card {
        flex-direction: column;
        padding: 28px 24px;
        gap: 24px;
        border-radius: 16px;
    }
    .ms-hero-title { font-size: 2rem; }
    .ms-hero-image-wrap { max-width: 100%; width: 100%; margin: 0 -24px -28px; }
    .ms-hero-img { height: 220px; border-radius: 0 0 16px 16px; }

    /* Recent: stack vertically */
    .ms-recent-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .ms-recent-label { width: 100%; min-height: auto; }
    .ms-recent-title { font-size: 1.75rem; }

    /* Carousel: 1 image per slide */
    .ms-recent-carousel-wrap { padding: 0 36px; width: 100%; box-sizing: border-box; }
    .ms-carousel-img-wrap:nth-child(2),
    .ms-carousel-img-wrap:nth-child(3) { display: none; }
    .ms-carousel-img-wrap { border-radius: 10px; }
    .ms-carousel-btn { top: 38%; }
    .ms-carousel-prev { left: -4px; }
    .ms-carousel-next { right: -4px; }

    /* Featured: stack vertically */
    .ms-featured-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .ms-featured-label { width: 100%; }
    .ms-featured-carousel-wrap { width: 100%; box-sizing: border-box; padding: 0 36px; }
    .ms-featured-heading { font-size: 1.5rem; }
}

/* ── Tablet (768px – 1024px) ────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1024px) {
    .ms-home { padding: 28px 32px; gap: 32px; }
    .ms-hero-card { padding: 36px 40px; gap: 32px; }
    .ms-hero-title { font-size: 2.4rem; }
    .ms-recent-title { font-size: 1.9rem; }
    .ms-recent-label { width: 160px; }
    .ms-featured-label { width: 140px; }
}
