/* Home page (/): one consistent vertical rhythm and full-width sections.
   Scoped to body.page-is-index, so no other page is affected.

   1. Every home section gets the same small padding above and below and no outer margin, so the gap
      between two sections is always the same (it used to be a mix of margins, bootstrap p-/mt- utilities
      and 70px wrapper paddings that added up).
   2. Sections that sat in a fixed-width ".container" or in a "col-xl-10" column (empty space left and
      right) now use the full width, like the hero and the shop sections. */

body.page-is-index {
    --home-gap: 8px;
    --home-side: 8px;
}

@media (min-width: 768px) {
    body.page-is-index {
        --home-gap: 14px;
        --home-side: clamp(12px, 2vw, 32px);
    }
}

/* ----- 1. Vertical rhythm ----- */
body.page-is-index :is(
    .home-hero-section,
    .home-shop-products-section,
    .home-promo-banners-section,
    .ast_wedo_wrapper,
    .ast_bannertext_wrapper,
    .ast_shop_wrapper,
    .recent-products,
    .Home_faq,
    .section-spacing:not(.d-none),
    main section:not([class])
) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: var(--home-gap) !important;
    padding-bottom: var(--home-gap) !important;
}

/* the horoscope and banner blocks sit in plain wrappers: keep their inner spacing from adding to the gap */
body.page-is-index .ast_wedo_wrapper .zodiac-cta-card {
    margin-bottom: 0 !important;
}

/* ----- 2. Full width ----- */
body.page-is-index :is(
    .home-hero-section,
    .home-shop-products-section,
    .home-promo-banners-section,
    .ast_wedo_wrapper,
    .ast_bannertext_wrapper,
    .recent-products,
    .Home_faq,
    .section-spacing,
    main section:not([class])
) > :is(.container, .container-fluid) {
    width: 100%;
    max-width: 1920px;
    padding-left: var(--home-side);
    padding-right: var(--home-side);
}

body.page-is-index :is(
    .ast_wedo_wrapper,
    .ast_bannertext_wrapper,
    .Home_faq,
    .section-spacing,
    section.d-none.d-lg-block
) > .container-fluid > .row > [class*="col-xl-10"] {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

/* ----- 3. Section headings: compact, same size everywhere ----- */
body.page-is-index :is(.ast_wedo_wrapper, .ast_bannertext_wrapper, .Home_faq, .section-spacing, .ast_shop_wrapper, main section:not([class])) .premium-section-header {
    margin: 0 0 10px !important;
    padding: 0 !important;
}

body.page-is-index :is(.ast_wedo_wrapper, .ast_bannertext_wrapper, .Home_faq, .section-spacing, .ast_shop_wrapper, main section:not([class])) .premium-section-header .premium-headline {
    margin: 0;
    font-size: clamp(1.35rem, 3.4vw, 1.85rem);
    line-height: 1.2;
}

body.page-is-index :is(.ast_wedo_wrapper, .ast_bannertext_wrapper, .Home_faq, .section-spacing, .ast_shop_wrapper, main section:not([class])) .premium-section-header .header-divider {
    gap: 8px;
    margin: 4px 0 6px;
}

body.page-is-index :is(.ast_wedo_wrapper, .ast_bannertext_wrapper, .Home_faq, .section-spacing, .ast_shop_wrapper, main section:not([class])) .premium-section-header .premium-subline {
    margin: 4px auto 0;
    font-size: .85rem;
    line-height: 1.4;
}

/* ----- "View All" button under the Astro Shopping and Consult Astrologer sliders ----- */
.home-viewall-wrap {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.home-viewall-wrap .home-viewall-btn,
.home-viewall-card .home-viewall-btn {
    padding: 7px 22px;
    border: 0;
    background: linear-gradient(135deg, #710000, #a00);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(113, 0, 0, .2);
}

.home-viewall-wrap .home-viewall-btn:hover,
.home-viewall-card .home-viewall-btn:hover {
    color: #d4af37;
}

/* closing card of a home slider on phones: compact, only as tall as its content */
.home-viewall-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1.5px dashed rgba(113, 0, 0, .35);
    border-radius: 14px;
    background: linear-gradient(135deg, #fff8e8 0%, #fff 60%, #fdf1f1 100%);
    text-align: center;
}

.home-viewall-card__sub {
    font-size: .8rem;
    color: #6b5a45;
}

/* ----- Home "Astro Shopping": product cards in the same box + slider as "Consult Astrologer" ----- */
.home-products-swiper {
    width: 100%;
    padding: 10px 4px 18px;
    position: relative;
}

.home-products-swiper .swiper-slide {
    display: flex;
    height: auto;
}

.home-products-swiper .ast_product_section {
    width: 100%;
    height: 100%;
    margin: 0 !important;
}

.home-products-swiper .swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 10px;
}

.home-products-swiper .swiper-pagination .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    background: #d1c7b7;
    opacity: .6;
    transition: all .2s ease;
}

.home-products-swiper .swiper-pagination .swiper-pagination-bullet-active {
    width: 18px;
    border-radius: 6px;
    background: #710000;
    opacity: 1;
}

@media (max-width: 575px) {
    .home-products-swiper {
        padding: 4px 2px 10px;
    }

    .home-products-swiper .swiper-pagination {
        margin-top: 6px;
    }

    .home-products-swiper .swiper-pagination .swiper-pagination-bullet {
        width: 5px;
        height: 5px;
    }
}

/* ==========================================================================
   Home sliders (Astro Shopping + Consult Astrologer), see DataJS/Comman/JS_StackSlider.js
   - phones: pages of 4 stacked rows, swiped sideways, with dots
   - tablet / desktop: no slider, every card is shown directly in a grid
   ========================================================================== */
.stack-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: auto;
}

.stack-item {
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .home-products-swiper .swiper-wrapper,
    #consultAstrologerSlides[data-max-cards] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        width: auto;
        height: auto;
        transform: none !important;
    }

    .home-products-swiper .swiper-wrapper > .swiper-slide,
    #consultAstrologerSlides[data-max-cards] > .swiper-slide {
        width: auto !important;
        margin: 0 !important;
        min-width: 0;
    }

    /* no slider here, so no dots */
    .home-products-swiper .swiper-pagination,
    .swiper:has(> #consultAstrologerSlides[data-max-cards]) .swiper-pagination {
        display: none;
    }

    /* Consult Astrologer: the first 8 cards */
    #consultAstrologerSlides[data-max-cards] > .swiper-slide:nth-child(n + 9),
    .swiper-wrapper > .swiper-slide:has(> .home-viewall-card) {
        display: none;
    }
}

@media (min-width: 992px) {
    .home-products-swiper .swiper-wrapper,
    #consultAstrologerSlides[data-max-cards] {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
    }
}

/* ----- Home "Consult Astrologer" grid: tablet 2 per row, laptop / desktop 3, extra-large screens 4 ----- */
@media (min-width: 768px) {
    #consultAstrologerSlides[data-max-cards] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    #consultAstrologerSlides[data-max-cards] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* 3 per row: show 9 cards (3 full rows) */
    #consultAstrologerSlides[data-max-cards] > .swiper-slide:nth-child(n + 9):not(:has(> .home-viewall-card)) {
        display: block;
    }

    #consultAstrologerSlides[data-max-cards] > .swiper-slide:nth-child(n + 10) {
        display: none;
    }
}

@media (min-width: 1400px) {
    #consultAstrologerSlides[data-max-cards] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* 4 per row: show 8 cards (2 full rows) */
    #consultAstrologerSlides[data-max-cards] > .swiper-slide:nth-child(n + 9) {
        display: none;
    }
}

/* ----- Home zodiac intro card ("Get your personalized zodiac sign ..."): compact, smaller type ----- */
.zodiac-cta-card--merged {
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    margin-bottom: 10px !important;
}

.zodiac-cta-card--merged .zodiac-cta-eyebrow {
    margin-bottom: 6px;
    padding: 2px 10px;
    font-size: .72rem;
}

.zodiac-cta-card--merged .zodiac-cta-title {
    margin-bottom: 4px;
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    line-height: 1.25;
}

.zodiac-cta-card--merged .zodiac-cta-text {
    margin-bottom: 10px;
    font-size: .85rem;
    line-height: 1.4;
}

.zodiac-cta-card--merged .zodiac-cta-actions {
    gap: 8px;
}

.zodiac-cta-card--merged .zodiac-cta-actions .btn,
.zodiac-cta-card--merged .zodiac-cta-shop .btn {
    padding: 6px 16px;
    font-size: .85rem;
    line-height: 1.4;
}

.zodiac-cta-card--merged .zodiac-cta-shop {
    padding: 12px 14px;
    border-radius: 14px;
}

.zodiac-cta-card--merged .zodiac-cta-shop__icon {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    font-size: .9rem;
}

.zodiac-cta-card--merged .zodiac-cta-shop h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    line-height: 1.25;
}

.zodiac-cta-card--merged .zodiac-cta-shop p {
    margin: 0 0 8px;
    font-size: .8rem;
    line-height: 1.35;
}

@media (min-width: 992px) {
    .zodiac-cta-card--merged {
        padding: 18px 24px;
        gap: 24px;
    }
}

@media (max-width: 575px) {
    .zodiac-cta-card--merged {
        padding: 12px;
        border-radius: 14px;
    }

    /* the two buttons share one row instead of two full-width ones */
    .zodiac-cta-card--merged .zodiac-cta-actions .btn {
        flex: 1 1 calc(50% - 4px);
        padding: 6px 8px;
        font-size: .8rem;
        white-space: nowrap;
    }

    .zodiac-cta-card--merged .zodiac-cta-shop {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px 10px;
        padding: 10px 12px;
        text-align: left;
    }

    .zodiac-cta-card--merged .zodiac-cta-shop__icon {
        margin: 0;
    }

    .zodiac-cta-card--merged .zodiac-cta-shop h3 {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
        font-size: .9rem;
    }

    .zodiac-cta-card--merged .zodiac-cta-shop p {
        display: none;
    }

    .zodiac-cta-card--merged .zodiac-cta-shop .btn {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* ----- Home horoscope sign ribbon: Hindi name under the English one; one line on PC / large screens ----- */
body.page-is-index #horoscopeRashiList li a .rashi-hi {
    display: block;
    margin-top: 1px;
    color: #6b7280;
    font-size: .7rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

body.page-is-index #horoscopeRashiList li a.active .rashi-hi {
    color: rgba(255, 255, 255, .85);
}

/* the labels are already Hindi when the site is in Hindi */
body.page-is-index #horoscopeRashiList.rashi-ribbon--hi .rashi-hi {
    display: none;
}

@media (min-width: 992px) {
    body.page-is-index #horoscopeRashiList {
        gap: 6px !important;
        overflow-x: visible !important;
    }

    /* the 12 signs share the row width, so none of them needs scrolling to */
    body.page-is-index #horoscopeRashiList li {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
    }

    body.page-is-index #horoscopeRashiList li a {
        padding: 8px 2px 6px !important;
        border-radius: 10px !important;
    }

    body.page-is-index #horoscopeRashiList li a img {
        width: 40px !important;
        height: 40px !important;
        margin: 0 0 3px !important;
    }

    body.page-is-index #horoscopeRashiList li a span {
        font-size: .78rem !important;
        line-height: 1.2;
    }
}

/* ----- Sign ribbon layout (the base rule in zodiac-shop.css is a grid: 6 columns, 12 from 1400px, 3 on phones) ----- */
@media (min-width: 992px) {
    /* laptop and large screens: all 12 signs in one line */
    body.page-is-index #horoscopeRashiList.Horoscopereport-2 {
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }
}

@media (max-width: 767.98px) {
    /* phones: all 12 signs, 4 per row (3 rows), no "View all" step */
    body.page-is-index #horoscopeRashiList.Horoscopereport-2 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    body.page-is-index #horoscopeRashiList.Horoscopereport-2:not(.is-open) li:nth-child(n + 7):not(:has(a.active)) {
        display: block !important;
    }

    body.page-is-index div:has(> #rashiRibbonToggle) {
        display: none !important;
    }

    body.page-is-index #horoscopeRashiList li a {
        padding: 6px 2px 5px !important;
    }

    body.page-is-index #horoscopeRashiList li a img {
        width: 34px !important;
        height: 34px !important;
        margin-bottom: 3px !important;
    }

    body.page-is-index #horoscopeRashiList li a span {
        font-size: .72rem !important;
    }

    body.page-is-index #horoscopeRashiList li a .rashi-hi {
        font-size: .64rem;
    }
}
