/* ============================================
   BONUS CARDS — credit-card style
   ============================================ */

/* Veco bonusu joslu paslēpt uzreiz — novērš mirgošanu pirms JS aizstāšanas */
.space-categories-list-box:has(~ .space-offers-archive-items),
.space-categories-list-box.bfilter-replacing {
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   BONUS FILTER BAR (bez meklēšanas)
   ============================================ */
.bfilter-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.bfilter-bar::-webkit-scrollbar { display: none; }
.bfilter-tab {
    padding: 8px 18px;
    font-size: 0.85em;
    font-weight: 600;
    color: #7f8c8d;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.bfilter-tab:hover {
    color: #5c2698;
}
.bfilter-tab.active {
    color: #5c2698;
    border-bottom-color: #5c2698;
}

@media screen and (max-width: 768px) {
    .bfilter-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .bfilter-tab {
        padding: 6px 14px;
        font-size: 0.8em;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 0;
    }
    .bfilter-tab.active {
        background: #5c2698;
        color: #fff;
        border-color: #5c2698;
    }
}

/* Grid — darbojas gan arhīvā, gan šortkodā */
.space-offers-archive-items,
.space-shortcode-wrap .space-offers-archive-items {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    max-width: 100%;
    overflow: visible;
    float: none !important;
}
.bcard-item,
.space-offers-archive-items > div {
    width: 100% !important;
    min-width: 0;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}
/* Pārrakstīt Mercury float stilus */
.space-offers-archive-items .box-20,
.space-offers-archive-items .bonus-item.box-20,
.space-offers-archive-items .space-offers-archive-item {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Card */
.bcard {
    background: #fff;
    border: 1px solid #eaedf0;
    border-radius: 16px;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.bcard:hover {
    border-color: #c4b5fd;
    box-shadow: 0 8px 24px rgba(92,38,152,0.1);
    transform: translateY(-3px);
}

/* Header — casino row */
.bcard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafbfc;
}
.bcard-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #eaedf0;
    flex-shrink: 0;
}
.bcard-casino {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.bcard-casino-name {
    font-size: 0.82em;
    font-weight: 700;
    color: #151515;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bcard-casino-rating {
    font-size: 0.72em;
    font-weight: 700;
    color: #f59e0b;
    flex-shrink: 0;
}
.bcard-badge-row {
    padding: 0 16px;
    margin: 10px 0 0;
}
.bcard-badge {
    display: inline-flex;
    padding: 3px 10px;
    background: linear-gradient(135deg, #5c2698, #e84393);
    color: #fff;
    font-size: 0.6em;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Title — bonus name */
.bcard-title {
    padding: 14px 18px 0;
    font-size: 1.05em;
    font-weight: 800;
    color: #151515;
    line-height: 1.3;
}

/* Description */
.bcard-desc {
    padding: 8px 18px 0;
    font-size: 0.85em;
    color: #555;
    line-height: 1.55;
    flex: 1;
}
.bcard-desc p { margin: 0; }

/* Bonus code */
.bcard-code {
    margin: 12px 18px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0ecf9;
    border: 1px dashed #c4b5fd;
    border-radius: 8px;
}
.bcard-code-label {
    font-size: 0.72em;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.bcard-code-value {
    font-size: 0.9em;
    font-weight: 800;
    color: #5c2698;
    letter-spacing: 0.1em;
    font-family: monospace, 'Roboto', sans-serif;
}

/* Valid date */
.bcard-valid {
    padding: 8px 18px 0;
    font-size: 0.72em;
    color: #999;
}

/* Footer — button + tc */
.bcard-footer {
    padding: 14px 18px 16px;
    margin-top: auto;
}
.bcard-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff !important;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}
.bcard-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16,185,129,0.35);
}
.bcard-btn i { font-size: 0.9em; }

/* T&C toggle */
.bcard-tc {
    margin-top: 10px;
    font-size: 0.78em;
}
.bcard-tc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #7f8c8d;
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 600;
}
.bcard-tc-toggle:hover { color: #5c2698; }
.bcard-tc-toggle i {
    font-size: 0.7em;
    transition: transform 0.2s;
}
.bcard-tc.open .bcard-tc-toggle i {
    transform: rotate(180deg);
}
.bcard-tc-content {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 0.92em;
    color: #666;
    line-height: 1.55;
}
.bcard-tc.open .bcard-tc-content {
    display: block;
}
.bcard-tc-content p { margin: 0 0 4px; }

/* Notice */
.bcard-notice {
    margin-top: 8px;
    font-size: 0.75em;
    color: #999;
    line-height: 1.4;
}
.bcard-notice p { margin: 0; }

/* ============================================
   LOAD MORE — rādīt tikai pirmos 24
   ============================================ */
.space-offers-archive-items > .bcard-item:nth-child(n+25) {
    display: none;
}
.space-offers-archive-items.show-all > .bcard-item:nth-child(n+25) {
    display: block;
}
.bcard-load-more-wrap {
    text-align: center;
    margin: 28px 0 8px;
}
.bcard-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 36px;
    background: #fff;
    border: 2px solid #5c2698;
    color: #5c2698;
    border-radius: 10px;
    font-size: 0.92em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.bcard-load-more:hover {
    background: #5c2698;
    color: #fff;
}
.bcard-load-more svg {
    transition: transform 0.2s;
}
.bcard-load-more.is-expanded svg {
    transform: rotate(180deg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 1200px) {
    .space-offers-archive-items {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media screen and (max-width: 900px) {
    .space-offers-archive-items {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media screen and (max-width: 600px) {
    .space-offers-archive-items {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .bcard-header { padding: 12px 14px 10px; }
    .bcard-title { padding: 12px 14px 0; font-size: 1em; }
    .bcard-desc { padding: 6px 14px 0; }
    .bcard-footer { padding: 12px 14px 14px; }
}
