.aafe-bounce-image-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.aafe-bounce-image-content-wrapper h1,
.aafe-bounce-image-content-wrapper h2,
.aafe-bounce-image-content-wrapper h3,
.aafe-bounce-image-content-wrapper h4,
.aafe-bounce-image-content-wrapper h5,
.aafe-bounce-image-content-wrapper h6 {
    font-family: 'Inter Tight', sans-serif;
    color: #000;
}

.aafe-bounce-image-content-wrapper p,
.aafe-bounce-image-content-wrapper span,
.aafe-bounce-image-content-wrapper li,
.aafe-bounce-image-content-wrapper a,
.aafe-bounce-image-content__desc,
.aafe-bounce-image-content__label {
    font-family: 'Inter', sans-serif;
}

/* ============================================================
   HEADER
   ============================================================ */
.aafe-bounce-image-content__title {
    font-size: 52px;
    font-weight: 500;
    line-height: 1.1;
    margin: 0 0 15px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.aafe-bounce-image-content__header-desc {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 0 auto 40px auto;
    max-width: 600px;
}

@media (max-width: 1024px) {
    .aafe-bounce-image-content__title {
        font-size: 40px;
    }
}
@media (max-width: 767px) {
    .aafe-bounce-image-content__title {
        font-size: 30px;
    }
}

/* ============================================================
   GALLERY / FAN
   ============================================================ */
.aafe-bounce-image-content__gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 50px 0;
    padding: 30px 0 0 0; /* space for floating labels */
    perspective: 1000px;
}

.aafe-bounce-image-content__card-wrapper {
    position: relative;
    z-index: var(--aafe-z, 1);
    margin-left: -40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Required for label positioning */
}

.aafe-bounce-image-content__card-wrapper:hover {
    z-index: 999 !important; /* Fix overlap bug: bring hovered wrapper to absolute front */
}

.aafe-bounce-image-content__card-wrapper:first-child {
    margin-left: 0;
}

.aafe-bounce-image-content__card {
    width: 160px;
    height: 180px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform-origin: center 180%;
    transform: rotate(var(--aafe-rot-desktop, 0deg));
    transition: all var(--aafe-transition, 400ms) cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
    overflow: hidden;
    background: #e0e0e0;
}

@media (max-width: 1024px) {
    .aafe-bounce-image-content__card {
        transform: rotate(var(--aafe-rot-tablet, var(--aafe-rot-desktop, 0deg)));
    }
}
@media (max-width: 767px) {
    .aafe-bounce-image-content__card {
        transform: rotate(var(--aafe-rot-mobile, var(--aafe-rot-tablet, 0deg)));
    }
}

.aafe-bounce-image-content__card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    pointer-events: none; /* Prevent image drag */
}

/* Hover Effects on the Fan */
.aafe-bounce-image-content__gallery:hover .aafe-bounce-image-content__card-wrapper:hover .aafe-bounce-image-content__card {
    transform: rotate(0deg) translateY(var(--aafe-hover-lift, -20px)) scale(var(--aafe-hover-scale, 1.05));
    /* Box shadow is customizable in PHP, fallback included if not set */
}

/* Push other cards down slightly on hover */
.aafe-bounce-image-content__gallery:hover .aafe-bounce-image-content__card-wrapper:not(:hover) .aafe-bounce-image-content__card {
    filter: brightness(0.85);
}

/* ============================================================
   FLOATING LABELS
   ============================================================ */
.aafe-bounce-image-content__label-container {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%) translateY(var(--aafe-lbl-y, 20px)) scale(var(--aafe-lbl-s, 0.7));
    opacity: 0;
    visibility: hidden;
    z-index: 110; /* Make sure it pops over the hovered card */
    pointer-events: none;
    /* Springy bouncy animation */
    transition: all var(--aafe-lbl-dur, 500ms) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aafe-bounce-image-content__card-wrapper:hover .aafe-bounce-image-content__label-container {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(calc(var(--aafe-hover-lift, -20px) - 5px)) scale(1);
    pointer-events: auto;
}

.aafe-bounce-image-content__label {
    background-color: #000;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: default;
}

/* The little triangle pointer at the bottom of the label */
.aafe-bounce-image-content__label::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    /* The color is dynamically injected via PHP style controls, this is the fallback */
    border-top: 6px solid #000;
}

/* ============================================================
   DESCRIPTION
   ============================================================ */
.aafe-bounce-image-content__desc {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin: 0 auto 30px auto;
    max-width: 500px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.aafe-bounce-image-content__btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.aafe-bounce-image-content__btn1,
.aafe-bounce-image-content__btn2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--aafe-transition, 300ms) ease;
}

.aafe-bounce-image-content__btn1 {
    background-color: #1a1a1a;
    color: #fff;
}
.aafe-bounce-image-content__btn1:hover {
    background-color: #333;
    color: #fff;
}

.aafe-bounce-image-content__btn2 {
    background-color: #f5f5f5;
    color: #333;
}
.aafe-bounce-image-content__btn2:hover {
    background-color: #e0e0e0;
    color: #333;
}
