/* Moved from child theme: custom-carousel.css */
/* Garante que o widget possa "vazar" da coluna do Elementor */
.elementor-widget-custom_carousel .elementor-widget-container {
    overflow: visible !important;
}

.custom-carousel-container {
    position: relative;
    width: 100%;
}

.custom-carousel-wrapper {
    position: relative;
    width: 100%;
    --carousel-item-width-desktop: calc(100% / 3.4);
    --carousel-item-width-mobile: calc(100% / 1.4);
}

.custom-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.custom-carousel-wrapper.show-right .custom-carousel {
    -webkit-mask-image: linear-gradient(to right, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, black 95%, transparent 100%);
}

.custom-carousel .carousel-item {
    flex: 0 0 var(--carousel-item-width-desktop);
    padding-right: 10px;
    box-sizing: border-box;
    text-align: center;
    scroll-snap-align: start;
    position: relative;
}

.custom-carousel .course-link {
    display: block;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    transform: translateZ(0);
}

/* Wrapper da imagem: segue o raio do card e controla os overlays */
.custom-carousel .image-wrap {
    border-radius: inherit;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Borda no hover acima de tudo, sem ser cortada pelo overlay/escala */
.custom-carousel .image-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--e-global-color-primary, var(--fm-primary, #F9025B));
    opacity: 0;
    pointer-events: none;
    z-index: 6;
    transition: opacity 0.2s ease;
}
.custom-carousel .course-link:hover .image-wrap::after { opacity: 1; }

.custom-carousel .carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s, filter 0.3s;
}

/* Escala apenas quando se passa o mouse na área da imagem */
.custom-carousel .image-wrap:hover img {
    filter: brightness(0.8);
    transform: scale(1.04);
    transform-origin: center center;
    will-change: transform;
}
.custom-carousel .carousel-item.grayscale img { filter: grayscale(100%); }

.custom-carousel-wrapper .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s, opacity 0.3s;
}

.custom-carousel-wrapper .arrow.left { left: -40px; }
.custom-carousel-wrapper .arrow.right { right: -40px; }
.custom-carousel-wrapper .arrow:hover { background-color: rgba(255, 255, 255, 0.295); color: black; }
.custom-carousel-wrapper:not(.show-left) .arrow.left,
.custom-carousel-wrapper:not(.show-right) .arrow.right { opacity: 0.3; }

.nav-display-dots .arrow,
.nav-display-none .arrow { display: none; }
.nav-display-arrows .carousel-dots,
.nav-display-none .carousel-dots { display: none; }
.custom-carousel-wrapper:not(.has-arrows) .arrow { display: none; }

.custom-carousel::-webkit-scrollbar { display: none; }

.custom-carousel .lock-icon,
.custom-carousel .hourglass-icon {
    position: absolute; top: 10px; right: 10px;
    font-size: 18px; z-index: 5;
}
.hide-comments { display: none !important; }
.custom-carousel .icon-background {
    color: #4a4a4a; background-color: rgba(0, 0, 0, 0.5); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
}

/* Cadeado minimalista: maior, sem background, usa cor primária */
.custom-carousel .lock-icon {
    background: none;
    border-radius: 0;
    width: auto; height: auto;
    font-size: 24px; /* ~30% maior que 18px */
}
.custom-carousel .lock-icon .icon-color { color: var(--e-global-color-primary, var(--fm-primary, #F9025B)); }

.carousel-item-footer {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 15px;
    z-index: 3;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-sizing: border-box;
    border-radius: inherit;
}
.carousel-item-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 80%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.carousel-item-content { position: relative; z-index: 2; color: #ffffff; }
.course-title { margin: 0 0 5px 0; font-size: 1.1em; font-weight: bold; }
.lesson-count { font-size: 0.9em; opacity: 0.9; }

.elementor-widget-custom_carousel.footer-display-hover .carousel-item-footer { opacity: 0; transform: translateY(0); }
.elementor-widget-custom_carousel.footer-display-hover .course-link:hover .carousel-item-footer { opacity: 1; transform: translateY(0); bottom: 8px; }
.elementor-widget-custom_carousel.footer-display-hover .carousel-item-overlay {  opacity: 0; }
.elementor-widget-custom_carousel.footer-display-hover .course-link:hover .carousel-item-overlay {  opacity: 1; }

/* Visualização do cadeado: aparece somente ao passar o mouse */
.elementor-widget-custom_carousel.lock-display-hover .lock-icon {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.elementor-widget-custom_carousel.lock-display-hover .course-link:hover .lock-icon {
    opacity: 1;
}

/* Visualização do preto e branco: hover ou fixo */
.elementor-widget-custom_carousel.grayscale-display-hover .custom-carousel .carousel-item.grayscale img {
    filter: none;
    transition: filter 0.3s ease;
}
.elementor-widget-custom_carousel.grayscale-display-hover .custom-carousel .carousel-item.grayscale:hover img {
    filter: grayscale(100%) brightness(0.8);
}

/* Suaviza o zoom no modo "Preto e Branco" em hover */
.elementor-widget-custom_carousel.grayscale-display-hover .custom-carousel .carousel-item img {
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform, filter;
}
.elementor-widget-custom_carousel.grayscale-display-hover .custom-carousel .carousel-item:hover img {
    transform: scale(1.02);
}

.carousel-dots { text-align: center; padding-top: 15px; }
.custom-carousel-container:not(.has-dots) .carousel-dots { display: none; }
.carousel-dots .dot { display: inline-block; width: 10px; height: 10px; background-color: #ccc; border-radius: 50%; margin: 0 5px; cursor: pointer; transition: background-color 0.3s, opacity 0.3s; }
.carousel-dots .dot.active { background-color: white; }
.carousel-dots .dot:not(.active):hover { opacity: 0.7; }

@media (max-width: 768px) {
    .custom-carousel .carousel-item { flex: 0 0 var(--carousel-item-width-mobile); }
    .custom-carousel-wrapper .arrow.left { left: -15px; }
    .custom-carousel-wrapper .arrow.right { right: -5px; }
}

.custom-modal { display: none; position: fixed; z-index: 99999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.custom-modal-content { background-color: #fefefe; margin: 15% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; text-align: center; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; }
.custom-close { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; }
.custom-close:hover, .custom-close:focus { color: black; text-decoration: none; cursor: pointer; }
.modal-header { display: flex; flex-direction: column; align-items: center; margin-bottom: 15px; }
.modal-header .hourglass-icon { width: 50px; height: auto; margin-bottom: 10px; }
.modal-body #modalReleaseDate { font-weight: bold; }

/* Unlock popup content */
.unlock-content { max-height: calc(12 * 1.4em); overflow-y: auto; text-align: left; margin: 10px 0; padding-right: 6px; }
.unlock-content-list { list-style: none; padding: 0; margin: 0; }
.unlock-content-list li { line-height: 1.4; margin: 4px 0; }
.unlock-content-list li.module { font-weight: 600; }
.unlock-content-list li.lesson i { margin-right: 6px; color: #16a34a; }
/* Modern scrollbar */
.unlock-content::-webkit-scrollbar { width: 10px; }
.unlock-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 8px; }
.unlock-content::-webkit-scrollbar-thumb { background: #c8c8c8; border-radius: 8px; }
.unlock-content::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }
.unlock-content { scrollbar-color: #c8c8c8 #f1f1f1; scrollbar-width: thin; }

/* Unlock button */
.custom-modal .elementor-button.unlock-btn { background-color: #16a34a !important; border-color: #16a34a !important; color: #fff !important; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.custom-modal .elementor-button.unlock-btn:hover { filter: brightness(1.05); }

/* Descrição do curso no modal */
#modalCourseDescription.desc-align-center { text-align: center; }
#modalCourseDescription.desc-align-start { text-align: left; }
#modalCourseDescription.line-clamp-5 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
#modalCourseDescription.expanded { display: block; overflow: visible; max-height: none; }
@supports not (-webkit-line-clamp: 5) {
  #modalCourseDescription.line-clamp-5 { max-height: calc(5 * 1.4em); }
}
.modal-desc-toggle { background: transparent; border: none; color: var(--e-global-color-primary, var(--fm-primary, #F9025B)); cursor: pointer; font-weight: 600; }
.modal-desc-toggle:hover { filter: brightness(1.05); }

.fm-search-widget-container { display: inline-block; position: relative; width: auto; max-width: none; }
.fm-search-trigger { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid currentColor; border-radius: 50%; background: transparent; cursor: pointer; color: #555; font-size: 18px; transition: background-color 0.2s ease; }
.fm-search-trigger:hover { background: var(--e-global-color-principal, var(--e-global-color-primary, #3b82f6)); }

/* Overlay em tela cheia */
.fm-search-overlay { display: none; position: fixed; inset: 0; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 9999; }

/* Popup centralizado com overlay */
.fm-search-popover { display: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 640px; max-width: 92vw; background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; box-shadow: 0 12px 32px rgba(2,8,23,.20); z-index: 10000; }
.fm-search-popover-content { padding: 16px; }
.fm-search-popover-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fm-search-popover-header .fm-search-input { flex: 1; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-size: 16px; outline: none; background-color: #fff; }
.fm-search-popover-close { background: transparent; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #666; }
.fm-search-popover-close:hover { color: #222; }
.fm-search-popover-body { max-height: 70vh; overflow-y: auto; padding-right: 6px; }

/* Bloqueia scroll do body quando popup aberto */
body.fm-modal-open { overflow: hidden; }

/* Estilos dos resultados (mantidos) */

@media (max-width: 480px) {
  .fm-search-popover { width: 94vw; border-radius: 12px; }
  .fm-search-popover-header .fm-search-input { font-size: 16px; }
}
#fm-search-results-container .result-item { display: flex; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: inherit; transition: background-color 0.2s; }
#fm-search-results-container .result-item:hover { background-color: #f9f9f9; }
#fm-search-results-container .result-item:last-child { border-bottom: none; }
.result-item-thumb { flex-shrink: 0; width: 80px; height: 80px; object-fit: cover; border-radius: 8px; margin-right: 15px; }
.result-thumb-wrap { position: relative; flex-shrink: 0; width: 80px; height: 80px; border-radius: 8px; margin-right: 15px; overflow: hidden; }
.result-thumb-wrap .result-item-thumb { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.result-thumb-wrap .lock-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(2, 8, 23, 0.35); color: var(--e-global-color-primary, var(--fm-primary, #F9025B)); }
.result-item-info .course-title { font-weight: bold; font-size: 1.1em; margin: 0; }
.result-item-info .topic-subtitle, .result-item-info .lesson-subtitle { font-size: 0.9em; color: #666; margin-top: 5px; }
.result-item-info .lesson-subtitle { padding-left: 15px; position: relative; }
.result-item-info .lesson-subtitle::before { content: '↳'; position: absolute; left: 0; top: 0; }
/* Destaque visual de correspondência na busca */
.fm-highlight { background-color: #fde68a; color: #111; padding: 0 2px; border-radius: 3px; }
/* ===== Custom additions (overlay unify, center lock, hover outline) ===== */
.custom-carousel .course-link.center-lock .lock-icon,
.custom-carousel .course-link.center-lock .hourglass-icon {
    top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%);
}
/* A borda foi movida para ::after acima para melhor visibilidade */
/* ===== Free Members: alinhamento da seção de cursos bloqueados ===== */
/* Seção de cursos bloqueados abaixo da grade, seguindo proporções do Tutor */
#fm-locked-courses { margin-top: 38px; }
#fm-locked-courses > h2 { margin: 0 0 12px; font-size: 1.25rem; font-weight: 600; }
#fm-locked-courses .tutor-card.fm-locked-card .tutor-card-image-top { border-top-left-radius: inherit; border-top-right-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; overflow: hidden; position: relative; }
#fm-locked-courses .tutor-card.fm-locked-card .tutor-card-image-top img { width: 100%; display: block; filter: none; border-radius: 0; }
#fm-locked-courses .tutor-card.fm-locked-card .fm-lock-icon { position: absolute; top: 10px; right: 10px; z-index: 5; font-size: 18px; color: var(--fm-primary, #0f172a); }
#fm-locked-courses > h2 .fm-title-lock { margin-right: 8px; color: var(--fm-primary, #0f172a); }
#fm-locked-courses .elementor-button.unlock-btn, #fm-locked-courses .tutor-btn.tutor-btn-primary.unlock-btn { background-color: #16a34a !important; border-color: #16a34a !important; color: #fff !important; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#fm-locked-courses .tutor-card.fm-locked-card .tutor-mt-24 { display: flex; justify-content: center; }
#fm-locked-courses .tutor-card.fm-locked-card .tutor-card-body { padding: 16px; }
#fm-locked-courses .tutor-card.fm-locked-card .tutor-btn.tutor-btn-primary { display: inline-flex; align-items: center; gap: 8px; }

/* Oculta barra de ordenação/filtros do arquivo de cursos Tutor */
.tutor-course-archive-topbar,
.tutor-course-archive-sorting,
.tutor-course-ordering,
.tutor-course-archive-filterbar,
.tutor-course-filter,
.tutor-course-archive-header .tutor-form-select {
    display: none !important;
}
