/**
 * Le mag habitat & jardin — refonte page /guides
 */

:root {
    --mag-green: #1f4d2b;
    --mag-green-dark: #163a20;
    --mag-green-light: #e8f3ea;
    --mag-text: #1f2937;
    --mag-text-muted: #6b7280;
    --mag-border: #e5e7eb;
    --mag-bg: #ffffff;
    --mag-bg-soft: #f9fafb;
    --mag-radius: 18px;
    --mag-radius-sm: 14px;
    --mag-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --mag-container: 1180px;
}

/*html:has(.mag-guides-root) {
    font-size: 50.5%;
}*/

#wrapper:has(.mag-guides-root--home) .breadcrumb,
#wrapper:has(.mag-guides-root) #left-column,
#wrapper:has(.mag-guides-root) #right-column {
    display: none !important;
}

#wrapper:has(.mag-guides-root--category) .breadcrumb,
#wrapper:has(.mag-guides-root--home) .breadcrumb {
    margin-bottom: 20px;
}

#wrapper:has(.mag-guides-root) #content-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

.mag-guides-root {
    color: var(--mag-text);
    font-family: inherit;
    background: var(--mag-bg);
    margin: 0 -15px;
    padding-bottom: 72px;
}

@media (min-width: 768px) {
    .mag-guides-root {
        margin: 0;
        padding-bottom: 0;
    }
}

.mag-container {
    width: min(100% - 32px, var(--mag-container));
    margin: 0 auto;
}

.mag-card {
    background: #fff;
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
    box-shadow: var(--mag-shadow);
}

/* Header */
.mag-header {
    position: sticky;
    top: 145px;
    z-index: 90;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--mag-border);
}

.mag-header__inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0 10px;
}

.mag-logo {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    color: var(--mag-text);
    white-space: nowrap;
}

.mag-logo__brand {
    font-weight: 700;
    font-size: 1.3rem;
}

.mag-logo__brand::before {
    content: "◆ ";
    color: var(--mag-green);
    font-size: 1.3rem;
}

.mag-logo__site {
    /* color: var(--mag-text-muted);*/
    color: #08433d;
    font-size: 1.3rem;
    font-weight: 600;
}

.mag-nav--desktop {
    display: none !important;
    gap: 24px;
    align-items: center;
}

.mag-nav--desktop a {
    white-space: nowrap;
    flex: 0 0 auto;
}

.mag-nav__link {
    color: var(--mag-text-muted);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500 !important;
    position: relative;
    padding-bottom: 0px;
    transition: color 0.2s ease;
}

.mag-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--mag-green);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.mag-nav__link:hover,
.mag-nav__link.is-active {
    color: var(--mag-green);
}

.mag-nav__link:hover::after,
.mag-nav__link.is-active::after {
    transform: scaleX(1);
}

.mag-search {
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    padding: 8px 14px;
    border: 1px solid var(--mag-border);
    border-radius: 999px;
    background: var(--mag-bg-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mag-search:focus-within {
    border-color: var(--mag-green);
    box-shadow: 0 0 0 3px rgba(31, 77, 43, 0.08);
}

.mag-search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.mag-search__input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font: inherit;
    font-size: 1.1rem;
    min-width: 0;
}

.mag-search__btn {
    border: 0;
    background: transparent;
    color: var(--mag-text-muted);
    padding: 0;
    cursor: pointer;
    display: flex;
}

.mag-nav-toggle {
    display: none;
}

.mag-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--mag-text);
}

/* Nav mobile */
.mag-nav--mobile {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 16px;
    padding:0 16px 8px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type:x proximity;
}

.mag-nav--mobile::-webkit-scrollbar {
    display: none;
}

.mag-nav__link-mobile {
    flex: 0 0 auto !important;
    white-space: nowrap;
    scroll-snap-align:start;
}

.mag-nav__link-mobile.is-active {
    background: var(--mag-green);
    border-color: var(--mag-green);
    color: #fff;
    font-weight: 700;
}

.mag-nav-mobile-wrap{
    position:relative;
}


@media (min-width: 992px) {
    .mag-nav--mobile {
        display: none !important;
    }

    .mag-header__inner {
        flex-direction: row;
        align-items: center;
        gap: 32px;
        min-height: 72px;
        padding: 12px 0;
    }

    .mag-nav--desktop {
        height: 40px;
    }

    .mag-nav--desktop {
        display: flex !important;
    }

    .mag-search {
        display: flex;
        margin-left: auto;
    }
}

/* Sections */
.mag-section {
    padding: 28px 0;
}

.mag-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.mag-section__title {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    font-weight: 700;
}

#mag-section-guides-overview .mag-section__title {
    font-size: 2.5rem;
}

#mag-section-category-children .mag-section__title {
    font-size: 2.5rem;
}

.mag-section__link {
    color: var(--mag-text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    white-space: nowrap;
    font-weight: 700 !important;
}

.mag-section__link:hover {
    color: var(--mag-green);
}

/* Tags */
.mag-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.mag-tag--tendances {
    background: #fef3c7;
    color: #92400e;
}

.mag-tag--actu {
    background: #dbeafe;
    color: #1d4ed8;
}

.mag-tag--guide {
    background: #dcfce7;
    color: #166534;
}

/* Featured */
.mag-featured {
    display: grid;
    gap: 20px;
}

.mag-featured__main {
    overflow: hidden;
}

.mag-featured__media,
.mag-featured__side-media,
.mag-article-card__media {
    display: block;
    overflow: hidden;
}

.mag-featured__media img,
.mag-featured__side-media img,
.mag-article-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.12);

}

.mag-featured__media {
    aspect-ratio: 16 / 10;
}

.mag-featured__content {
    padding: 20px;
}

.mag-featured__title,
.mag-featured__side-title,
.mag-article-card__title {
    margin: 10px 0 8px;
    font-size: 1.15rem;
    line-height: 1.35;
}

.mag-featured__title a,
.mag-featured__side-title a,
.mag-article-card__title a {
    color: inherit;
    text-decoration: none;
    font-weight: 700 !important;
}

.mag-featured__excerpt,
.mag-featured__side-content p {
    color: var(--mag-text-muted);
    margin: 0 0 12px;
    line-height: 1.55;
}

.mag-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--mag-text-muted);
    font-size: 0.88rem;
}

.mag-featured__side {
    display: grid;
    gap: 16px;
}

.mag-featured__side-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    padding: 14px;
}

.mag-featured__side-media {
    border-radius: var(--mag-radius-sm);
    min-height: 96px;
}

.mag-read-more {
    color: var(--mag-green);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (min-width: 992px) {
    .mag-featured {
        grid-template-columns: 1.35fr 1fr;
        align-items: start;
    }

    .mag-featured__title {
        font-size: 1.65rem;
    }
}

/* Filters */
.mag-filters-wrap {
    padding: 8px 0 4px;
}

.mag-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.mag-filters::-webkit-scrollbar {
    display: none;
}

.mag-filter,
.mag-filter:link,
.mag-filter:visited {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid #166534 ;
    background: #fff;
    color: var(--mag-text) !important;
    text-decoration: none;
    font-size: 1.2rem;
    white-space: nowrap;
}

.mag-filter.is-active,
.mag-filter.is-active:link,
.mag-filter.is-active:visited,
.mag-filter.is-active:hover {
    background: var(--mag-green);
    border-color: var(--mag-green);
    color: #fff !important;
}

/* Univers grid */
.mag-univers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mag-univers-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 132px;
    padding: 18px 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mag-univers-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.mag-univers-card__icon {
    width: 94px;
    height: 94px;
    border-radius: 18px;
    background: var(--mag-accent, var(--mag-green-light));
}

.mag-univers-card__title {
    font-weight: 700;
    text-align: center;
    font-size: 1.2rem;
    margin-top: 15px;
}

.mag-univers-card__count {
    color: var(--mag-text-muted);
    font-size: 1rem;
}

@media (min-width: 768px) {
    .mag-univers-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .mag-univers-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Article cards */
.mag-cards-grid {
    display: grid;
    gap: 16px;
}

.mag-cards-grid--3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.mag-cards-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mag-article-card {
    overflow: hidden;
}

.mag-article-card__media {
    aspect-ratio: 4 / 3;
}

.mag-article-card__body {
    padding: 16px;
}

.mag-article-card__cat {
    margin: 0;
    color: var(--mag-text-muted);
    font-size: 0.88rem;
    font-weight: normal;
}

@media (min-width: 768px) {
    .mag-cards-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mag-cards-grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Résultats de filtrage AJAX */
.mag-filter-results {
    padding-top: 8px;
}

.mag-empty {
    color: var(--mag-text-muted);
    text-align: center;
    padding: 32px 0;
}

/* List entretien */
.mag-list {
    display: grid;
    gap: 12px;
}

.mag-list-item {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
}

.mag-list-item__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.mag-list-item__title {
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.4;
}

.mag-list-item__cat {
    color: var(--mag-text-muted);
    font-size: 1rem;
    display: none;
}

.mag-list-item__arrow {
    color: var(--mag-text-muted);
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .mag-list-item__cat {
        display: block;
    }
}

/* Placeholders */
.mag-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100%;
    position: relative;
}

.mag-placeholder::after {
    content: "";
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
}

.mag-placeholder--hero::before {
    content: "";
    position: absolute;
    bottom: 18%;
    left: 12%;
    width: 36%;
    height: 18%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

/* Icons (CSS shapes) */
.mag-icon {
    display: inline-block;
    position: relative;
}

.mag-icon--pool::after,
.mag-icon--spa::after,
.mag-icon--outdoor::after,
.mag-icon--garden::after,
.mag-icon--garden_shed::after,
.mag-icon--garden_furniture::after,
.mag-icon--outdoor_furniture::after,
.mag-icon--wood_garage::after,
.mag-icon--shed::after,
.mag-icon--bed::after,
.mag-icon--sofa::after,
.mag-icon--fitness::after,
.mag-icon--greenhouse::after,
.mag-icon--kid::after,
.mag-icon--table::after,
.mag-icon--tv_stand::after,
.mag-icon--barbecue::after,
.mag-icon--bathroom::after,
.mag-icon--pergola::after,
.mag-icon--chair::after,
.mag-icon--buffet::after,
.mag-icon--playhouse::after,
.mag-icon--child::after,
.mag-icon--swing::after,
.mag-icon--kitchen::after,
.mag-icon--air_conditioner::after,
.mag-icon--leaf::after {
    content: "";
    position: absolute;
    inset: 0%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.mag-icon--pool::after {
    background-image: url("../img/categories/pool.png");
}

.mag-icon--spa::after {
    background-image: url("../img/pictos/spa.svg");
}

.mag-icon--outdoor::after {
    background-image: url("../img/pictos/garden.svg");
}

.mag-icon--garden::after {
    background-image: url("../img/categories/garden.png");
}

.mag-icon--garden_shed::after {
    background-image: url("../img/pictos/garden.svg");
}

.mag-icon--garden_furniture::after {
    background-image: url("../img/categories/garden_furniture.png");
}

.mag-icon--outdoor_furniture::after {
    background-image: url("../img/categories/outdoor_furniture.png");
}

.mag-icon--wood_garage::after {
    background-image: url("../img/pictos/shed.svg");
}

.mag-icon--shed::after {
    background-image: url("../img/categories/shed.png");
}

.mag-icon--sofa::after {
    background-image: url("../img/categories/sofa.png");
}

.mag-icon--kid::after {
    background-image: url("../img/pictos/kid.svg");
}

.mag-icon--table::after {
    background-image: url("../img/pictos/table.svg");
}

.mag-icon--tv_stand::after {
    background-image: url("../img/pictos/tv_stand.svg");
}

.mag-icon--bed::after {
    background-image: url("../img/pictos/bed.svg");
}

.mag-icon--barbecue::after {
    background-image: url("../img/pictos/barbecue.svg");
}

.mag-icon--bathroom::after {
    background-image: url("../img/pictos/bathroom.svg");
}

.mag-icon--pergola::after {
    background-image: url("../img/categories/pergola.png");
}

.mag-icon--chair::after {
    background-image: url("../img/pictos/chair.svg");
}

.mag-icon--buffet::after {
    background-image: url("../img/pictos/buffet.svg");
}

.mag-icon--child::after {
    background-image: url("../img/categories/child.png");
}

.mag-icon--swing::after {
    background-image: url("../img/pictos/swing.svg");
}

.mag-icon--playhouse::after {
    background-image: url("../img/pictos/playhouse.svg");
}

.mag-icon--kitchen::after {
    background-image: url("../img/pictos/kitchen.svg");
}

.mag-icon--air_conditioner::after {
    background-image: url("../img/pictos/air_conditioner.svg");
}
.mag-icon--leaf::after {
    background-image: none;
    border-radius: 50%;
    inset: 30%;
    background-color: rgba(31, 77, 43, 0.35);
}

/* Newsletter */
.mag-newsletter-section {
    padding-top: 12px;
}

.mag-newsletter {
    display: grid;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, var(--mag-green) 0%, var(--mag-green-dark) 100%);
    border: 0;
    color: #fff;
}

.mag-newsletter__content {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.mag-newsletter__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.mag-newsletter__title {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.mag-newsletter__text {
    margin: 0;
    opacity: 0.9;
    font-size: 0.92rem;
}

.mag-newsletter__form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.mag-newsletter__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.mag-newsletter__input {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.12);
    color: #fff;
    border-radius: 999px;
    padding: 12px 16px;
    font: inherit;
}

.mag-newsletter__input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.mag-newsletter__btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: #fff;
    color: var(--mag-green);
    font-weight: 700;
    cursor: pointer;
}

@media (min-width: 768px) {
    .mag-newsletter {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
        padding: 28px 32px;
    }

    .mag-newsletter__form {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

/* Footer mag */
.mag-footer {
    background: var(--mag-bg-soft);
    border-top: 1px solid var(--mag-border);
    padding: 20px 0 28px;
}

.mag-footer__inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mag-footer__copy {
    margin: 0;
    color: var(--mag-text-muted);
    font-size: 0.9rem;
}

.mag-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.mag-footer__nav a {
    color: var(--mag-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .mag-footer__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Bottom mobile nav */
.mag-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--mag-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}

.mag-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--mag-text-muted);
    font-size: 0.68rem;
}

.mag-bottom-nav__item.is-active {
    color: var(--mag-green);
}

.mag-bottom-nav__icon {
    font-size: 1rem;
    line-height: 1;
}

@media (min-width: 768px) {
    .mag-bottom-nav {
        display: none;
    }
}

/* Hide legacy prestablog blocks inside mag page */
.mag-guides-root ~ #prestablog_menu_cat,
.mag-guides-root ~ h1,
#content-wrapper:has(.mag-guides-root) #prestablog_menu_cat {
    display: none !important;
}

@media (max-width: 767.98px) {

    #mag-section-univers .mag-univers-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    #mag-section-univers .mag-univers-grid::-webkit-scrollbar {
        display: none;
    }

    #mag-section-univers .mag-univers-card {
        flex: 0 0 calc((100% - 28px) / 2.5);
        scroll-snap-align: start;
    }

    #mag-section-actualites .mag-cards-grid--3 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #mag-section-actualites .mag-article-card__title,
    #mag-section-actualites .mag-article-card__title a {
        font-weight: 700 !important;
    }

    #mag-section-actualites .mag-cards-grid--3 .mag-article-card:nth-child(3n) {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }

    #mag-section-actualites .mag-cards-grid--3 .mag-article-card:nth-child(3n) .mag-article-card__media {
        flex: 0 0 96px;
        aspect-ratio: 1 / 1;
    }

    #mag-section-actualites .mag-cards-grid--3 .mag-article-card:nth-child(3n) .mag-article-card__body {
        flex: 1;
        min-width: 0;
        padding: 12px 16px;
        font-weight: 700 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    #mag-section-actualites .mag-cards-grid--3 .mag-article-card:nth-child(3n) .mag-article-card__title,
    #mag-section-actualites .mag-cards-grid--3 .mag-article-card:nth-child(3n) h3.mag-article-card__title a{
        margin: 0 0 4px;
    }

    #mag-section-tendances .mag-cards-grid--4 {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    #mag-section-tendances .mag-cards-grid--4 .mag-article-card:nth-child(n+5) {
        display: none;
    }
    #mag-section-tendances .mag-cards-grid--4::-webkit-scrollbar {
        display: none;
    }

    #mag-section-tendances .mag-cards-grid--4 .mag-article-card {
        flex: 0 0 calc((100% - 32px) / 2.5); /* 2 gaps de 16px */
        scroll-snap-align: start;
    }

    .mag-list-item {
        grid-template-columns: 48px 1fr auto;
        grid-template-areas: "icon title arrow";
        row-gap: 2px;
    }

    .mag-list-item__icon {
        grid-area: icon;
        grid-row: 1 / 3;
    }

    .mag-list-item__title {
        grid-area: title;
        grid-row: 1;
    }

    .mag-list-item__cat {
        display: block !important;
        grid-column: 2;
        grid-row: 2;
        color: var(--mag-text-muted);
        font-size: 0.85rem;
    }

    .mag-list-item__arrow {
        grid-area: arrow;
        align-self: center;
    }

}

#mag-section-univers,
#mag-section-actualites,
#mag-section-tendances,
#mag-section-entretien {
    scroll-margin-top: 230px;
}

html {
    scroll-behavior: smooth;
}

body:has(.mag-guides-root) #main-page-content {
    overflow: visible !important;
}

/* Liste des guides */
.mag-tree-section {
    border-bottom: 1px solid var(--mag-border);
    padding: 20px 0;
}

.mag-tree-section:first-of-type {
    padding-top: 0;
}

.mag-tree-section__title {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--mag-text);
    font-size: 1.3rem;
    font-weight: 700;
}

.mag-tree-section__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}

.mag-tree-section__count {
    margin-left: auto;
    color: var(--mag-text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.mag-tree-sublist {
    list-style: none;
    margin: 12px 0 0;
    padding: 0 0 0 48px;
    display: grid;
    gap: 4px;
}

.mag-tree-sublist__item a {
    display: flex;
    justify-content: space-between;
    color: var(--mag-text-muted);
    text-decoration: none;
    padding: 8px 0;
    font-size: 1.1rem;
}

.mag-tree-sublist__item a:hover {
    color: var(--mag-green);
}

.mag-tree-sublist__count {
    color: var(--mag-text-muted);
    font-size: 0.85rem;
}

/* Cartes guides */
.mag-guide-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mag-guide-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.mag-guide-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.13);
}

.mag-guide-card__body {
    padding: 16px;
    flex: 1;
}

.mag-guide-card__title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
}

.mag-guide-card__title a {
    color: var(--mag-text);
    text-decoration: none;
    font-weight: bolder !important;
}

.mag-guide-card__excerpt {
    margin: 0;
    color: var(--mag-text-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.mag-guide-card__cta {
    display: block;
    text-align: center;
    padding: 14px;
    background: #1aa6c9;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}

.mag-guide-card__cta:hover {
    background: #158aa8;
}

/* Guides Pratiques root overview: universe > subcategory > articles */
.mag-univers-grid--overview {
    margin-bottom: 12px;
}

.mag-guides-universe {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mag-guides-universe:first-of-type {
    margin-top: 32px;
}

.mag-section__head--universe {
    display: flex;
    justify-content: center;
}

.mag-guides-universe__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    font-weight: 700 !important;
}

.mag-guides-universe__title a {
    color: inherit;
    text-decoration: none;
    font-size: 30px !important;
    font-weight: 700 !important;
    font-family: 'Montserrat',Helvetica,Arial,Lucida,sans-serif;


}

.mag-guides-universe__title a:hover {
    color: var(--mag-green);
}

.mag-guides-subcategory {
    margin-top: 24px;
}

.mag-section__head--subcategory {
    margin-bottom: 14px;
}

.mag-guides-subcategory__title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--mag-text-muted);
}

.mag-guides-subcategory__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mag-guides-subcategory__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    margin-top: 30px;
}

.mag-guides-subcategory__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--mag-green);
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

.mag-guides-subcategory.is-collapsed .mag-guides-subcategory__chevron {
    transform: rotate(0deg);
}

.mag-guides-subcategory.is-collapsed .mag-guides-subcategory__content {
    display: none;
}

.mag-carousel {
    position: relative;
}

.mag-carousel__track.mag-cards-grid--3 {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

.mag-carousel__track.mag-cards-grid--3::-webkit-scrollbar {
    display: none;
}

.mag-carousel__track.mag-cards-grid--3 > .mag-guide-card {
    flex: 0 0 280px;
}

.mag-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--mag-green);
}

.mag-carousel__nav--prev { left: -8px; }
.mag-carousel__nav--next { right: -8px; }

.mag-carousel__nav:hover {
    background: var(--mag-green);
    color: #fff;
}

/* Main page title icon (Guides Pratiques, Piscines & spas...) */
.mag-category-icon,
.mag-category-icon--small {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    width: 52px;
    height: 52px;
    min-width: 32px;
    border-radius: 10px;
    background: var(--mag-accent, var(--mag-green-light));
    margin-right: 4px;
}

/* Small directional arrow on links/buttons */
.mag-arrow {
    display: inline-block;
    line-height: 1;
    font-size: 18px;
    margin-left: 2px;
    transition: transform .2s ease;
}

/* Related articles block (end of article page) */
.mag-related-articles {
    margin-top: 32px;
}

.mag-related-articles__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.mag-arrow-caret {
    display: inline-block;
    color: var(--mag-green);
}

.mag-carousel__track.is-draggable {
    cursor: grab;
    user-select: none;
}

.mag-carousel__track.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}


/* Section "Vous devriez également aimer" */
.mag-related-articles {
    margin-top: 32px;
}

.mag-related-articles__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--mag-text);
}

.mag-arrow-caret {
    color: #1aa6c9;
    margin-right: 6px;
}

/* "Vous devriez également aimer" sur une seule ligne */
.mag-related-articles .mag-cards-grid--3 {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
}

.mag-related-articles .mag-cards-grid--3 .mag-guide-card {
    flex: 0 0 calc(25% - 15px) !important;
    min-width: 280px;
}

@media (max-width: 1200px) {
    .mag-related-articles .mag-cards-grid--3 .mag-guide-card {
        flex: 0 0 calc(33.333% - 14px);
    }
}

@media (max-width: 767px) {
    .mag-related-articles .mag-cards-grid--3 .mag-guide-card {
        flex: 0 0 calc(70% - 10px); /* 1 carte + un aperçu de la suivante sur mobile */
        min-width: 240px;
    }
}

/* Grille de cartes, réutilisable ailleurs */
.mag-cards-grid {
    display: grid;
    gap: 20px;
}

.mag-cards-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.mag-guide-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (max-width: 991px) {
    .mag-cards-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .mag-cards-grid--3 {
        grid-template-columns: 1fr;
    }
}

/* Star rating widget (end of article page) */
.mag-rating {
    margin-top: 32px;
}

.mag-rating__question {
    font-weight: 400;
    font-size: 1.3rem !important;
    margin-bottom: 10px;
    margin-top: 50px;
}

.mag-rating__stars {
    display: inline-flex;
    gap: 6px;
    background: var(--mag-green-light, #eef5ee);
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 5px;
}

.mag-rating__star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.9rem;
    line-height: 1;
    color: #c9c9c9;
    padding: 0;
}

.mag-rating__star.is-active {
    color: #f5b301;
}

.mag-rating__feedback {
    margin-top: 10px;
    font-size: 1.0rem !important;
    color: var(--mag-text-muted);
    min-height: 1.2em;
}


/* Bloc "Ajouter un commentaire" */
#prestablog-comments {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--mag-border);
}

#prestablog-comments h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mag-text);
    margin: 0 0 18px;
}

#prestablog-comment {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}

#prestablog-comment .text,
#prestablog-comment .textarea {
    margin: 0;
}

#prestablog-comment input.text,
#prestablog-comment textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius-sm);
    background: var(--mag-bg-soft);
    font: inherit;
    color: var(--mag-text);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

#prestablog-comment textarea {
    min-height: 140px;
    resize: vertical;
}

#prestablog-comment input.text::placeholder,
#prestablog-comment textarea::placeholder {
    color: var(--mag-text-muted);
}

#prestablog-comment input.text:focus,
#prestablog-comment textarea:focus {
    outline: none;
    border-color: #1aa6c9;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 166, 201, 0.12);
}

#prestablog-comment input.text.errors,
#prestablog-comment textarea.errors {
    border-color: #dc2626;
    background: #fef2f2;
}

#prestablog-comment #errors {
    margin: 0;
    padding: 12px 16px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: var(--mag-radius-sm);
    font-size: 0.9rem;
}

#prestablog-comment .submit {
    margin: 4px 0 0;
}

#prestablog-comment input.btn-primary,
#submitComment {
    display: inline-block;
    padding: 14px 32px;
    border: 0;
    border-radius: 999px;
    background: #1aa6c9;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}

#prestablog-comment input.btn-primary:hover,
#submitComment:hover {
    background: #158aa8;
    transform: translateY(-1px);
}

/* Confirmation "commentaire envoyé" */
#submitOk {
    padding: 18px 20px;
    background: var(--mag-green-light);
    border-radius: var(--mag-radius-sm);
}

#submitOk h3 {
    margin: 0 0 6px;
    color: var(--mag-green-dark);
}

#submitOk p {
    margin: 0;
    color: var(--mag-text-muted);
    font-size: 0.92rem;
}

/* Liste des commentaires */
#prestablog-comments > div:not(#comments):not(#prestablog-comment-register) {
    margin: 24px 0 16px;
    font-weight: 700;
    color: var(--mag-text);
}

#comments {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

#comments .comment {
    padding: 16px 18px;
    background: var(--mag-bg-soft);
    border-radius: var(--mag-radius-sm);
    border: 1px solid var(--mag-border);
}

#comments .title_comment {
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--mag-text);
}

#comments .comment_date {
    margin-left: 8px;
    font-weight: 400;
    color: var(--mag-text-muted);
    font-size: 0.85rem;
}

#comments .comment p:last-child {
    margin: 0;
    color: var(--mag-text);
    line-height: 1.55;
}

#prestablog-comments:has(#submitOk) > h3 {
    display: none;
}

/* Masquer le bloc "Produits associés" */
#blog_product_linked {
    display: none;
}