/* Акції магазину: список акцій, шапка сторінки акції, блок у картці товару. Кольори — з теми oct_deals. */
:root {
    --sp-accent: var(--ds-primary-color, #00A8E8);
    --sp-green: #2E9F3E;
    --sp-green-bg: #EAF7EC;
    --sp-text: #1d2433;
    --sp-muted: #7a8291;
    --sp-border: #e7eaf0;
    --sp-surface: #fff;
    --sp-soft: #f5f7fa;
}

.sp-page-title { margin: 4px 0 16px; font-size: 28px; font-weight: 700; color: var(--sp-text); }

/* ---- Список акцій ---- */
.sp-layout { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 32px; }
.sp-aside { flex: 0 0 280px; position: sticky; top: 90px; padding: 20px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface); }
.sp-aside-head {
    display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; border: 0; background: none;
    font-size: 18px; font-weight: 700; color: var(--sp-text); cursor: pointer;
}
.sp-chevron {
    display: inline-flex; width: 30px; height: 30px; border: 1px solid var(--sp-border); border-radius: 50%; position: relative;
}
.sp-chevron::after {
    content: ""; position: absolute; top: 12px; left: 10px; width: 8px; height: 8px; border-left: 2px solid var(--sp-text); border-top: 2px solid var(--sp-text);
    transform: rotate(45deg); transition: transform .15s, top .15s;
}
.sp-aside:not(.is-open) .sp-chevron::after { top: 8px; transform: rotate(225deg); }
.sp-aside-body { margin-top: 16px; }
.sp-aside:not(.is-open) .sp-aside-body { display: none; }
.sp-search { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0 12px; height: 44px; border: 1px solid var(--sp-border); border-radius: 10px; color: var(--sp-muted); }
.sp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; color: var(--sp-text); }
.sp-cats { margin: 0; padding: 0; list-style: none; }
.sp-cat.is-extra, .sp-cat.is-hidden { display: none; }
.sp-cats.is-expanded .sp-cat.is-extra:not(.is-hidden) { display: block; }
.sp-cat-link { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--sp-text); text-decoration: none; font-size: 15px; line-height: 1.35; }
.sp-cat-link:hover { color: var(--sp-accent); }
.sp-check { flex: 0 0 20px; width: 20px; height: 20px; border: 1.5px solid #c9ced8; border-radius: 5px; position: relative; }
.sp-cat-link.is-checked .sp-check { border-color: var(--sp-accent); background: var(--sp-accent); }
.sp-cat-link.is-checked .sp-check::after {
    content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sp-cat-name { flex: 1; }
.sp-cat-count { color: var(--sp-muted); font-size: 12px; }
.sp-more { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--sp-green); font-size: 15px; cursor: pointer; }
.sp-more::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.sp-more.is-less::after { margin-bottom: -1px; transform: rotate(225deg); }

.sp-main { flex: 1; min-width: 0; }
.sp-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 20px; padding: 16px 20px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface);
}
.sp-types, .sp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sp-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--sp-border); border-radius: 8px;
    background: var(--sp-surface); color: var(--sp-text); font-size: 14px; text-decoration: none; white-space: nowrap; transition: border-color .15s, color .15s;
}
.sp-chip:hover { border-color: var(--sp-accent); color: var(--sp-accent); }
.sp-chip.is-active { border-color: var(--sp-accent); background: var(--sp-accent); color: #fff; }
.sp-chip span { color: var(--sp-muted); font-size: 12px; }
.sp-chip.is-active span { color: rgba(255, 255, 255, .8); }
.sp-reset { color: var(--sp-muted); font-size: 13px; text-decoration: underline; }
.sp-tool {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--sp-border); border-radius: 8px;
    color: var(--sp-text); font-size: 14px; text-decoration: none; white-space: nowrap;
}
.sp-tool:hover, .sp-tool.is-active { border-color: var(--sp-accent); color: var(--sp-accent); }
.sp-sort { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; margin: 0; padding: 0 14px 0 12px; border: 1px solid var(--sp-border); border-radius: 8px; color: var(--sp-muted); cursor: pointer; }
.sp-sort:hover { border-color: var(--sp-accent); }
/* Тема стилізує всі select — тут вигляд кнопки-перемикача без рамки браузера */
.sp-sort select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none; width: auto; height: auto; min-width: 0; margin: 0;
    padding: 0 22px 0 0 !important; border: 0 !important; border-radius: 0; box-shadow: none !important; outline: 0;
    background: transparent !important; color: var(--sp-text); font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer;
}
.sp-sort::after {
    content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
    border: solid var(--sp-text); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}

.sp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.sp-card {
    display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface);
    color: var(--sp-text); text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.sp-card:hover { box-shadow: 0 10px 28px rgba(16, 24, 40, .1); color: var(--sp-text); }
.sp-card-img { display: block; aspect-ratio: 880 / 410; overflow: hidden; background: var(--sp-soft); }
.sp-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-card-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
.sp-card-name { font-size: 17px; font-weight: 700; line-height: 1.35; }
.sp-card-left { margin-top: auto; padding: 3px 10px; border-radius: 6px; background: var(--sp-green-bg); color: var(--sp-text); font-size: 14px; }
.sp-empty { padding: 40px 20px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface); text-align: center; }
.sp-empty p { margin: 0 0 16px; color: var(--sp-muted); }
.sp-pagination { margin-top: 24px; }

/* ---- Сторінка акції ---- */
.sp-promo-head { display: flex; align-items: flex-start; gap: 36px; margin: 4px 0 28px; }
.sp-promo-banner { flex: 0 1 50%; min-width: 0; overflow: hidden; border-radius: 12px; background: var(--sp-soft); }
.sp-promo-banner img { display: block; width: 100%; height: auto; }
.sp-promo-info { flex: 1 1 50%; min-width: 0; }
.sp-promo-title { margin: 0 0 12px; font-size: 28px; font-weight: 700; line-height: 1.25; color: var(--sp-text); }
.sp-promo-note { display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 6px; background: #FFF4D6; color: #7a5a00; font-size: 13px; }
.sp-terms-link { display: inline-block; margin-bottom: 18px; color: var(--sp-green); font-size: 16px; text-decoration: underline; }
.sp-promo-card {
    display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; max-width: 520px; padding: 18px 24px;
    border-radius: 12px; background: var(--sp-surface); box-shadow: 0 6px 24px rgba(16, 24, 40, .1);
}
.sp-promo-until span { display: block; font-size: 15px; color: var(--sp-text); }
.sp-promo-until b { display: block; margin-top: 4px; color: var(--sp-green); font-size: 14px; }
.sp-timer { text-align: center; }
.sp-timer-title { display: block; margin-bottom: 4px; font-size: 13px; color: var(--sp-text); }
.sp-timer-row { display: flex; align-items: flex-start; gap: 6px; }
.sp-timer-cell { display: flex; flex-direction: column; align-items: center; min-width: 54px; }
.sp-timer-cell b { font-size: 36px; font-weight: 700; line-height: 1.1; color: var(--sp-text); font-variant-numeric: tabular-nums; }
.sp-timer-cell small { font-size: 12px; color: var(--sp-text); }
.sp-timer-cell.is-seconds b, .sp-timer-cell.is-seconds small { color: #E3262F; }
.sp-timer-sep { font-size: 28px; line-height: 1.3; color: #c9ced8; }
.sp-promo-ended { justify-content: space-between; }
.sp-promo-ended b { display: block; font-size: 17px; }
.sp-promo-ended span { color: var(--sp-muted); font-size: 14px; }

.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

.sp-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; background: rgba(16, 24, 40, .55); overflow-y: auto; }
.sp-modal[hidden] { display: none; }
.sp-modal-dialog { position: relative; width: 100%; max-width: 760px; margin: auto 0; padding: 28px; border-radius: 16px; background: var(--sp-surface); color: var(--sp-text); box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
.sp-modal-title { margin: 0 40px 16px 0; font-size: 22px; font-weight: 700; }
.sp-modal-body { font-size: 15px; line-height: 1.6; }
.sp-modal-body img { max-width: 100%; height: auto; }
.sp-modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--sp-muted); font-size: 26px; line-height: 1; cursor: pointer; }
.sp-modal-close:hover { background: var(--sp-soft); color: var(--sp-text); }
html.sp-lock { overflow: hidden; }

/* ---- Картка товару ---- */
.sp-product-promos { margin-top: 16px; padding: 16px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface); }
.sp-product-promos-title { margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--sp-text); }
.sp-product-promo { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--sp-text); text-decoration: none; }
.sp-product-promo + .sp-product-promo { border-top: 1px solid var(--sp-border); }
.sp-product-promo img { flex: 0 0 86px; width: 86px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--sp-soft); }
.sp-product-promo b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.sp-product-promo small { display: block; margin-top: 2px; color: var(--sp-green); font-size: 12px; }
.sp-product-promo:hover b { color: var(--sp-accent); }

/* ---- Блок «Останні акції» (Дизайн → Макети) ---- */
.sp-latest { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 32px; align-items: start; padding: 32px; }
.sp-latest.content-block { border-radius: 20px; }
.sp-latest-title { display: flex; align-items: center; gap: 10px; color: var(--sp-text); font-size: 26px; font-weight: 700; line-height: 1.2; }
.sp-latest-title svg { flex: 0 0 auto; color: var(--sp-accent); }
.sp-latest-text { margin: 16px 0 0; color: var(--sp-text); font-size: 16px; line-height: 1.5; }
.sp-latest-all {
    display: inline-flex; align-items: center; height: 52px; margin-top: 24px; padding: 0 26px; border-radius: 26px;
    background: var(--sp-accent); color: #fff; font-size: 17px; font-weight: 600; text-decoration: none; transition: filter .15s;
}
.sp-latest-all:hover { color: #fff; filter: brightness(.94); }
.sp-latest-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sp-latest-card { display: block; color: var(--sp-text); text-decoration: none; }
.sp-latest-card:hover { color: var(--sp-text); }
.sp-latest-img { display: block; aspect-ratio: 880 / 410; overflow: hidden; border-radius: 12px; background: var(--sp-soft); }
.sp-latest-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.sp-latest-card:hover .sp-latest-img img { transform: scale(1.03); }
.sp-latest-left { display: inline-block; margin: 16px 0 10px; padding: 4px 12px; border-radius: 14px; background: #E8F1FD; color: #1E66D0; font-size: 14px; }
.sp-latest-card:nth-child(3n+2) .sp-latest-left { background: #F1EAFE; color: #7B3FE4; }
.sp-latest-card:nth-child(3n+3) .sp-latest-left { background: #FDECF3; color: #B0245F; }
.sp-latest-name { display: block; font-size: 18px; line-height: 1.4; }
.sp-latest-card:hover .sp-latest-name { color: var(--sp-accent); }

@media (max-width: 1199.98px) {
    .sp-latest { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
    .sp-latest-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
    .sp-latest-text { flex: 1 0 100%; order: 2; margin: 0; }
    .sp-latest-all { order: 3; margin: 0; }
}
@media (max-width: 767.98px) {
    .sp-latest { padding: 16px; }
    .sp-latest.content-block { border-radius: 16px; }
    .sp-latest-title { font-size: 21px; }
    .sp-latest-all { height: 44px; font-size: 15px; }
    .sp-latest-list { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
    .sp-latest-card { scroll-snap-align: start; }
    .sp-latest-name { font-size: 16px; }
}

@media (max-width: 1199.98px) {
    .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .sp-promo-head { gap: 24px; }
    .sp-promo-title { font-size: 24px; }
}
@media (max-width: 991.98px) {
    .sp-layout { flex-direction: column; gap: 16px; }
    .sp-aside { position: static; flex: none; width: 100%; padding: 16px; }
    .sp-promo-head { flex-direction: column; }
    .sp-promo-banner, .sp-promo-info { flex: none; width: 100%; }
}
@media (max-width: 575.98px) {
    .sp-page-title { font-size: 22px; }
    .sp-grid { grid-template-columns: 1fr; }
    .sp-toolbar { padding: 12px; }
    .sp-types { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
    .sp-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .sp-promo-title { font-size: 21px; }
    .sp-promo-card { padding: 14px 16px; }
    .sp-timer-cell { min-width: 42px; }
    .sp-timer-cell b { font-size: 28px; }
    .sp-modal { padding: 0; }
    .sp-modal-dialog { min-height: 100%; border-radius: 0; padding: 20px 16px; }
}
