.hpc-section {
  /* Scoped design tokens copied from the site's Kadence variables */
  --global-palette1: #2B6CB0;
  --global-palette2: #215387;
  --global-palette3: #222222;
  --global-palette4: #3B3B3B;
  --global-palette5: #515151;
  --global-palette6: #626262;
  --global-palette7: #E1E1E1;
  --global-palette8: #F7F7F7;
  --global-palette9: #ffffff;

  --global-content-width: 1290px;
  --global-content-edge-padding: 1.5rem;
  --kb-default-row-gutter: 2rem;

  --global-kb-font-size-md: 1.25rem;
}

.hpc-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.hpc-aside { text-align: center; display: flex; flex-direction: column; column-gap: var(--global-kb-gap-sm, 1rem); border-top: 2px solid #f0b429; position: relative; }
.hpc-grid-cards { grid-auto-rows: minmax(200px, auto); contain: layout paint; }
.right { text-align: right; }
.hpc-iso { margin: 0 4px 6px 0; opacity: .8; }
.hpc-item .hpc-line { display: block; margin: .25rem 0 .25rem !important; text-align: center; font-size: var(--global-kb-font-size-md, 1.25rem); font-weight: 400; line-height: 1.2; }
.hpc-lines { display: grid; row-gap: 1px; }
.hpc-lines.hpc-lines--multi { row-gap: 1px; margin-top: .25rem; margin-bottom: .25rem; }
.hpc-lines.hpc-lines--multi .hpc-line { margin: 0; line-height: 1; }
.hpc-percent { font-weight: 600; white-space: nowrap; }
.hpc-nowrap { white-space: nowrap; }
.hpc-line .hpc-percent { font-weight: 400; }
.hpc-link a { text-decoration: underline; }
/* Kadence-like link style: underline via 1px background line, no fill on hover */
.hpc-section .hpc-link a {
    color: var(--global-palette-highlight);
    text-decoration: none; /* убираем нативное подчёркивание, оставляем 1px линию фоном */
    text-underline-offset: .1em;
    transition: color .1s linear, background-size .1s linear;
    background-color: transparent;
    background-image: linear-gradient(var(--global-palette-highlight), var(--global-palette-highlight));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 100% 1px; /* толщина линии */
}
.hpc-section .hpc-link a:hover,
.hpc-section .hpc-link a:focus,
.hpc-section .hpc-link a:active {
    color: var(--global-palette-highlight-alt2);
    text-decoration: none;
    text-underline-offset: .1em;
    background-size: 100% 100%;
}

/* Inline link in single-line discount row (donor-like hover background underline/fill) */
.hpc-section a.hpc-link-inline {
    color: var(--global-palette-highlight);
    text-decoration: none;
    text-underline-offset: .1em;
    transition: color .1s linear, background-size .1s linear;
    background-color: transparent;
    background-image: linear-gradient(var(--global-palette-highlight), var(--global-palette-highlight));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 100% 1px;
}
.hpc-section a.hpc-link-inline:hover,
.hpc-section a.hpc-link-inline:focus,
.hpc-section a.hpc-link-inline:active {
    color: var(--global-palette-highlight-alt2);
    text-decoration: none;
    background-size: 100% 100%;
}

/* Responsive layout for aside + cards */
@media (max-width: 1024px) {
  .hpc-layout { grid-template-columns: 1fr; }
  .hpc-aside { margin-bottom: 8px; }
}
.hpc-section.alignfull { position: relative; padding-left: 0; padding-right: 0; padding-bottom: var(--global-kb-spacing-xs, 1rem); margin-bottom: 0; }
.hpc-section.alignfull::before { content: ""; position: absolute; inset: 0; left: 0; right: 0; background: var(--global-palette8, #F7F7F7); z-index: -1; }
.hpc-wrap { max-width: var(--global-content-width, 1290px); margin: 0 auto; padding: var(--global-kb-spacing-xs, 1rem) var(--global-content-edge-padding, 1.5rem); }
.hpc-heading { text-align: center; margin-bottom: .5rem; }
.hpc-title { margin: 0 0 .25rem; }
.hpc-intro { margin: 0 0 1rem; line-height: 1.2; }
.hpc-grid {
    display: grid;
    column-gap: var(--global-kb-gap-sm, 1rem);
    row-gap: var(--global-kb-gap-sm, 1rem);
}


.hpc-cols-4 { grid-template-columns: repeat(4, 1fr); }
.hpc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.hpc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.hpc-cols-1 { grid-template-columns: 1fr; }

@media (max-width: 1200px) {
  .hpc-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
  .hpc-cols-4, .hpc-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .hpc-cols-4, .hpc-cols-3, .hpc-cols-2 { grid-template-columns: 1fr; }
}

.hpc-item {
    background: rgb(187 151 4 / .1);
    border: 1px solid #e3d8c7;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
    margin-bottom: 0;
    /* Neutralize theme margins inside the card */
    --global-md-spacing: 0 !important;
    padding-bottom: var(--global-kb-spacing-xs, 1rem);
    position: relative;
}

/* Override Kadence theme paragraph spacing inside cards with higher specificity */
.hpc-item p {
    margin: 0 !important;
}

/* Infobox variant */
.hpc-item.hpc-infobox { background: var(--global-palette9, #ffffff); border: 1px solid var(--global-palette7, #E1E1E1); }
.hpc-infobox-title { font-weight: 600; margin: .5rem .75rem 0; }
.hpc-infobox-desc { margin: .25rem .75rem; color: var(--global-palette4, #3B3B3B); }
.hpc-infobox-links { margin: .5rem .75rem; }
.hpc-infobox-links .hpc-infobox-link { margin-right: .5rem; text-decoration: underline; }

.hpc-headline {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
}

.hpc-flagline { text-align: right; margin: 0; font-size: .9rem; }
.hpc-flag.small { width: 16px; height: 12px; aspect-ratio: 4 / 3; vertical-align: text-bottom; line-height: 0; }
/* Global flag is square (1:1), not rectangular like country flags */
.hpc-flag.small[src*="global.svg"] { aspect-ratio: 1 / 1; height: 16px; }
.hpc-flag-zoom { transition: transform .15s ease; }
.hpc-flag-zoom:hover { transform: scale(1.2); }
.center { text-align: center; }
.small { font-size: .9rem; }
.xsmall { font-size: .75rem; }

.hpc-flags { display: flex; gap: .5rem; align-items: center; margin-bottom: .25rem; }
.hpc-flag { width: 20px; height: 15px; aspect-ratio: 4 / 3; display: inline-block; line-height: 0; }

/* Compact counter after flags */
.hpc-more-flags { font-size: .7em !important; }

/* Ensure counter is smaller even when .small sets a base size */
.hpc-flagline .hpc-more-flags { font-size: .7em !important; }

.hpc-code { display: block; font-weight: 700; font-size: var(--global-kb-font-size-md, 1.25rem); margin: .35rem 0 0; letter-spacing: .3px; font-family: var(--global-heading-font-family, inherit); }

/* Code centered variant to match example */
.hpc-code.center {
    padding-top: 0;
    margin-top: 0;
    text-align: center;
    font-size: var(--global-kb-font-size-md, 1.25rem);
    font-weight: 400;
    font-family: inherit;
}

/* When multiple discount lines follow the code, reduce the gap to match hpc-lines row-gap */
.hpc-code + .hpc-line { margin-top: 1px; }


.hpc-desc { margin: .25rem 0 .25rem !important; font-size: var(--global-kb-font-size-md, 1.25rem); }
.hpc-item .hpc-note { color: #555; margin: .25rem 0 .25rem !important; }
.hpc-item .hpc-countries { color: #555; margin: .25rem 0 .25rem !important; }
.hpc-countries.center.small { line-height: 1.2; }
.hpc-item .hpc-until { color: #555; margin: .25rem 0 .25rem !important; font-size: 12px; }

.hpc-actions { margin-top: .5rem; }
.hpc-btn {
    display: block;
    color: var(--global-palette3, #1A202C);
    background: var(--global-palette9, #ffffff);
    border-radius: 5px;
    border: 1px solid var(--global-palette7, #EDF2F7);
    padding: var(--global-kb-spacing-xxs, .5rem);
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    text-decoration: none;
    font-size: .9rem;
    width: 150px;
    margin-left: auto; /* гарантируем центрирование по умолчанию */
    margin-right: auto;
    box-shadow: 1px 1px 2px 0 rgb(0 0 0 / .2);
}

/* Скрываем кнопку, если есть активный таймер */
.hpc-item:has(.hpc-countdown-box[data-start-ts]) .hpc-btn {
    display: none !important;
}

.hpc-btn:hover,
.hpc-btn:focus {
    color: var(--global-palette9, #ffffff);
    background: #e8902a;
    box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.4);
}

/* Center action button without wrapper */
.hpc-item .hpc-btn,
.hpc-btn.center {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}


.hpc-last-used { margin-top: .5rem; text-align: right; font-size: .7rem; color: #555; }

/* Flag zone */
.hpc-flagline.right {
    padding-right: .5rem;
    margin-top: 0;
    margin-bottom: 0;
    text-align: right;
    font-size: var(--global-kb-font-size-sm, .9rem);
    min-height: 1.5rem;
}

/* Flags collapsible */
/* Legacy single icon toggle (kept for compatibility) */
.hpc-flags-toggle { box-sizing: border-box; width: 18px; height: 18px; line-height: 18px; border-radius: 50%; border: 1px solid #ccc; background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-right: .35rem; vertical-align: middle; padding: 0; }
.hpc-flags-toggle .hpc-toggle-icon { display: inline-block; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-right: 6px solid #666; }
.hpc-flags-toggle[aria-expanded="true"] .hpc-toggle-icon { transform: rotate(180deg); }

/* New combined button: arrow + label */
.hpc-flags-toggle-btn { display: inline-flex; align-items: center; gap: .35rem; background: transparent; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.hpc-flags-toggle-btn:focus,
.hpc-flags-toggle-btn:active,
.hpc-flags-toggle-btn[aria-expanded="true"] { color: inherit; background: transparent; outline: none; box-shadow: none; }
.hpc-flags-toggle-btn .hpc-more-flags-label { font-size: .7em; }
.hpc-flags-toggle-btn .hpc-toggle-icon { box-sizing: border-box; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #ccc; background: #fff; display: inline-flex; align-items: center; justify-content: center; transition: transform .2s ease; }
.hpc-flags-toggle-btn .hpc-toggle-icon::before { content: ''; display: block; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-right: 6px solid #666; }
.hpc-flags-toggle-btn[aria-expanded="true"] .hpc-toggle-icon { transform: rotate(180deg); }

.hpc-flags-toggle-wrap { display: inline-flex; align-items: center; gap: .35rem; position: relative; }
.hpc-flags-collapsible { position: absolute; right: calc(100% + .35rem); top: 50%; transform: translateY(-50%); width: 0; overflow: hidden; white-space: nowrap; transition: width .25s ease; }
.hpc-flags-collapsible.open { width: 200px; }

/* Контейнер для кода промокода с бейджем */
.hpc-code-wrap {
    position: relative;
}

/* Контейнер для плашек - размещаем их рядом */
.hpc-badges-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: .5rem .75rem .25rem .75rem;
    flex-wrap: wrap;
}

/* Бейдж слева от промокода */
.hpc-badges-wrap.hpc-badges-left {
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    margin: 0;
    justify-content: flex-start;
    align-items: flex-start;
    z-index: 1;
}

.hpc-badges-wrap.hpc-badges-left .hpc-soon-badge {
    text-align: left;
}

/* Плашка "Скоро" - оранжевый/желтый цвет для отличия (уменьшенный размер) */
.hpc-soon-badge {
    display: inline-block;
    background: #ff9800;
    color: #fff;
    padding: 0.1rem 0.2rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin: 0;
}

/* Кастомный бейдж - зеленый цвет */
.hpc-custom-badge {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    padding: 0.1rem 0.2rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin: 0;
}

/* Таймер обратного отсчета - как box с border (из promo-herb-calendar) */
.hpc-countdown-box {
    display: inline-block;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: .5rem auto 0;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .hpc-countdown-box {
        width: calc(100% - 1rem);
        margin-left: auto;
        margin-right: auto;
        padding: 0.4rem 0.6rem;
    }
}

.hpc-countdown-box.center {
    display: block;
    text-align: center;
}

.hpc-countdown-label {
    display: block;
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hpc-countdown-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #4CAF50;
    font-variant-numeric: tabular-nums;
}

