/* Final homepage alignment and interaction polish. */
:root {
    --am-page-gutter: 20px;
    --am-home-section-space: 48px;
}

/* Consistent 20px side gutters around the 1200px content area. */
.am-container,
.am-container--narrow,
.am-site-footer > .am-container {
    width: min(calc(100% - (var(--am-page-gutter) * 2)), 1200px);
}

/* Keep section rhythm consistent instead of stacking unrelated paddings. */
.am-home > section {
    margin: 0;
}

.am-home > section + section {
    margin-top: var(--am-home-section-space);
}

.am-home > .am-section:not(.am-trust-section) {
    padding-top: 0;
    padding-bottom: 0;
}

.am-home > .am-trust-section {
    padding: 46px 0 32px;
}

.am-home .am-section-title {
    margin-bottom: 28px;
    line-height: 1.2;
}

/* Restore natural readability where earlier exact-line-height values felt cramped. */
.am-home h1,
.am-home h2,
.am-home h3,
.am-home h4,
.am-site-footer h3 {
    line-height: 1.2;
}
.am-site-footer span {
    line-height: 1;
}
.am-button,
button.am-button,
a.am-button {
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.25;
}

.am-category-sidebar__item strong,
.am-popular-card__title,
.am-problem-card__title,
.am-product-card__title,
.am-article-card h3 {
    line-height: 1.2;
}

.am-category-sidebar__item small,
.am-hero-slide p,
.am-weekly p,
.am-product-card__rating,
.am-form-group legend,
.am-checkbox-list label,
.am-time-options label,
.am-form-note,
.am-stat span,
.am-testimonial-card p,
.am-article-card p,
.am-faq-item__answer {
    line-height: 1.35;
}

/* Language selector: click, keyboard and outside-click friendly. */
.am-language-switcher {
    position: relative;
    z-index: 500;
}

.am-language-switcher > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.am-language-flag {
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    font-size: 23px;
    line-height: 1;
    overflow: hidden;
}

.am-language-switcher__chevron {
    width: 10px;
    height: 7px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
}

.am-language-switcher.is-open .am-language-switcher__chevron {
    transform: rotate(180deg);
}

.am-language-switcher__menu[hidden] {
    display: none !important;
}

.am-language-switcher__menu:not([hidden]) {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 9px);
    right: 0;
    min-width: 112px;
    display: grid !important;
    overflow: hidden;
    border: 1px solid #D7DAD5;
    border-radius: 4px;
    padding: 4px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(40, 40, 40, .16);
}

.am-language-switcher__menu a {
    min-height: 38px;
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 8px;
    border-radius: 3px;
    padding: 7px 9px;
    color: #282828;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.am-language-switcher__menu a:hover,
.am-language-switcher__menu a:focus-visible,
.am-language-switcher__menu a.is-current {
    background: #EEF2ED;
    color: #3E5338;
}

/* Cleaner, calmer slider navigation. */
.am-hero-slider__dots {
    gap: 7px;
}

.am-hero-slider__dots button {
    width: 7px;
    height: 7px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: rgba(62, 83, 56, .32);
    box-shadow: none;
    transition: width .25s ease, background-color .25s ease, transform .25s ease;
}

.am-hero-slider__dots button::after,
.am-hero-slider__dots button.is-active::after {
    content: none;
}

.am-hero-slider__dots button:hover {
    transform: scale(1.12);
}

.am-hero-slider__dots button.is-active {
    width: 22px;
    background: #3E5338;
}

/* Consultation form button is neutral grey in both the page and popup mockups. */
.am-consultation-form .am-form-submit-row .am-button,
.am-consultation-form .am-form-submit-row .am-button:disabled {
    border-color: #D1D5DB;
    background: #F2F2F2;
    color: #686868;
    opacity: 1;
}

.am-consultation-form .am-form-submit-row .am-button:hover:not(:disabled),
.am-consultation-form .am-form-submit-row .am-button:focus-visible:not(:disabled) {
    border-color: #C5CACF;
    background: #E5E7EB;
    color: #3E5338;
    transform: none;
}

/* Consultation popup proportions and spacing. */
.am-modal {
    padding: 20px;
}

.am-modal__backdrop {
    background: rgba(24, 28, 23, .56);
    backdrop-filter: blur(2px);
}

.am-modal__dialog--consultation {
    width: min(1200px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 4px;
    padding: 40px 44px 42px;
}

.am-modal__dialog--consultation > h2 {
    margin: 0 54px 28px 0;
    color: #3E5338;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
}

.am-modal__close {
    top: 20px;
    right: 22px;
    width: 34px;
    height: 34px;
    font-size: 36px;
    line-height: 1;
}

.am-modal-consultation-grid {
    grid-template-columns: minmax(0, 544px) minmax(0, 1fr);
    gap: 24px;
}

.am-modal-consultation-grid__image {
    min-width: 0;
    overflow: hidden;
    border-radius: 4px;
}

.am-modal-consultation-grid__image img {
    width: 100%;
    height: 680px;
    min-height: 0;
    object-fit: cover;
}

.am-modal__dialog--consultation .am-consultation-form {
    gap: 10px;
}

.am-modal__dialog--consultation .am-required-note + .am-form-group,
.am-modal__dialog--consultation .am-form-group + .am-form-group {
    margin-top: 30px;
}

.am-modal__dialog--consultation .am-form-submit-row {
    margin-top: 30px;
}

.am-modal__dialog--consultation .am-form-group legend {
    line-height: 1.2;
}

/* Footer readability and exact Google review card balance. */
.am-footer-newsletter__content strong,
.am-footer-heading h3,
.am-google-card h3 {
    line-height: 1.2;
}

.am-footer-newsletter__content p,
.am-footer-contact-row,
.am-footer-menu li,
.am-footer-menu a {
    line-height: 1.35;
}

.am-newsletter-submit,
.am-footer-route,
.am-google-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.am-google-card {
    height: 194px;
    padding: 15px;
}

.am-google-card__head {
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
}

.am-google-card__head h3 {
    max-width: 225px;
    font-size: 18px;
    line-height: 1.22;
}

.am-google-card__rating-row {
    margin-top: 9px;
}

.am-google-card__button {
    width: 100%;
}

@media (max-width: 991px) {
    :root {
        --am-home-section-space: 40px;
    }

    .am-modal__dialog--consultation {
        padding: 36px 28px 32px;
    }

    .am-modal-consultation-grid {
        grid-template-columns: 42% minmax(0, 58%);
        gap: 20px;
    }

    .am-modal-consultation-grid__image img {
        height: 650px;
    }
}

@media (max-width: 767px) {
    :root {
        --am-home-section-space: 32px;
    }

    .am-home .am-section-title {
        margin-bottom: 20px;
    }

    .am-modal {
        padding: 10px;
    }

    .am-modal__dialog--consultation {
        width: 100%;
        max-height: none;
        padding: 46px 14px 20px;
    }

    .am-modal__dialog--consultation > h2 {
        margin: 0 34px 18px 0;
        font-size: 23px;
        line-height: 1.25;
    }

    .am-modal__close {
        top: 10px;
        right: 10px;
    }

    .am-modal-consultation-grid {
        display: block;
    }

    .am-modal-consultation-grid__image {
        margin-bottom: 18px;
    }

    .am-modal-consultation-grid__image img {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .am-modal__dialog--consultation .am-required-note + .am-form-group,
    .am-modal__dialog--consultation .am-form-group + .am-form-group,
    .am-modal__dialog--consultation .am-form-submit-row {
        margin-top: 26px;
    }

    .am-google-card {
        height: auto;
        min-height: 194px;
    }
}


/* AM 6.49 — homepage article cards from design. */
.am-home .am-article-card h3,
.am-nc-articles .am-article-card h3 {
    font-family: "Montserrat", Arial, sans-serif;
    font-weight: 600;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
}

.am-home .am-article-card__link,
.am-nc-articles .am-article-card__link {
    font-family: "Montserrat", Arial, sans-serif;
    font-weight: 600;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 0;
    color: #282828;
}


/* AM 6.50 — homepage article title links: exact design color and typography. */
.am-home .am-article-card h3 a,
.am-nc-articles .am-article-card h3 a {
    font-family: "Montserrat", Arial, sans-serif !important;
    font-weight: 600 !important;
    font-style: normal !important;
    font-size: 24px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    color: #3E5338 !important;
    background: transparent !important;
    text-decoration: none;
}
