/*
 * BFree Classes Discovery - Premium Styles
 * Gradient based on reference: purple to magenta/orange bottom left
 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap');

.bfree-classes-container {
    padding: 20px 0;
    font-family: inherit;
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

/* FILTERS */
.bfree-classes-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.bfree-filter-btn {
    background: transparent;
    border: 2px solid #07BEB8;
    color: #07BEB8;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bfree-filter-btn:hover {
    background: rgba(7, 190, 184, 0.1);
}

.bfree-filter-btn.is-active {
    background: #07BEB8;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(7, 190, 184, 0.3);
}


.bfree-class-item {
    cursor: pointer;
    margin: 8px 0;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), color 0.3s ease;
}

.bfree-class-item h3 {
    margin: 0;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: right;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: color 0.3s ease;
}

/* Hide Utility via Data Attribute */
.bfree-class-item[data-hidden="true"] {
    display: none !important;
}

.bfree-class-item.bfree-btn-hidden {
    display: none !important;
}

.bfree-class-item:hover {
    transform: scale(1.05);
}

.bfree-class-item:hover h3 {
    color: #ffd700;

    /* Yellow highlight like "Y MÁS..." */
    /*letter-spacing: 2px;*/
}

@media (max-width: 768px) {
    .bfree-class-item h3 {
        font-size: 1.8rem;
        text-align: center;
    }
}

/* BOTTOM SHEET DRAWER */
.bfree-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.4s, opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bfree-drawer.is-open {
    visibility: visible !important;
    opacity: 1 !important;
    transition: visibility 0s linear 0s, opacity 0.4s ease;
}

.bfree-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.bfree-drawer-content {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    /* Constraints for desktop */
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
    padding: 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.25, 1);
    display: flex;
    flex-direction: column;
    max-height: 100vh;
}

.bfree-drawer.is-open .bfree-drawer-content {
    transform: translateY(0);
}

/* DRAWER INNER STYLES */
.bfree-drawer-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #4a4a4a;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease;
}

.bfree-drawer-close:hover {
    transform: scale(1.1) rotate(90deg);
}

.bfree-drawer-header h2 {
    font-size: 2rem;
    color: #aa4b84;
    font-weight: 800;
    margin-bottom: 1rem;
    margin-top: 0;
}

.bfree-drawer-body {
    overflow-y: auto;
    padding-right: 10px;
}

.bfree-drawer-desc {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.bfree-drawer-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bfree-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
    background: #f8f8f8;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
}

.bfree-drawer-instructor h4 {
    margin: 0 0 1rem 0;
    color: #7c5ca8;
    font-weight: 800;
}

.bfree-inst-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bfree-inst-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.bfree-inst-card span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.bfree-inst-more-btn {
    background: transparent;
    border: 1px solid #07BEB8;
    color: #07BEB8;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
}

.bfree-inst-more-btn:hover {
    background: #07BEB8;
    color: white;
}

.bfree-inst-desc {
    display: none;
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #555;
    background: #fdfdfd;
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid #dfa04c;
}

.bfree-inst-desc.is-open {
    display: block;
}

.bfree-drawer-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.bfree-btn-reserve {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(90deg, #aa4b84, #dfa04c);
    color: white;
    text-align: center;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 5px 15px rgba(170, 75, 132, 0.4);
}

.bfree-btn-reserve:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(170, 75, 132, 0.6);
}

/* MEDIA BOX (Gallery & Video) */
.bfree-drawer-media {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bfree-media-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 10px;
    /* Hide scrollbar for cleaner look */
    scrollbar-width: thin;
}

.bfree-media-gallery::-webkit-scrollbar {
    height: 6px;
}

.bfree-media-gallery::-webkit-scrollbar-thumb {
    background-color: #dfa04c;
    border-radius: 4px;
}

.bfree-media-gallery img {
    scroll-snap-align: start;
    flex: 0 0 calc(100% - 20px);
    /* 1 at a time on mobile, or 2 on larger */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (min-width: 600px) {
    .bfree-media-gallery img {
        flex: 0 0 calc(50% - 10px);
    }
}

.bfree-media-video {
    position: relative;
    aspect-ratio: 9 / 16;
    /* Vertical Short */
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 240px;
    width: 100%;
    background: #000;
}

.bfree-media-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Desktop: video floats right beside content */
@media (min-width: 600px) {
    .bfree-drawer-body-inner {
        display: flex;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .bfree-drawer-body-text {
        flex: 1;
        min-width: 0;
    }

    .bfree-drawer-body-video {
        flex: 0 0 220px;
    }

    .bfree-media-video {
        max-width: 220px;
        width: 220px;
    }
}

/* Mobile: video full width, stacked below text */
@media (max-width: 599px) {
    .bfree-drawer-footer {
        margin-top: 0.5rem;
        padding-top: 0.4rem;
        border-top: 0px solid #eee;
    }

    .bfree-drawer-body-inner {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .bfree-btn-reserve {
        padding: 0.8rem;
        font-size: 0.8rem;
    }

    .bfree-media-video {
        max-width: 100%;
        margin: 0 auto;
    }

    .bfree-drawer-content {
        padding: 1rem;
    }
}

@media (min-width: 800px) {
    .bfree-drawer-content {
        border-radius: 24px;
        margin-bottom: 5vh;
    }

    .bfree-drawer {
        justify-content: center;
    }
}

/* Note: Amelia dialog bottom sheet overrides have been moved directly into
   ameliabooking/v3/public/assets/eventCalendarForm.ff89c63b.css */

/* BFree "+ Info" button injected into Amelia popups via JS */
.bfree-amelia-more-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: transparent;
    color: var(--am-c-primary, #a855f7);
    border: 1.5px solid var(--am-c-primary, #a855f7);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.bfree-amelia-more-btn:hover {
    background: var(--am-c-primary, #a855f7);
    color: #fff;
}

/* Modifying BFree Drawer when opened from Amelia */
.bfree-drawer.opened-from-amelia #bfree-drawer-reserve-buttons {
    display: none !important;
}

.bfree-btn-back-amelia {
    display: none;
    width: 100%;
    padding: 1rem;
    background: #4a4a4a;
    color: white;
    text-align: center;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.2s;
}

.bfree-btn-back-amelia:hover {
    background: #333;
}

.bfree-drawer.opened-from-amelia .bfree-btn-back-amelia {
    display: block !important;
}

/* Ensure BFree Drawer overlaps Amelia popup (Amelia uses z-index: 99999999) */
.bfree-drawer.opened-from-amelia {
    z-index: 999999999 !important;
}

/* Also raise base z-index of any open BFree drawer above Amelia */
.bfree-drawer[style*="display: flex"],
.bfree-drawer[style*="display:flex"] {
    z-index: 999999999 !important;
}

/* =========================================================
   AMELIA POPUP BOTTOM SHEET OVERRIDES
   Real DOM structure (Element Plus / Vue 3):
     .el-overlay.am-dialog-popup.amelia-v2-booking.am-dialog-el  (overlay)
       .el-overlay-dialog
         .el-dialog  (the actual dialog box — only ONE, not nested)
           .el-dialog__header
           .el-dialog__body
             .am-dialog-el__main-container
   ========================================================= */

/* Bottom sheet: pin dialog to bottom of viewport */
.el-overlay.amelia-v2-booking.am-dialog-el .el-dialog {
    margin: 0 auto !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 600px !important;
    border-radius: 24px 24px 0 0 !important;
    transform: translateY(0) !important;
    top: auto !important;
    max-height: 85vh !important;
    height: auto !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3) !important;
}

/* Body scrollable */
.el-overlay.amelia-v2-booking.am-dialog-el .el-dialog__body {
    overflow-y: auto !important;
    padding-bottom: 30px !important;
}

/* Hide tabs and description (empty "Información del evento" tab) */
.el-overlay.amelia-v2-booking.am-dialog-el .el-tabs__header,
.el-overlay.amelia-v2-booking.am-dialog-el .el-tabs__nav-scroll,
.el-overlay.amelia-v2-booking.am-dialog-el .el-tabs__nav,
.el-overlay.amelia-v2-booking.am-dialog-el .am-ec__info-tabs,
.el-overlay.amelia-v2-booking.am-dialog-el .am-ec__info-desc,
.el-overlay.amelia-v2-booking.am-dialog-el .am-ec__info-content {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Style the close button */
.el-overlay.amelia-v2-booking.am-dialog-el .el-dialog__headerbtn {
    top: 12px !important;
    right: 16px !important;
    font-size: 20px !important;
    z-index: 10 !important;
}

.el-overlay.amelia-v2-booking.am-dialog-el .el-dialog__close {
    color: var(--am-c-main-text, #333) !important;
    font-weight: bold !important;
}

/* Mobile: limit popup height so booking buttons are visible */
@media (max-width: 768px) {
    .el-overlay.amelia-v2-booking.am-dialog-el .el-dialog {
        max-height: 100vh !important;
    }

    .el-overlay.amelia-v2-booking.am-dialog-el .el-dialog__body {
        max-height: 100vh !important;
        overflow-y: auto !important;
    }
}


.bfree-classes-list {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: linear-gradient(135deg, #7c5ca8 0%, #aa4b84 50%, #dfa04c 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    height: 550px;
    overflow: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.bfree-classes-deco-img {
    flex: 0 0 43%;
    margin-right: -15%;
    z-index: 1;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    /* apila texto arriba, imagen abajo */
    align-items: flex-start;
    /* alineado a la izquierda */
    justify-content: space-between;
}

.bfree-classes-deco-title {
    color: #ffffff;
    font-family: 'DM Serif Display', sans-serif;
    font-size: 3.5rem;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    padding: 2rem 0 0 2rem;
    line-height: 0.9;
    /* letter-spacing: 1px; */
}

@keyframes bfree-float {
    0% {
        transform: translateY(0px) rotate(1deg);
    }

    50% {
        transform: translateY(-25px) rotate(-6deg);
    }

    100% {
        transform: translateY(0px) rotate(1deg);
    }
}

.bfree-classes-deco-img img {
    width: 100%;
    height: auto;
    max-height: 77%;
    object-fit: contain;
    object-position: center top;
    display: block;
    padding-bottom: 3%;
    transform-origin: center bottom;
    animation: bfree-float 13s ease-in-out infinite;
}

.bfree-classes-items {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    z-index: 0;
}

@media (max-width: 768px) {
    .bfree-classes-deco-img {
        display: none;
    }

    .bfree-classes-list {
        height: auto;
        max-height: 70vh;
    }

    .bfree-classes-items {
        padding: 2rem 0.5rem;
    }
}