/* ============================================================
   Next Pro — template-sale.php (محصولات تخفیف‌دار)
   Tokens: design-system.css (--next-*)
   ============================================================ */

.next-sale-page {
    padding-bottom: 48px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.sale-hero {
    position: relative;
    border-radius: var(--next-radius-lg, 20px);
    overflow: hidden;
    background: linear-gradient(135deg, #1a2438 0%, #2a1f18 55%, #3d2415 100%);
    padding: 44px 40px;
    margin-bottom: 28px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}
@media (max-width: 575px) {
    .sale-hero { padding: 32px 22px; }
}

.sale-hero::before {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 116, 39, 0.35) 0%, transparent 70%);
    top: -160px;
    inset-inline-start: -80px;
    pointer-events: none;
}
.sale-hero::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 116, 39, 0.18) 0%, transparent 70%);
    bottom: -90px;
    inset-inline-end: 15%;
    pointer-events: none;
}

.sale-hero__content {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.sale-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(244, 116, 39, 0.18);
    border: 1px solid rgba(244, 116, 39, 0.35);
    color: var(--next-primary, #F47427);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.sale-hero__badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--next-primary, #F47427);
    box-shadow: 0 0 0 3px rgba(244, 116, 39, 0.3);
    flex-shrink: 0;
}

.sale-hero h1 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    color: #fff;
}

.sale-hero p {
    font-size: 14.5px;
    color: var(--next-muted-on-dark, #C1CAD8);
    line-height: 1.85;
    margin: 0;
}

.sale-hero__stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.sale-hero__stat {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 22px;
    text-align: center;
    min-width: 100px;
}
.sale-hero__stat strong {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--next-primary, #F47427);
    line-height: 1.2;
}
.sale-hero__stat span {
    font-size: 12px;
    color: var(--next-muted-on-dark, #C1CAD8);
}

/* ── Toolbar ──────────────────────────────────────────────── */
.sale-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--next-surface, #fff);
    border: 1px solid var(--next-border, #E6E9EE);
    border-radius: var(--next-radius, 16px);
    padding: 14px 18px;
    margin-bottom: 22px;
}

.sale-toolbar__count {
    font-size: 13.5px;
    color: var(--next-text, #46546A);
}
.sale-toolbar__count strong {
    color: var(--next-primary, #F47427);
}

.sale-toolbar__sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.sale-toolbar__sort label {
    font-size: 13px;
    color: var(--next-muted, #718096);
    white-space: nowrap;
}
.sale-toolbar__sort select {
    border: 1.5px solid var(--next-border, #E6E9EE);
    border-radius: 10px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    background: var(--next-surface-soft, #F8F9FB);
    color: var(--next-ink, #17243A);
    cursor: pointer;
    min-width: 150px;
}
.sale-toolbar__sort select:focus {
    outline: none;
    border-color: var(--next-primary, #F47427);
    box-shadow: 0 0 0 3px rgba(244, 116, 39, 0.14);
}

/* ── Product grid ─────────────────────────────────────────── */
.sale-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 991px) {
    .sale-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .sale-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
    .sale-grid { grid-template-columns: 1fr; }
}

.sale-card {
    background: var(--next-surface, #fff);
    border: 1px solid var(--next-border, #E6E9EE);
    border-radius: var(--next-radius, 16px);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}
.sale-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(23, 36, 58, 0.1);
    border-color: transparent;
}

.sale-card__media {
    position: relative;
    aspect-ratio: 1;
    background: var(--next-surface-soft, #F8F9FB);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
}
.sale-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform 0.25s;
}
.sale-card:hover .sale-card__media img {
    transform: scale(1.05);
}

.sale-card__badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: linear-gradient(135deg, #E53935, #C62828);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 8px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.35);
    line-height: 1.3;
}

.sale-card__body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sale-card__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--next-ink, #17243A);
    line-height: 1.7;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
    text-decoration: none;
}
.sale-card__title:hover {
    color: var(--next-primary, #F47427);
}

.sale-card__prices {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.sale-card__sale {
    font-size: 15px;
    font-weight: 800;
    color: var(--next-primary, #F47427);
}

.sale-card__currency {
    font-size: 11px;
    font-weight: 600;
    color: var(--next-muted, #718096);
}

.sale-card__regular {
    font-size: 12.5px;
    color: var(--next-muted, #718096);
    text-decoration: line-through;
}

.sale-card__btn {
    margin-top: 12px;
    width: 100%;
    border: none;
    border-radius: 10px;
    background: var(--next-primary-soft, #FFF1E8);
    color: var(--next-primary, #F47427);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 10px;
    cursor: pointer;
    transition: 0.15s;
    text-align: center;
    text-decoration: none;
    display: block;
}
.sale-card:hover .sale-card__btn {
    background: var(--next-primary, #F47427);
    color: #fff;
}

/* ── Pagination ───────────────────────────────────────────── */
.sale-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.sale-pagination a,
.sale-pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--next-border, #E6E9EE);
    background: var(--next-surface, #fff);
    color: var(--next-ink, #17243A);
    padding: 0 10px;
}
.sale-pagination .current {
    background: var(--next-primary, #F47427);
    border-color: var(--next-primary, #F47427);
    color: #fff;
}
.sale-pagination a:hover {
    border-color: var(--next-primary, #F47427);
    color: var(--next-primary, #F47427);
}
.sale-pagination .dots {
    border: none;
    background: transparent;
}

/* ── Empty state ──────────────────────────────────────────── */
.sale-empty {
    text-align: center;
    padding: 60px 24px;
    background: var(--next-surface, #fff);
    border: 1px solid var(--next-border, #E6E9EE);
    border-radius: var(--next-radius-lg, 20px);
}
.sale-empty p {
    font-size: 15px;
    color: var(--next-muted, #718096);
    margin: 0 0 20px;
}
.sale-empty__btn {
    display: inline-block;
    background: var(--next-primary, #F47427);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    transition: 0.15s;
}
.sale-empty__btn:hover {
    background: var(--next-primary-dark, #D85D17);
    color: #fff;
}
