/* ============================================================
   SUKO /sale hub — layout & visual polish (UI only)
   ============================================================ */

.promotions-page {
    --sale-dark: #244f2d;
    --sale-green: #3f7045;
    --sale-green-deep: #294b2c;
    --sale-light: #dde8d8;
    --sale-cream: #f5f1e8;
    --sale-bg: #fafaf7;
    --sale-white: #ffffff;
    --sale-text: #1f2a1f;
    --sale-muted: #6b7468;
    --sale-pill-bg: #f5f5ef;
    --sale-line: #e8eae5;
    --sale-radius: 18px;
    --sale-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --sale-font: var(--font-body, "Heebo", "Rubik", sans-serif);
    --sale-display: var(--font-display, "Heebo", "Rubik", sans-serif);

    background: var(--sale-bg);
    color: var(--sale-text);
    font-family: var(--sale-font);
    padding: 20px 0 40px;
}

.promotions-shell {
    width: min(1440px, 100%);
    max-width: 1440px;
    margin: 0 auto;
    padding-inline: 24px;
}

/* ---------- Hero ---------- */
.sale-hero {
    display: flex;
    align-items: center;
    min-height: 280px;
    height: clamp(260px, 28vw, 320px);
    margin: 0 0 48px;
    padding: 40px 48px;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(41, 75, 44, 0.08);
    box-shadow: 0 10px 28px rgba(41, 75, 44, 0.06);
    background:
        linear-gradient(270deg, rgba(245, 241, 232, 0.97) 0%, rgba(245, 241, 232, 0.94) 42%, rgba(238, 244, 234, 0.55) 68%, rgba(238, 244, 234, 0.2) 100%),
        var(--sale-hero-image, none) left center / cover no-repeat,
        linear-gradient(90deg, #f5f1e8, #eef4ea);
}

html[dir="ltr"] .sale-hero,
body.ltr .sale-hero {
    background:
        linear-gradient(90deg, rgba(245, 241, 232, 0.97) 0%, rgba(245, 241, 232, 0.94) 42%, rgba(238, 244, 234, 0.55) 68%, rgba(238, 244, 234, 0.2) 100%),
        var(--sale-hero-image, none) right center / cover no-repeat,
        linear-gradient(90deg, #f5f1e8, #eef4ea);
}

.sale-hero__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    max-width: 640px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.sale-hero__kicker {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sale-green);
}

.sale-hero__title {
    margin: 0;
    font-family: var(--sale-display);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--sale-dark);
    letter-spacing: -0.02em;
}

.sale-hero__lead {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 500;
    line-height: 1.4;
    color: var(--sale-green);
}

.sale-hero__perks {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.sale-hero__perks li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(41, 75, 44, 0.08);
    color: var(--sale-text);
    font-size: 0.875rem;
    font-weight: 500;
}

.sale-hero__perks i {
    color: var(--sale-green);
    font-size: 1rem;
}

/* ---------- Active promotions ---------- */
.promotions-cards-section {
    margin: 0 0 32px;
}

.promotions-section-header {
    margin: 0 0 20px;
}

.promotions-section-header__title {
    margin: 0 0 8px;
    font-family: var(--sale-display);
    font-size: clamp(1.6rem, 2.6vw, 2rem);
    font-weight: 800;
    color: var(--sale-dark);
}

.promotions-section-header__sub {
    margin: 0;
    color: var(--sale-muted);
    font-size: 1rem;
    font-weight: 500;
}

.promotions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    align-items: stretch;
    justify-items: stretch;
}

/* One card: keep max ~320px and center — not full-bleed, not stuck in a corner */
.promotions-grid:has(> .promo-card:only-child) {
    grid-template-columns: minmax(260px, 320px);
    justify-content: center;
    justify-items: stretch;
}

.promo-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    height: 330px;
    background: var(--sale-white);
    border: 1px solid var(--sale-line);
    border-radius: var(--sale-radius);
    overflow: hidden;
    box-shadow: var(--sale-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 2+ cards fill their grid tracks evenly across the page */
.promotions-grid:not(:has(> .promo-card:only-child)) .promo-card {
    max-width: none;
}

.promo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.1);
}

.promo-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.promo-card__link:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(63, 112, 69, 0.45);
}

.promo-card__media {
    position: relative;
    flex: 0 0 180px;
    width: 100%;
    height: 180px;
    background:
        linear-gradient(160deg, #eef4ea 0%, #f5f1e8 55%, #e8efe3 100%);
    overflow: hidden;
}

.promo-card__img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.promo-card:hover .promo-card__img {
    transform: scale(1.04);
}

.promo-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 28px);
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--sale-green-deep);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 12px rgba(41, 75, 44, 0.22);
}

html[dir="ltr"] .promo-card__badge,
body.ltr .promo-card__badge {
    right: auto;
    left: 14px;
}

.promo-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    height: 150px;
    padding: 14px 16px 16px;
    background: var(--sale-white);
}

.promo-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--sale-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.promo-card__summary {
    margin: 0;
    color: var(--sale-muted);
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.promo-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--sale-muted);
    font-size: 12px;
    font-weight: 500;
}

.promo-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    min-height: 44px;
    margin-top: auto;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--sale-green);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background 0.25s ease;
}

.promo-card__link:hover .promo-card__cta {
    background: var(--sale-green-deep);
}

.promo-card__terms {
    display: none;
}

/* ---------- Filter pills ---------- */
.sale-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 32px;
}

.sale-filter-pills__item {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--sale-pill-bg);
    color: var(--sale-dark);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sale-filter-pills__item:hover {
    transform: translateY(-1px);
    border-color: rgba(41, 75, 44, 0.12);
}

.sale-filter-pills__item.is-active {
    background: var(--sale-green);
    color: #fff;
}

/* ---------- Products section ---------- */
.promotions-products-section {
    margin-top: 0;
    padding-top: 0;
}

.promotions-products-section .psection {
    padding-top: 0;
    padding-bottom: 8px;
    --p-primary: #3f7045;
    --p-primary-dark: #244f2d;
    --p-secondary: #6b7468;
    --p-accent: #dde8d8;
    --p-card: #ffffff;
    --p-text: #1f2a1f;
    --p-muted: #6b7468;
    --p-border: #e8eae5;
    --p-radius-card: 16px;
}

.promotions-products-section .psection__header {
    align-items: flex-start;
    text-align: start;
    margin-bottom: 20px;
}

.promotions-products-section .psection__eyebrow {
    color: var(--sale-green);
    letter-spacing: 0.06em;
}

.promotions-products-section .psection__title {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 800;
    color: var(--sale-dark);
    margin-bottom: 6px;
}

.promotions-products-section .psection__subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    max-width: none;
    margin: 0;
}

.promotions-products-section .psection__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}

.promotions-products-section .pcard {
    border: 1px solid #e8eae5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    opacity: 1;
    transform: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.promotions-products-section .pcard:hover,
.promotions-products-section .pcard.is-visible:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.promotions-products-section .pcard.is-visible {
    opacity: 1;
    transform: none;
}

.promotions-products-section .pcard__media {
    background: #fafaf8;
    border-radius: 12px;
}

.promotions-products-section .pcard__img {
    object-fit: contain;
}

.promotions-products-section .pcard__name {
    font-weight: 600;
    font-size: 1.05rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.promotions-products-section .pcard__tag--sale {
    background: var(--sale-light);
    color: var(--sale-dark);
}

.promotions-products-section .pcard__price-current,
.promotions-products-section .pcard__price {
    color: var(--sale-dark);
    font-weight: 700;
}

/* ---------- Empty ---------- */
.promotions-empty {
    max-width: 560px;
    margin: 32px auto;
    text-align: center;
    padding: 32px 24px;
    border-radius: 20px;
    background: var(--sale-cream);
    border: 1px solid rgba(41, 75, 44, 0.08);
}

.promotions-empty--soft {
    margin: 0 0 24px;
    max-width: none;
    text-align: start;
    padding: 20px;
}

.promotions-empty__title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sale-dark);
}

.promotions-empty__text {
    margin: 0 0 20px;
    color: var(--sale-muted);
    font-size: 1rem;
}

.promotions-empty__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.promotions-empty--soft .promotions-empty__text {
    margin-bottom: 0;
}

/* ---------- Responsive ---------- */
@media (min-width: 1500px) {
    .promotions-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .promotions-grid:has(> .promo-card:only-child) {
        grid-template-columns: minmax(260px, 320px);
        justify-content: center;
    }

    .promotions-products-section .psection__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1399.98px) {
    .promotions-products-section .psection__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .promotions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .promotions-grid:has(> .promo-card:only-child) {
        grid-template-columns: minmax(240px, 320px);
        justify-content: center;
    }

    .promotions-products-section .psection__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sale-hero {
        height: auto;
        min-height: 220px;
        padding: 28px 24px;
        background:
            linear-gradient(180deg, rgba(245, 241, 232, 0.96) 0%, rgba(245, 241, 232, 0.88) 55%, rgba(245, 241, 232, 0.55) 100%),
            var(--sale-hero-image, none) center / cover no-repeat,
            #f5f1e8;
    }

    .sale-hero__copy {
        max-width: none;
    }

    .promotions-shell {
        padding-inline: 20px;
    }

}

@media (max-width: 767.98px) {
    .promotions-page {
        padding: 12px 0 32px;
    }

    .promotions-shell {
        padding-inline: 12px;
    }

    .sale-hero {
        min-height: 180px;
        height: auto;
        margin-bottom: 32px;
        border-radius: 18px;
        padding: 20px;
    }

    .sale-hero__copy {
        gap: 8px;
    }

    .sale-hero__title {
        font-size: clamp(1.875rem, 8vw, 2.25rem);
    }

    .sale-hero__lead {
        font-size: 1.05rem;
    }

    .sale-hero__perks li:nth-child(n + 3) {
        display: none;
    }

    .promotions-cards-section {
        margin-bottom: 24px;
    }

    .promotions-section-header {
        margin-bottom: 16px;
    }

    .promotions-grid,
    .promotions-grid:has(> .promo-card:only-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        justify-items: stretch;
        justify-content: stretch;
    }

    .promo-card,
    .promotions-grid:not(:has(> .promo-card:only-child)) .promo-card {
        max-width: none;
        height: auto;
        min-height: 280px;
    }

    .promo-card__media,
    .promo-card__img {
        height: 140px;
        flex-basis: 140px;
    }

    .promo-card__body {
        height: auto;
        min-height: 140px;
        padding: 12px;
        gap: 6px;
    }

    .promo-card__title {
        font-size: 16px;
    }

    .promo-card__summary {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .promo-card__cta {
        height: 40px;
        min-height: 40px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .promo-card__badge {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .sale-filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 24px;
        padding-bottom: 4px;
    }

    .sale-filter-pills::-webkit-scrollbar {
        display: none;
    }

    .sale-filter-pills__item {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 38px;
        padding: 8px 16px;
    }

    .promotions-products-section .psection__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .promotions-products-section .psection__title {
        font-size: 1.45rem;
    }

    .promotions-products-section .pcard__name {
        font-size: 0.95rem;
    }
}

@media (max-width: 374.98px) {
    .promotions-grid {
        gap: 10px;
    }

    .promo-card__meta {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .promo-card,
    .promo-card__img,
    .promotions-products-section .pcard {
        transition: none !important;
    }
}
