/**
 * Bundle Cards Grid Styles
 * Save this as: assets/bundle-cards-style.css
 */

.msbb-bundle-cards-grid {
    --msbb-cards-primary: #4eb114;
    --msbb-cards-primary-dark: #3d8f0f;

    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.msbb-cards-empty {
    color: #5c6b58;
    font-size: 14px;
}

.msbb-bundle-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    flex: 1 1 calc(25% - 18px);
    max-width: calc(25% - 18px);
    aspect-ratio: 3 / 4;
    min-height: 260px;
    border-radius: 16px;
    overflow: hidden;
    background-color: #1c2b18;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: msbbCardIn 0.6s ease both;
}

.msbb-bundle-card--noimage {
    background-image: linear-gradient(135deg, var(--msbb-cards-primary) 0%, #1c2b18 100%);
}

.msbb-bundle-card:hover,
.msbb-bundle-card:focus-visible,
.msbb-bundle-card:focus-within {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.msbb-bundle-card:focus-visible {
    outline: 3px solid white;
    outline-offset: -6px;
}

.msbb-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.78) 100%);
    transition: opacity 0.3s ease;
}

.msbb-bundle-card:hover .msbb-card-overlay,
.msbb-bundle-card:focus-visible .msbb-card-overlay,
.msbb-bundle-card:focus-within .msbb-card-overlay {
    opacity: 0.9;
}

.msbb-card-palm {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 54px;
    height: 54px;
    color: rgba(255, 255, 255, 0.6);
    transform: rotate(-8deg);
    transform-origin: bottom center;
    transition: transform 0.4s ease, color 0.4s ease;
}

.msbb-bundle-card:hover .msbb-card-palm,
.msbb-bundle-card:focus-visible .msbb-card-palm,
.msbb-bundle-card:focus-within .msbb-card-palm {
    transform: rotate(6deg) scale(1.08);
    color: rgba(255, 255, 255, 0.9);
}

.msbb-card-palm svg {
    width: 100%;
    height: 100%;
}

.msbb-card-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 20px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.msbb-card-content,
.msbb-card-content-link {
    position: relative;
    z-index: 1;
    width: 100%;
}

.msbb-card-content-link .msbb-card-title {
    position: static;
}

.msbb-card-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 20px;
    pointer-events: none;
    z-index: 3;
}

.msbb-card-content .msbb-card-title {
    padding: 0;
    margin: 0;
    line-height: 1.25;
}

.msbb-card-main-link {
    position: absolute;
    z-index: 2;
    inset: 0;
}

.msbb-card-main-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
}

.msbb-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
}

.msbb-bundle-card--fixed:hover .msbb-card-actions,
.msbb-bundle-card--fixed:focus-within .msbb-card-actions {
    opacity: 1;
    transform: translateY(0);
}

.msbb-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    min-height: 48px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.msbb-card-action svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.msbb-card-action:hover svg {
    transform: scale(1.12);
}

.msbb-card-tooltip {
    position: absolute;
    display: block;
    right: 50%;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 140px;
    padding: 6px 8px;
    border-radius: 5px;
    background: #111;
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(50%, 4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.msbb-card-action:hover .msbb-card-tooltip,
.msbb-card-action:focus-visible .msbb-card-tooltip {
    opacity: 1;
    transform: translate(50%, 0);
}

.msbb-card-action.is-loading svg {
    opacity: 0.55;
}

.msbb-card-action--primary {
    background: var(--msbb-cards-primary);
    color: #fff;
}

.msbb-card-action--primary:hover {
    background: var(--msbb-cards-primary-dark);
    color: #fff;
}

.msbb-card-action:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.msbb-card-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.msbb-card-status {
    grid-column: 1 / -1;
    min-height: 18px;
    margin: 8px 0 0;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
}

.msbb-card-status:empty { display: none; }

.msbb-card-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.msbb-bundle-card:hover .msbb-card-arrow,
.msbb-bundle-card:focus-visible .msbb-card-arrow,
.msbb-bundle-card:focus-within .msbb-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

@keyframes msbbCardIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .msbb-bundle-card {
        flex-basis: calc(33.333% - 16px);
        max-width: calc(33.333% - 16px);
    }
}

@media (max-width: 900px) {
    .msbb-bundle-card {
        flex-basis: calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

@media (max-width: 560px) {
    .msbb-bundle-cards-grid {
        gap: 16px;
    }

    .msbb-bundle-card {
        flex-basis: 100%;
        max-width: 100%;
        aspect-ratio: 4 / 3;
    }

    .msbb-bundle-card--fixed {
        min-height: clamp(400px, 125vw, 520px);
        aspect-ratio: 4 / 5;
        background-position: center;
    }

    .msbb-bundle-card--fixed .msbb-card-content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        padding: 20px;
    }

    .msbb-bundle-card--fixed .msbb-card-title {
        min-width: 0;
        margin: 0;
        padding: 0;
        line-height: 1.25;
    }

    .msbb-bundle-card--fixed .msbb-card-actions {
        opacity: 1;
        transform: none;
    }

    .msbb-bundle-card--fixed .msbb-card-status {
        grid-column: 1 / -1;
        margin: 0;
    }

    .msbb-bundle-card--fixed .msbb-card-status:empty,
    .msbb-bundle-card--fixed .msbb-card-tooltip {
        display: none;
    }
}

@media (hover: none) {
    .msbb-card-actions {
        opacity: 1;
        transform: none;
    }

    .msbb-card-tooltip {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .msbb-bundle-card {
        animation: none;
        opacity: 1;
        transition: none;
    }

    .msbb-bundle-card:hover,
    .msbb-bundle-card:focus-visible {
        transform: none;
    }

    .msbb-card-palm,
    .msbb-bundle-card:hover .msbb-card-palm,
    .msbb-bundle-card:focus-visible .msbb-card-palm {
        transform: none;
        transition: none;
    }

    .msbb-card-arrow,
    .msbb-bundle-card:hover .msbb-card-arrow,
    .msbb-bundle-card:focus-visible .msbb-card-arrow {
        opacity: 1;
        transform: none;
    }

    .msbb-card-actions,
    .msbb-card-action svg,
    .msbb-card-tooltip {
        transition: none;
    }
}
