/* ============================================================
   Bald Grid & Slider — Frontend Styles
   Designed to match dark purple card UI (see reference image)
   ============================================================ */

.bgs-widget, .bgs-widget * { box-sizing: border-box; }

/* ── Filter Bar ─────────────────────────────────────────────── */
.bgs-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding: 10px 0;
}

.bgs-filter-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.bgs-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
}

/* ── Each tab: rectangular, collapsed borders ── */
.bgs-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(138, 93, 210, 0.55);
    border-right-width: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    line-height: 1.2;
    outline: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
    min-width: 110px;
    position: relative;
}

.bgs-filter-btn:first-child {
    border-radius: 6px 0 0 6px;
}
.bgs-filter-btn:last-child {
    border-right-width: 1px;
    border-radius: 0 6px 6px 0;
}
.bgs-filter-btn:first-child:last-child {
    border-radius: 6px;
    border-right-width: 1px;
}

.bgs-filter-btn__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.75;
}
.bgs-filter-btn__icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
}

/* Hover */
.bgs-filter-btn:hover {
    background: rgba(138, 93, 210, 0.18);
    color: #ffffff;
    border-color: rgba(138, 93, 210, 0.9);
    z-index: 1;
}

/* Active — subtle purple tint + brighter border, no solid fill */
.bgs-filter-btn.is-active {
    background: rgba(138, 93, 210, 0.22);
    color: #ffffff;
    border-color: rgba(160, 110, 230, 0.95);
    border-right-width: 1px;
    z-index: 2;
}
.bgs-filter-btn.is-active + .bgs-filter-btn {
    border-left-width: 0;
}

.bgs-filter-btn:focus-visible {
    outline: 2px solid rgba(160, 110, 230, 0.8);
    outline-offset: -2px;
    z-index: 3;
}

/* ── Grid ────────────────────────────────────────────────────── */
.bgs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ── Card ────────────────────────────────────────────────────── */
.bgs-card {
    background: #1e0f3c;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bgs-card--lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35) !important;
}

/* Image */
.bgs-card__image-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 60%;
    overflow: hidden;
    background: #2d1b4e;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.bgs-card__image-wrap a {
    position: absolute;
    inset: 0;
    display: block;
}

.bgs-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.bgs-card--lift:hover .bgs-card__image { transform: scale(1.05); }

/* Badge — top-right corner ribbon style */
.bgs-card__badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #a78bfa;
    color: #1a0a2e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 10px;
    /* diagonal ribbon clip */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 100%);
    border-radius: 0 12px 0 0;
    z-index: 2;
    min-width: 48px;
    text-align: right;
}

/* Body */
.bgs-card__body {
    padding: 16px 16px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

/* Category */
.bgs-card__cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    align-self: flex-start;
    backdrop-filter: blur(4px);
}

/* Title */
.bgs-card__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
}

.bgs-card__title a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}
.bgs-card__title a:hover { opacity: 0.8; }

/* Description */
.bgs-card__description {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.65);
    flex: 1;
    /* clamp to ~3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer: price + button */
.bgs-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.bgs-card__price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.bgs-card__price-prefix {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    font-weight: 400;
    line-height: 1;
}

.bgs-card__price-amount {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

/* Button */
.bgs-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 10px 20px;
    border-radius: 999px;
    background: #7c3aed;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.bgs-card__btn:hover {
    background: #5b21b6;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(124,58,237,0.45);
}

.bgs-card__btn:active { transform: scale(0.97); }

/* ── Filter Animations ──────────────────────────────────────── */
.bgs-widget[data-animation="fade"] .bgs-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}
.bgs-widget[data-animation="fade"] .bgs-card.bgs-hidden    { opacity: 0; pointer-events: none; visibility: hidden; }
.bgs-widget[data-animation="fade"] .bgs-card.bgs-visible   { opacity: 1; }

.bgs-widget[data-animation="slide-up"] .bgs-card {
    transition: transform 0.3s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}
.bgs-widget[data-animation="slide-up"] .bgs-card.bgs-hidden  { opacity: 0; transform: translateY(18px); pointer-events: none; visibility: hidden; }
.bgs-widget[data-animation="slide-up"] .bgs-card.bgs-visible { opacity: 1; transform: translateY(0); }

.bgs-widget[data-animation="zoom"] .bgs-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
.bgs-widget[data-animation="zoom"] .bgs-card.bgs-hidden  { opacity: 0; transform: scale(0.9); pointer-events: none; visibility: hidden; }
.bgs-widget[data-animation="zoom"] .bgs-card.bgs-visible { opacity: 1; transform: scale(1); }

.bgs-widget[data-animation="none"] .bgs-card.bgs-hidden { display: none; }

/* Grid: hide filtered-out cards properly */
.bgs-grid .bgs-card.bgs-hidden {
    position: absolute;
    width: 0; height: 0;
    overflow: hidden;
    padding: 0; margin: 0;
    border: 0;
}

/* ── Slider ─────────────────────────────────────────────────── */
.bgs-slider-wrap {
    position: relative;
}

.bgs-swiper {
    overflow: hidden;
    padding-bottom: 16px; /* space for arrows */
}

.bgs-swiper .swiper-wrapper { align-items: stretch; }
.bgs-swiper .swiper-slide   { height: auto; }

/* Arrow buttons */
.bgs-swiper-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    /* offset outside the slider edge */
}

.bgs-swiper-btn svg { stroke: #ffffff; flex-shrink: 0; }

.bgs-swiper-btn:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.6);
}

/* Position: right side only (like in the reference image) */
[class*="bgs-btn-prev-"] {
    right: 50px;
    left: auto;
}
[class*="bgs-btn-next-"] {
    right: 0;
    left: auto;
}

/* If you prefer outside arrows, uncomment:
[class*="bgs-btn-prev-"] { left: -22px; right: auto; }
[class*="bgs-btn-next-"] { right: -22px; left: auto; }
*/

/* Pagination */
.swiper-pagination { position: static; margin-top: 20px; }
.swiper-pagination-bullet {
    background: rgba(255,255,255,0.3);
    opacity: 1;
    width: 8px; height: 8px;
    transition: background 0.2s, transform 0.2s;
}
.swiper-pagination-bullet-active {
    background: #7c3aed;
    transform: scale(1.4);
}

/* Slider navigation positioned relative to slider wrap */
.bgs-slider-wrap { padding-right: 0; }
.bgs-slider-wrap .bgs-swiper-btn {
    top: auto;
    bottom: calc(100% + 8px); /* float above slider, top-right */
    transform: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .bgs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .bgs-grid { grid-template-columns: 1fr; }
    .bgs-filter-bar { gap: 8px; }
    .bgs-card__title { font-size: 17px; }
    .bgs-card__price-amount { font-size: 17px; }
}
