/* Програма лояльності: кабінет «Мої переваги», попап, блок «Запроси друга», бонуси на оформленні. */
:root {
    --loy-green: #3E5338;
    --loy-green-dark: #32452d;
    --loy-green-mid: #6D8965;
    --loy-soft: #D9DFD7;
    --loy-pale: #f4f5f3;
    --loy-line: #E5E7EB;
    --loy-text: #282828;
    --loy-muted: #686868;
    --loy-olive: #84866f;
    --loy-red: #B90101;
}

.am-loy { color: var(--loy-text); font-family: Montserrat, sans-serif; }
.am-loy *, .am-loy-promo *, .am-loy-popup * { box-sizing: border-box; }
.am-loy-head h2 { margin: 4px 0 18px; font-size: 24px; font-weight: 600; line-height: 1.25; }
.am-loy-eyebrow { margin: 0; color: var(--loy-muted); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.am-loy-muted { margin: 12px 0 0; color: var(--loy-muted); font-size: 14px; line-height: 1.5; }
.am-loy-title { margin: 26px 0 12px; font-size: 18px; font-weight: 600; }
.am-loy-link { display: inline-block; margin-top: 12px; color: var(--loy-green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.am-loy-ok { margin: 10px 0 0; color: var(--loy-green); font-weight: 600; }
.am-loy-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 4px; background: #fbeaea; color: var(--loy-red); font-size: 14px; }

/* Підсумок: рівень + бонуси */
.am-loy-summary { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; }
.am-loy-summary > div { display: flex; flex-direction: column; gap: 2px; min-height: 120px; padding: 18px 20px; border-radius: 8px; }
.am-loy-summary__level { background: var(--loy-green); color: #fff; }
.am-loy-summary__level span { color: var(--loy-soft); font-size: 14px; }
.am-loy-summary__level strong { margin-top: auto; font-size: 34px; font-weight: 600; line-height: 1.1; }
.am-loy-summary__level small { color: #e9eee7; font-size: 14px; }
.am-loy-summary__bonus { border: 1px solid var(--loy-line); background: #fff; }
.am-loy-summary__bonus span { color: var(--loy-muted); font-size: 14px; }
.am-loy-summary__bonus strong { margin-top: auto; font-size: 34px; font-weight: 600; line-height: 1.1; }
.am-loy-summary__bonus strong.is-negative, .am-loy-wallet strong.is-negative { color: var(--loy-red); }
.am-loy-summary__bonus small { color: var(--loy-muted); font-size: 14px; }

/* Вкладки */
.am-loy-tabs { display: flex; gap: 6px; margin: 20px 0 16px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: thin; }
.am-loy-tabs a { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--loy-line); border-radius: 4px; background: #fff; color: var(--loy-text); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.am-loy-tabs a:hover { border-color: var(--loy-green-mid); }
.am-loy .am-loy-tabs a { color: var(--loy-text) !important; text-decoration: none !important; }
.am-loy .am-loy-tabs a.is-active { border-color: var(--loy-green); background: var(--loy-green); color: #fff !important; }
.am-loy a.am-loy-link, .am-loy .am-loy-list a, .am-loy .am-loy-steps a { color: var(--loy-green) !important; }

.am-loy-card { margin-bottom: 14px; padding: 20px; border: 1px solid var(--loy-line); border-radius: 8px; background: #fff; }
.am-loy-card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; line-height: 1.3; }
.am-loy-card p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }

/* Рівень */
.am-loy-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 16px; margin: -20px -20px 18px; padding: 20px; border-radius: 8px 8px 0 0; background: var(--loy-green); color: #fff; }
.am-loy-hero__label { grid-column: 1 / -1; color: var(--loy-soft); font-size: 14px; }
.am-loy-hero__pct { font-size: 30px; font-weight: 600; line-height: 1.15; }
.am-loy-hero__total { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.am-loy-hero__total span { color: #e9eee7; font-size: 13px; }
.am-loy-hero__total b { font-size: 20px; font-weight: 600; white-space: nowrap; }

.am-loy-scale__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.am-loy-scale__head b { color: var(--loy-muted); font-weight: 500; }
.am-loy-scale__track { position: relative; height: 10px; border-radius: 6px; background: #efefed; overflow: hidden; }
.am-loy-scale__track span { position: absolute; inset: 0 auto 0 0; width: var(--loy-progress); border-radius: 6px; background: var(--loy-olive); transition: width .4s; }
.am-loy-scale__points { display: grid; grid-template-columns: repeat(var(--loy-steps), minmax(0, 1fr)); gap: 4px; margin: 12px 0 0; padding: 0; list-style: none; }
.am-loy-scale__points li { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.am-loy-scale__points i { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--loy-line); border-radius: 50%; background: #fff; color: var(--loy-text); font-size: 13px; font-style: normal; font-weight: 600; }
.am-loy-scale__points li.is-reached i { border-color: var(--loy-green); background: var(--loy-green); color: #fff; }
.am-loy-scale__points li.is-current i { box-shadow: 0 0 0 3px var(--loy-soft); }
.am-loy-scale__points strong { max-width: 100%; font-size: 13px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.am-loy-scale__points small { color: var(--loy-muted); font-size: 12px; white-space: nowrap; }
.am-loy-next { display: flex; flex-direction: column; gap: 4px; margin: 18px 0 0 !important; }
.am-loy-next strong { font-size: 17px; font-weight: 600; }
.am-loy-next span { color: var(--loy-muted); font-size: 14px; }

/* Огляд: список переваг */
.am-loy-list { margin: 0; padding: 0; border: 1px solid var(--loy-line); border-radius: 8px; background: #fff; list-style: none; }
.am-loy-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--loy-line); }
.am-loy-list li:first-child { border-top: 0; }
.am-loy-list__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--loy-pale); font-size: 16px; }
.am-loy-list strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.am-loy-list span:not(.am-loy-list__icon) { display: block; margin-top: 2px; color: var(--loy-muted); font-size: 14px; line-height: 1.4; }
.am-loy-list a { color: var(--loy-green); font-size: 14px; font-weight: 600; white-space: nowrap; }
.am-loy-badge { display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-style: normal; font-weight: 600; }
.am-loy-badge.is-ok { background: var(--loy-green); color: #fff; }
.am-loy-badge.is-wait { background: #fdf3dd; color: #8a5a00; }
.am-loy-badge.is-done { background: var(--loy-soft); color: var(--loy-green-dark); }
.am-loy-badge.is-off { background: #efefed; color: var(--loy-muted); }

/* Мої бонуси */
.am-loy-wallet__top strong { display: block; margin: 4px 0; font-size: 30px; font-weight: 600; }
.am-loy-wallet__top span { color: var(--loy-muted); font-size: 14px; }
.am-loy-facts { display: grid; gap: 8px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--loy-line); }
.am-loy-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.am-loy-facts dt { color: var(--loy-muted); }
.am-loy-facts dd { margin: 0; font-weight: 600; text-align: right; }
.am-loy-ways { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.am-loy-ways li { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border-radius: 6px; background: var(--loy-pale); font-size: 14px; line-height: 1.45; }
.am-loy-ways b { color: var(--loy-green); font-size: 18px; font-weight: 700; text-align: center; }
.am-loy-birthday__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.am-loy-birthday { background: linear-gradient(180deg, var(--loy-pale), #fff 70%); }
.am-loy-steps { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.am-loy-steps a { color: var(--loy-green); font-weight: 600; }
.am-loy-google__form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.am-loy-google__form input, .am-loy-ref__link input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #282828; border-radius: 4px; background: #fff; color: var(--loy-text); font: 400 15px/1.3 Montserrat, sans-serif; }
.am-loy-google__form .am-button, .am-loy-ref__link .am-button { min-height: 50px; padding: 0 18px; white-space: nowrap; }

/* Історія */
.am-loy-history { display: grid; border: 1px solid var(--loy-line); border-radius: 6px; overflow: hidden; }
.am-loy-history__row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 140px 90px; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--loy-line); font-size: 14px; }
.am-loy-history__row:first-child { border-top: 0; }
.am-loy-history__row--head { background: var(--loy-pale); color: var(--loy-muted); font-size: 13px; font-weight: 600; }
.am-loy-history__row small { display: block; color: var(--loy-muted); font-size: 12px; }
.am-loy-history__row strong { text-align: right; white-space: nowrap; }
.am-loy-history__row strong.is-plus { color: var(--loy-green); }
.am-loy-history__row strong.is-minus { color: var(--loy-red); }
.am-loy-pager { display: flex; justify-content: space-between; margin-top: 12px; }
.am-loy-pager a { color: var(--loy-green); font-weight: 600; }

/* Реферали */
.am-loy-ref__link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.am-loy-ref__code { margin: 10px 0 0 !important; font-size: 14px !important; }
.am-loy-ref__code button { border: 0; background: none; color: var(--loy-green); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.am-loy-share { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.am-loy-share a, .am-loy-share button { padding: 9px 14px; border: 1px solid var(--loy-line); border-radius: 4px; background: #fff; color: var(--loy-text); font: 500 14px/1.2 Montserrat, sans-serif; text-decoration: none; cursor: pointer; }
.am-loy-share a:hover, .am-loy-share button:hover { border-color: var(--loy-green); color: var(--loy-green); }
.am-loy-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.am-loy-stats div { padding: 14px; border-radius: 6px; background: var(--loy-pale); }
.am-loy-stats small { display: block; color: var(--loy-muted); font-size: 13px; line-height: 1.3; }
.am-loy-stats strong { display: block; margin-top: 6px; font-size: 24px; font-weight: 600; }
.am-loy-ref h4 { margin: 20px 0 10px; font-size: 16px; }

/* Блок «Запроси друга» */
.am-loy-promo { margin: 0 0 18px; color: var(--loy-text); font-family: Montserrat, sans-serif; }
.am-loy-promo__dark { padding: 28px 24px 24px; border-radius: 12px; background: var(--loy-green); color: #fff; text-align: center; }
.am-loy-promo__eyebrow { margin: 0 0 8px; color: var(--loy-soft); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.am-loy-promo__dark h2 { margin: 0 0 10px; color: #fff; font-size: 26px; font-weight: 600; line-height: 1.25; }
.am-loy-promo__dark > p:not(.am-loy-promo__eyebrow) { max-width: 640px; margin: 0 auto 18px; color: #eef2ec; font-size: 15px; line-height: 1.5; }
.am-loy-promo__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.am-loy-promo__cards div { display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; border-radius: 10px; background: #f4f5f3; color: var(--loy-green-dark); }
.am-loy-promo__cards b { font-size: 30px; font-weight: 700; }
.am-loy-promo__cards strong { font-size: 18px; font-weight: 600; }
.am-loy-promo__cards span { color: var(--loy-muted); font-size: 13px; line-height: 1.4; }
.am-loy-promo__cta { display: block; margin-top: 12px; padding: 15px 18px; border-radius: 8px; background: var(--loy-soft); color: var(--loy-green-dark); font-weight: 600; text-decoration: none; }
.am-loy-promo__cta:hover { background: #fff; }
.am-loy-promo h3 { margin: 26px 0 12px; font-size: 20px; font-weight: 600; }
.am-loy-promo__steps { display: grid; gap: 0; margin: 0; padding: 4px 18px; border: 1px solid var(--loy-line); border-radius: 10px; background: #fff; counter-reset: loy; list-style: none; }
.am-loy-promo__steps li { position: relative; padding: 14px 0 14px 40px; border-top: 1px solid var(--loy-line); counter-increment: loy; }
.am-loy-promo__steps li:first-child { border-top: 0; }
.am-loy-promo__steps li::before { content: counter(loy); position: absolute; left: 0; top: 14px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--loy-green); color: #fff; font-size: 13px; font-weight: 600; }
.am-loy-promo__steps strong { display: block; font-size: 16px; font-weight: 600; }
.am-loy-promo__steps span { display: block; margin-top: 4px; color: var(--loy-muted); font-size: 14px; line-height: 1.5; }

/* Підписки */
.am-loy-subs > p.am-loy-muted:first-child { margin-top: 0; }

/* Попап */
.am-loy-popup { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 16px; }
.am-loy-popup[hidden] { display: none; }
.am-loy-popup__backdrop { position: absolute; inset: 0; background: rgba(25, 35, 24, .55); }
.am-loy-popup__box { position: relative; width: min(440px, 100%); padding: 30px 26px 22px; border-radius: 12px; background: #fff; color: var(--loy-text); text-align: center; box-shadow: 0 18px 50px rgba(25, 35, 24, .28); font-family: Montserrat, sans-serif; }
.am-loy-popup__close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; background: none; color: var(--loy-muted); font-size: 28px; line-height: 1; cursor: pointer; }
.am-loy-popup__eyebrow { margin: 0 0 6px; color: var(--loy-muted); font-size: 13px; }
.am-loy-popup__pct { margin: 0; color: var(--loy-green); font-size: 56px; font-weight: 700; line-height: 1; }
.am-loy-popup h2 { margin: 6px 0 10px; font-size: 22px; font-weight: 600; }
.am-loy-popup__text { margin: 0 0 18px; color: #4f4f4f; font-size: 15px; line-height: 1.5; }
.am-loy-popup__accept { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; }
.am-loy-popup__done { margin: 0; padding: 12px; border-radius: 6px; background: var(--loy-soft); color: var(--loy-green-dark); font-weight: 600; line-height: 1.4; }
.am-loy-popup__note { margin: 12px 0 0; color: var(--loy-muted); font-size: 12px; }
body.am-loy-popup-open { overflow: hidden; }

/* Оформлення: бонуси і знижка програми */
.am-loy-checkout-offer { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 10px; padding: 10px 12px; border-radius: 6px; background: var(--loy-soft); color: var(--loy-green-dark); font-size: 14px; font-weight: 500; }
.am-loy-checkout-offer strong { white-space: nowrap; }
.am-bonus-redeem { margin: 12px 0; padding: 14px; border: 1px solid var(--loy-line); border-radius: 8px; background: #fff; }
.am-bonus-redeem__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.am-bonus-redeem__head span { color: var(--loy-muted); }
.am-bonus-redeem__toggle { position: relative; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.am-bonus-redeem__toggle input { position: absolute; opacity: 0; }
.am-bonus-redeem__box { flex: 0 0 20px; width: 20px; height: 20px; border: 1px solid #282828; border-radius: 3px; background: #fff; }
.am-bonus-redeem__toggle input:checked + .am-bonus-redeem__box { border-color: var(--loy-green); background: var(--loy-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5 8.5 14 15 6.5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center / 16px no-repeat; }
.am-bonus-redeem__toggle input:focus-visible + .am-bonus-redeem__box { outline: 2px solid var(--loy-green); outline-offset: 2px; }
.am-bonus-redeem__amount { margin-top: 10px; }
.am-bonus-redeem__amount[hidden] { display: none; }
.am-bonus-redeem__amount input[type="range"] { width: 100%; accent-color: var(--loy-green); }
.am-bonus-redeem__input { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 14px; }
.am-bonus-redeem__input input { width: 110px; min-height: 40px; padding: 0 10px; border: 1px solid #282828; border-radius: 4px; font: 500 16px/1 Montserrat, sans-serif; }
.am-bonus-redeem__note { margin: 10px 0 0; color: var(--loy-muted); font-size: 12px; line-height: 1.4; }

/* Особисті дані: примітка до дати народження */
.am-loy-bday-note { display: block; grid-column: 1 / -1; margin: -2px 0 6px; color: var(--loy-muted); font-size: 12px; line-height: 1.4; }
.flatpickr-calendar { font-family: Montserrat, sans-serif; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { border-color: var(--loy-green); background: var(--loy-green); }
.flatpickr-day.today { border-color: var(--loy-green-mid); }

@media (max-width: 767px) {
    .am-loy-head h2 { font-size: 20px; }
    .am-loy-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
    .am-loy-summary > div { min-height: 104px; padding: 14px; }
    .am-loy-summary__level strong, .am-loy-summary__bonus strong { font-size: 26px; }
    .am-loy-summary small, .am-loy-summary span { font-size: 12px !important; }
    .am-loy-card { padding: 16px; }
    .am-loy-hero { grid-template-columns: 1fr; margin: -16px -16px 16px; padding: 16px; }
    .am-loy-hero__total { flex-direction: row; justify-content: space-between; align-items: baseline; text-align: left; }
    .am-loy-hero__pct { font-size: 26px; }
    .am-loy-scale__points i { width: 34px; height: 34px; font-size: 11px; }
    .am-loy-scale__points strong { font-size: 11px; }
    .am-loy-scale__points small { font-size: 10px; white-space: normal; }
    .am-loy-list li { grid-template-columns: 28px minmax(0, 1fr); padding: 14px; }
    .am-loy-list li > a { grid-column: 2; }
    .am-loy-google__form { grid-template-columns: 1fr; }
    .am-loy-ref__link { grid-template-columns: 1fr; }
    .am-loy-stats { grid-template-columns: 1fr; }
    .am-loy-stats div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .am-loy-stats strong { margin: 0; font-size: 20px; }
    .am-loy-history__row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
    .am-loy-history__row--head { display: none; }
    .am-loy-history__row > span:nth-child(1) { grid-column: 1; color: var(--loy-muted); font-size: 12px; }
    .am-loy-history__row > span:nth-child(2) { grid-column: 1; }
    .am-loy-history__row > span:nth-child(3) { grid-column: 1; color: var(--loy-muted); font-size: 12px; }
    .am-loy-history__row > strong { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
    .am-loy-promo__dark { padding: 22px 16px 16px; }
    .am-loy-promo__dark h2 { font-size: 21px; }
    .am-loy-promo__cards { gap: 8px; }
    .am-loy-promo__cards b { font-size: 24px; }
    .am-loy-promo__cards strong { font-size: 15px; }
    .am-loy-promo__steps { padding: 2px 14px; }
    .am-loy-popup__pct { font-size: 46px; }
}

@media (max-width: 380px) {
    .am-loy-summary { grid-template-columns: 1fr; }
    .am-loy-promo__cards { grid-template-columns: 1fr; }
    .am-loy-scale__points i { width: 30px; height: 30px; }
}

.am-loy .am-loy-share a { color: var(--loy-text) !important; text-decoration: none !important; }
.am-loy .am-loy-share a:hover { color: var(--loy-green) !important; }

/* Вузькі екрани: точки шкали — список (назви й відсотки без переносу посеред слова). */
@media (max-width: 560px) {
    .am-loy-scale__points { grid-template-columns: 1fr; gap: 0; margin-top: 14px; }
    .am-loy-scale__points li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--loy-line); text-align: left; }
    .am-loy-scale__points li:first-child { border-top: 0; }
    .am-loy-scale__points i { width: 38px; height: 38px; font-size: 12px; }
    .am-loy-scale__points strong { font-size: 14px; overflow-wrap: normal; }
    .am-loy-scale__points small { font-size: 12px; white-space: nowrap; }
}
@media (min-width: 768px) {
    .am-loy-bday-note { margin-top: 26px; }
}
