/* ─── Promotion Browse Styles ───
   Uses design tokens from home-modern.css (:root vars)
   ─────────────────────────────── */

/* ─── Hero Banner ─── */
.promo-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 48px 0 40px;
    margin-bottom: 0;
}

.promo-hero-title {
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.2;
}

.promo-hero-title span {
    color: var(--color-accent, #fed701);
}

.promo-hero-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin: 0;
    max-width: 600px;
}

.promo-hero .promo-total-count {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-accent, #fed701);
}

@media (max-width: 767px) {
    .promo-hero {
        padding: 32px 0 28px;
    }

    .promo-hero-title {
        font-size: 24px;
    }

    .promo-hero-subtitle {
        font-size: 14px;
    }
}

/* ─── Page Header ─── */
.promo-page-header {
    margin-bottom: 24px;
}

.promo-page-header h3 {
    font-weight: 700;
    color: var(--color-text, #222);
    font-size: 24px;
    margin-bottom: 4px;
}

.promo-page-header p {
    color: var(--color-text-muted, #666);
    font-size: 15px;
    margin: 0;
}

.promo-total-count {
    display: inline-block;
    background: var(--color-bg-muted, #f0f2f5);
    padding: 3px 12px;
    border-radius: var(--radius-pill, 50px);
    font-size: 12px;
    color: var(--color-primary, #00a2ad);
    font-weight: 600;
    margin-left: 4px;
}

/* ─── Filter Sidebar ─── */
.promo-filter-card {
    border: 1px solid var(--color-border, #e8e8e8);
    border-radius: var(--radius-md, 12px);
    background: var(--color-bg, #fff);
    box-shadow: var(--shadow-xs, 0 1px 3px rgba(0,0,0,0.03));
    overflow: hidden;
}

.promo-filter-card .card-body {
    padding: 20px;
}

.promo-filter-title {
    font-weight: 600;
    color: var(--color-primary, #00a2ad);
    margin-bottom: 18px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.promo-filter-label {
    font-weight: 500;
    color: var(--color-text, #222);
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
}

.promo-filter-card .form-control {
    border-radius: var(--radius-sm, 8px);
    border-color: var(--color-border, #e8e8e8);
    font-size: 13px;
    transition: border-color var(--duration-fast, 0.2s) var(--ease, ease);
}

.promo-filter-card .form-control:focus {
    border-color: var(--color-primary, #00a2ad);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 0,162,173), 0.1);
}

.promo-clear-btn {
    border-radius: var(--radius-sm, 8px);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    transition: all var(--duration-fast, 0.2s) var(--ease, ease);
}

.promo-category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.promo-category-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius-pill, 50px);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration-fast, 0.2s) var(--ease, ease);
    background: var(--color-bg-muted, #f0f2f5);
    color: var(--color-text, #222);
    border: 1px solid transparent;
}

.promo-category-badge:hover {
    background: rgba(var(--color-primary-rgb, 0,162,173), 0.08);
    color: var(--color-primary, #00a2ad);
    border-color: rgba(var(--color-primary-rgb, 0,162,173), 0.2);
}

.promo-category-badge.active {
    background: var(--color-primary, #00a2ad);
    color: #fff;
}

/* ─── Retailer CTA Card ─── */
.promo-retailer-cta {
    border: none;
    border-radius: var(--radius-md, 12px);
    background: var(--gradient-primary, linear-gradient(135deg, #00a2ad, #008b95));
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
    margin-top: 16px;
    overflow: hidden;
}

.promo-retailer-cta .card-body {
    padding: 24px 20px;
    text-align: center;
}

.promo-retailer-cta .cta-icon {
    font-size: 28px;
    color: rgba(255,255,255,0.9);
}

.promo-retailer-cta p {
    color: rgba(255,255,255,0.9);
    margin: 10px 0 14px;
    font-weight: 500;
    font-size: 14px;
}

.promo-retailer-cta .btn {
    background: #fff;
    color: var(--color-primary, #00a2ad);
    border-radius: var(--radius-sm, 8px);
    font-weight: 600;
    font-size: 13px;
    padding: 8px 20px;
    transition: all var(--duration-fast, 0.2s) var(--ease, ease);
}

.promo-retailer-cta .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ─── Toolbar ─── */
.promo-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-bg-subtle, #f8fafb);
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--color-border-light, #f0f0f0);
    margin-bottom: 16px;
}

.promo-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.promo-quick-filters::-webkit-scrollbar {
    display: none;
}

.promo-sort-view {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Quick Filter Pills ─── */
.promo-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    border: 1px solid var(--color-border, #e8e8e8);
    border-radius: var(--radius-pill, 50px);
    background: var(--color-bg, #fff);
    color: var(--color-text-muted, #666);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast, 0.2s) var(--ease, ease);
    white-space: nowrap;
}

.promo-pill:hover {
    border-color: var(--color-primary, #00a2ad);
    color: var(--color-primary, #00a2ad);
    background: rgba(var(--color-primary-rgb, 0,162,173), 0.04);
}

.promo-pill.active[data-quick-filter="today"] {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.promo-pill.active[data-quick-filter="ending_soon"] {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.promo-pill.active[data-quick-filter="new"] {
    background: var(--color-primary, #00a2ad);
    border-color: var(--color-primary, #00a2ad);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 0,162,173), 0.3);
}

.promo-pill.active[data-quick-filter="featured"] {
    background: var(--color-accent, #fed701);
    border-color: var(--color-accent, #fed701);
    color: var(--color-text, #222);
    box-shadow: 0 2px 8px rgba(254, 215, 1, 0.3);
}

/* ─── Sort Select ─── */
.promo-sort-select {
    width: auto;
    min-width: 140px;
    border-radius: var(--radius-sm, 8px);
    font-size: 13px;
    border: 1px solid var(--color-border, #e8e8e8);
    padding: 5px 30px 5px 12px;
    background-color: var(--color-bg, #fff);
    color: var(--color-text, #222);
    transition: border-color var(--duration-fast, 0.2s) var(--ease, ease);
}

.promo-sort-select:focus {
    border-color: var(--color-primary, #00a2ad);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 0,162,173), 0.1);
    outline: none;
}

/* ─── View Toggle ─── */
.promo-view-toggle .btn {
    padding: 5px 12px;
    font-size: 14px;
    border-color: var(--color-border, #e8e8e8);
    color: var(--color-text-light, #999);
    transition: all var(--duration-fast, 0.2s) var(--ease, ease);
}

.promo-view-toggle .btn.active {
    background-color: var(--color-primary, #00a2ad);
    border-color: var(--color-primary, #00a2ad);
    color: #fff;
}

.promo-view-toggle .btn:not(.active):hover {
    background-color: var(--color-bg-subtle, #f8fafb);
    color: var(--color-text, #222);
}

/* ─── Result Count ─── */
.promo-result-count {
    padding: 0 2px;
    margin-bottom: 12px;
}

.promo-result-count small {
    color: var(--color-text-light, #999);
    font-size: 13px;
}

/* ─── Loading Overlay ─── */
#promo-results-container {
    position: relative;
    transition: opacity var(--duration-fast, 0.2s) var(--ease, ease);
    min-height: 200px;
}

#promo-results-container.promo-loading {
    opacity: 0.35;
    pointer-events: none;
}

#promo-results-container.promo-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border, #e8e8e8);
    border-top-color: var(--color-primary, #00a2ad);
    border-radius: 50%;
    animation: promoSpin 0.7s linear infinite;
}

@keyframes promoSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ─── Card Base (shared between deal & retailer) ─── */
.promo-card {
    border: 1px solid var(--color-border, #e8e8e8);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    background: var(--color-bg, #fff);
    transition: transform var(--duration-fast, 0.2s) var(--ease, ease),
                box-shadow var(--duration, 0.35s) var(--ease, ease);
}

.promo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.08));
}

.promo-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Card image area */
.promo-card-img {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.promo-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration, 0.35s) var(--ease, ease);
}

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

.promo-card-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-bg-muted, #f0f2f5), var(--color-border-light, #f0f0f0));
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-card-img-placeholder i {
    font-size: 36px;
    color: #d0d0d0;
}

/* Card badges */
.promo-badge {
    position: absolute;
    padding: 4px 10px;
    border-radius: var(--radius-pill, 50px);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 2;
}

.promo-badge-new {
    top: 10px;
    left: 10px;
    background: var(--color-primary, #00a2ad);
    color: #fff;
}

.promo-badge-ai {
    top: 10px;
    right: 10px;
    background: #6c5ce7;
    color: #fff;
    font-size: 10px;
}

.promo-badge-urgent {
    bottom: 10px;
    left: 10px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
}

/* Card body */
.promo-card-body {
    padding: 14px 16px 16px;
}

/* Type badge row */
.promo-type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.promo-type-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-pill, 50px);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
}

/* Card title */
.promo-card-title {
    font-weight: 600;
    color: var(--color-text, #222);
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card description */
.promo-card-desc {
    color: var(--color-text-muted, #666);
    font-size: 12px;
    margin: 0 0 10px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Retailer avatar row (deal cards) */
.promo-retailer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-retailer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-border-light, #f0f0f0);
    flex-shrink: 0;
}

.promo-retailer-avatar-ph {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary, #00a2ad);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
}

.promo-retailer-name {
    color: var(--color-text-light, #999);
    font-size: 12px;
}

/* Card meta */
.promo-card-meta {
    color: var(--color-text-light, #999);
    font-size: 11px;
    margin-top: 8px;
    line-height: 1.6;
}

.promo-meta-sep {
    margin: 0 3px;
    opacity: 0.5;
}

.promo-ai-found {
    color: #6c5ce7;
    font-size: 10px;
    opacity: 0.8;
}

/* ─── Retailer Card specifics ─── */
.promo-retailer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.promo-retailer-logo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--color-border-light, #f0f0f0);
    flex-shrink: 0;
}

.promo-retailer-logo-ph {
    width: 40px;
    height: 40px;
    background: var(--color-primary, #00a2ad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.promo-retailer-details {
    min-width: 0;
}

.promo-retailer-details h6 {
    font-weight: 600;
    color: var(--color-text, #222);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.promo-retailer-details .sub-text {
    color: var(--color-text-light, #999);
    font-size: 12px;
    margin: 2px 0 0;
}

.promo-deal-count {
    color: var(--color-primary, #00a2ad);
    font-size: 12px;
    margin: 10px 0 0;
    font-weight: 600;
}

.promo-deal-count .posted-date {
    color: var(--color-text-light, #999);
    font-weight: 400;
}

/* ─── Featured Section ─── */
.promo-featured-section {
    margin-bottom: 28px;
}

.promo-featured-section h5 {
    font-weight: 700;
    color: var(--color-text, #222);
    margin-bottom: 16px;
    font-size: 16px;
}

.promo-featured-card {
    border: 2px solid var(--color-accent, #fed701);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    background: var(--color-bg, #fff);
    transition: transform var(--duration-fast, 0.2s) var(--ease, ease),
                box-shadow var(--duration, 0.35s) var(--ease, ease);
}

.promo-featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(254, 215, 1, 0.2);
}

.promo-featured-card a {
    text-decoration: none;
    color: inherit;
}

.promo-featured-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.promo-featured-body {
    padding: 12px 14px;
}

.promo-featured-body h6 {
    font-weight: 600;
    color: var(--color-text, #222);
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-featured-body small {
    color: var(--color-text-light, #999);
    font-size: 12px;
}

.promo-featured-img-placeholder {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--color-bg-muted, #f0f2f5), var(--color-border-light, #f0f0f0));
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-featured-img-placeholder i {
    font-size: 28px;
    color: #d0d0d0;
}

/* ─── Empty State ─── */
.promo-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.promo-empty-state i {
    font-size: 52px;
    color: var(--color-border, #e8e8e8);
    margin-bottom: 16px;
}

.promo-empty-state p {
    color: var(--color-text-muted, #666);
    font-size: 15px;
    margin-bottom: 16px;
}

.promo-empty-state .btn {
    border-radius: var(--radius-sm, 8px);
}

/* ─── Mobile Filter Button ─── */
.promo-mobile-filter-btn {
    background: var(--gradient-primary, linear-gradient(135deg, #00a2ad, #008b95));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm, 8px);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--duration-fast, 0.2s) var(--ease, ease);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
}

.promo-mobile-filter-btn:hover,
.promo-mobile-filter-btn:active {
    color: #fff;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.08));
}

/* ─── Mobile Responsive ─── */
@media (max-width: 767.98px) {
    .promo-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 8px;
    }

    .promo-quick-filters {
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .promo-sort-view {
        justify-content: space-between;
    }

    .promo-sort-select {
        flex: 1;
    }

    .promo-card-img {
        height: 160px;
    }

    .promo-page-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 575.98px) {
    .promo-card-img {
        height: 140px;
    }
}
