/* ============================================================
   АКЦІЇ — astra-child/css/promo.css  v5
   ============================================================ */

/* ======================================================
   Вириваємось з усіх Astra-обмежень
   Принцип: .sp-page-root розтягується на повну ширину viewport
   ====================================================== */

/* 1. Прибираємо padding у всіх Astra-обгортках на сторінці акції */
.single-promo .site-content,
.single-promo #content,
.single-promo .content-area,
.single-promo .entry-content,
.single-promo .ast-container,
.single-promo #primary {
    padding:    0 !important;
    max-width:  100% !important;
    width:      100% !important;
    margin:     0 !important;
}

/* 2. Кореневий блок сторінки — займає весь viewport по ширині */
.sp-page-root {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left:  -50vw;
    margin-right: -50vw;
    overflow-x: hidden;
}

/* ======================================================
   HERO — двоколонковий grid
   ====================================================== */
.sp-hero-wrap {
    display: grid;
    grid-template-columns: 52% 1fr;
    width: 100%;
    min-height: 380px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

/* Ліва колонка: банер */
.sp-hero__banner {
    overflow: hidden;
    background: #f5f5f5;
}

.sp-hero__banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sp-hero__banner-placeholder {
    width: 100%;
    height: 100%;
    min-height: 380px;
    background: linear-gradient(135deg, #ff4500 0%, #ff9900 100%);
}

/* Права колонка: весь текст */
.sp-hero__info {
    padding: 28px 36px 32px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* хлібні крихти */
.sp-bread {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}
.sp-bread a { color: #555; text-decoration: none; }
.sp-bread a:hover { color: #111; text-decoration: underline; }
.sp-bread span { color: #ccc; }

/* заголовок */
.sp-hero__title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    line-height: 1.25;
    margin: 0 0 12px;
    word-break: break-word;
}

/* бейдж */
.sp-hero__badge {
    display: inline-block;
    background: #ffd500;
    color: #222;
    font-size: 15px;
    font-weight: 800;
    padding: 5px 16px;
    border-radius: 24px;
    margin-bottom: 16px;
    align-self: flex-start;
}

/* дати */
.sp-hero__period {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #555;
    margin-top: auto;   /* прибиває до низу правої колонки */
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    line-height: 1.4;
}
.sp-hero__period svg { flex-shrink: 0; margin-top: 2px; color: #888; }
.sp-hero__period strong { color: #111; }

/* ======================================================
   ТАЙМЕР
   ====================================================== */
.sp-timer-wrap {
    background: #111;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.sp-timer__label {
    font-size: 12px;
    color: rgba(255,255,255,.6);
    margin: 0 0 8px;
    line-height: 1.4;
}

.sp-timer__label--done {
    color: #f09090;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sp-timer {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sp-timer--done strong { color: #555 !important; }

.sp-timer__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
}

.sp-timer__cell strong {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    display: block;
}

.sp-timer__cell span {
    font-size: 10px;
    color: rgba(255,255,255,.4);
    margin-top: 3px;
}

.sp-timer i {
    font-size: 22px;
    color: rgba(255,255,255,.3);
    font-style: normal;
    line-height: 1;
    padding-bottom: 14px;
    user-select: none;
    flex-shrink: 0;
    padding-left: 2px;
    padding-right: 2px;
}

.sp-timer__note {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.1);
    line-height: 1.4;
}

/* ======================================================
   ОСНОВНИЙ БЛОК
   ====================================================== */
.sp-body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* Умови */
.sp-conditions {
    background: #fffbf0;
    border-left: 4px solid #ffd500;
    border-radius: 0 10px 10px 0;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.sp-conditions h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0 0 10px;
}

.sp-conditions p { font-size: 15px; line-height: 1.7; color: #444; }
.sp-conditions p:last-child { margin-bottom: 0; }

/* Товари */
.sp-products__title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.sp-products__empty {
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 24px;
    color: #888;
    font-size: 15px;
    text-align: center;
}

/* Сітка товарів */
.sp-products .woocommerce ul.products {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* ======================================================
   АРХІВ КАРТОК
   ====================================================== */
.promo-archive-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.promo-archive-title {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 30px;
}

.promo-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.promo-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow .25s, transform .2s;
}

.promo-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    transform: translateY(-4px);
}

.promo-card--expired { opacity: .6; filter: grayscale(50%); }
.promo-card__link { display: block; text-decoration: none; color: inherit; }

.promo-card__banner {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f0f0f0;
}

.promo-card__banner img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .35s;
}

.promo-card:hover .promo-card__banner img { transform: scale(1.05); }

.promo-card__banner--placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #ff4500, #ff9900);
}

.promo-card__discount {
    position: absolute;
    top: 10px; right: 10px;
    background: #ffd500; color: #333;
    font-size: 13px; font-weight: 800;
    padding: 4px 10px; border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.promo-card__status {
    position: absolute;
    top: 10px; left: 10px;
    font-size: 11px; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 20px;
}

.promo-card__status--soon    { background: #1d9e75; color: #fff; }
.promo-card__status--expired { background: #888;    color: #fff; }

.promo-card__body { padding: 18px 20px 22px; }
.promo-card__dates { font-size: 12px; color: #999; margin-bottom: 6px; }

.promo-card__title {
    font-size: 15px; font-weight: 600; color: #111;
    line-height: 1.35; margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}

.promo-card__countdown {
    display: flex; align-items: center; gap: 8px;
    padding-top: 10px; border-top: 1px solid #f0f0f0;
    font-size: 13px; color: #666;
}

.promo-card__countdown-label { flex: 1; }

.promo-card__countdown-value {
    font-size: 36px; font-weight: 800;
    line-height: 1; color: #1d9e75;
}

.promo-card__countdown-value--urgent { color: #e2401c; }

.promo-card__countdown-unit {
    font-size: 12px; color: #999;
    align-self: flex-end; padding-bottom: 3px;
}

.promo-pagination     { margin-top: 40px; text-align: center; }
.promo-archive__empty { text-align: center; color: #888; padding: 40px 0; font-size: 16px; }

.promo-pagination     { margin-top: 40px; text-align: center; }
.promo-archive__empty { text-align: center; color: #888; padding: 40px 0; font-size: 16px; }

/* ======================================================
   АДАПТИВ
   ====================================================== */

/* Десктоп 1200px */
@media (max-width: 1200px) {
    .sp-hero__info  { padding: 22px 24px; }
    .sp-hero__title { font-size: 20px; }
    .sp-timer__cell strong { font-size: 28px; }
    .sp-timer__cell { min-width: 40px; }
}

/* Планшет широкий 1024px */
@media (max-width: 1024px) {
    .sp-hero-wrap { grid-template-columns: 46% 1fr; }
    .sp-hero__title { font-size: 18px; }
    .sp-timer__cell strong { font-size: 24px; }
    .sp-timer__cell { min-width: 36px; }

    /* Товари акції: 3 колонки */
    .sp-products .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Картки акцій: 2 колонки на планшеті */
    .promo-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Планшет вузький 860px — hero стає вертикальним */
@media (max-width: 860px) {
    .sp-hero-wrap { grid-template-columns: 1fr; }
    .sp-hero__banner { max-height: 320px; min-height: 200px; }
    .sp-hero__info   { padding: 20px; }
    .sp-hero__title  { font-size: 20px; }
    .sp-hero__period { margin-top: 14px; }

    .sp-products .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Мобільний 600px */
@media (max-width: 600px) {
    .sp-hero__banner { max-height: 230px; }
    .sp-hero__title  { font-size: 17px; }
    .sp-hero__info   { padding: 16px; }
    .sp-body         { padding: 20px 16px 40px; }
    .sp-conditions   { padding: 16px; }
    .sp-timer-wrap   { padding: 12px 14px; }
    .sp-timer__cell strong { font-size: 22px; }
    .sp-timer__cell  { min-width: 32px; }
    .sp-timer i      { font-size: 16px; padding-bottom: 10px; }

    /* Товари акції: 2 колонки */
    .sp-products .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        column-gap: 8px  !important;
        row-gap:    12px !important;
    }
    .sp-products .woocommerce ul.products li.product { padding: 6px !important; }
    .sp-products .woocommerce-loop-product__title    { font-size: 12px !important; }

    /* Картки акцій: 1 колонка на мобільному */
    .promo-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Дуже маленький 380px */
@media (max-width: 380px) {
    .sp-products .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* ======================================================
   ПАГІНАЦІЯ ТОВАРІВ НА СТОРІНЦІ АКЦІЇ
   ====================================================== */
.sp-pagination {
    margin-top: 40px;
    text-align: center;
}

.sp-pagination ul {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sp-pagination ul li a,
.sp-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    background: #fff;
    transition: all .2s ease;
}

.sp-pagination ul li a:hover {
    border-color: #111;
    background: #111;
    color: #fff;
}

.sp-pagination ul li span.current {
    border-color: #e2401c;
    background: #e2401c;
    color: #fff;
}

.sp-pagination ul li span.dots {
    border-color: transparent;
    background: transparent;
    color: #999;
}

@media (max-width: 480px) {
    .sp-pagination ul { gap: 4px; }
    .sp-pagination ul li a,
    .sp-pagination ul li span {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* Короткий опис у hero */
.sp-hero__short-desc {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-left: 3px solid #ffd500;
    border-radius: 0 6px 6px 0;
}

.sp-hero__short-desc p { margin: 0 0 6px; }
.sp-hero__short-desc p:last-child { margin-bottom: 0; }
.sp-hero__short-desc a { color: #e2401c; text-decoration: underline; }
.sp-hero__short-desc a:hover { color: #c0392b; }
.sp-hero__short-desc strong { font-weight: 700; }
