/**
 * WCFMd Delivery Showcase — layout tipo lista de comentários
 */

.wcfmd-showcase {
    margin: 24px 0;
    font-family: inherit;
}

.wcfmd-showcase__title {
    margin: 0 0 4px;
    font-size: 1.35em;
    font-weight: 600;
}

.wcfmd-showcase__subtitle {
    margin: 0 0 24px;
    color: #6b7280;
    font-size: 0.9em;
}

/* Lista vertical — cada item é um "comentário" */
.wcfmd-showcase__grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.wcfmd-showcase__item {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 16px;
    align-items: start;
}

/* Avatar circular com inicial do nome (cor gerada do nome) */
.wcfmd-showcase__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.15em;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

.wcfmd-showcase__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.wcfmd-showcase__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.wcfmd-showcase__name {
    font-weight: 600;
    font-size: 1em;
    color: #111827;
}

.wcfmd-showcase__date {
    font-size: 0.85em;
    color: #6b7280;
}

/* Foto grande da entrega */
.wcfmd-showcase__img-wrap {
    margin-top: 4px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
    max-width: 480px;
}

.wcfmd-showcase__img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Botão "Carregar mais" */
.wcfmd-showcase__load-more-wrap {
    margin-top: 28px;
    text-align: center;
}

.wcfmd-showcase__load-more {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wcfmd-showcase__load-more:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.wcfmd-showcase__load-more:disabled {
    opacity: 0.6;
    cursor: wait;
}

.wcfmd-showcase-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 32px 0;
}

/* Mobile */
@media (max-width: 600px) {
    .wcfmd-showcase__item {
        grid-template-columns: 44px 1fr;
        gap: 12px;
    }
    .wcfmd-showcase__avatar {
        width: 44px;
        height: 44px;
        font-size: 1em;
    }
    .wcfmd-showcase__img-wrap {
        max-width: 100%;
    }
}

/* =========================================================
   TRIGGERS COMPACTOS
   ========================================================= */

/* --- Ícone extra na galeria de fotos --- */
.wcfmd-showcase-gallery-icon {
    cursor: pointer;
    position: relative;
    list-style: none;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.15s ease;
}
.wcfmd-showcase-gallery-icon:hover { border-color: #111827; }
.wcfmd-showcase-gallery-icon__inner {
    position: relative;
    width: 100%;
    height: 100%;
}
.wcfmd-showcase-gallery-icon__inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.5);
}
.wcfmd-showcase-gallery-icon__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    text-align: center;
    padding: 4px;
}
.wcfmd-showcase-gallery-icon__overlay span {
    font-size: 0.7em;
    font-weight: 600;
    line-height: 1.1;
}

/* --- Botão flutuante sobre a foto principal --- */
.wcfmd-showcase-floating-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    background: rgba(17, 24, 39, 0.85);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.15s ease;
}
.wcfmd-showcase-floating-btn:hover {
    background: rgba(17, 24, 39, 1);
}

/* Precisa que o container da galeria seja relative pra o absoluto funcionar */
.woocommerce-product-gallery,
.wd-single-product-images {
    position: relative;
}

/* --- Carrossel abaixo --- */
.wcfmd-showcase-carousel {
    margin: 24px 0;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.wcfmd-showcase-carousel__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    gap: 12px;
}
.wcfmd-showcase-carousel__title {
    font-size: 1em;
    color: #111827;
}
.wcfmd-showcase-carousel__all {
    background: none;
    border: none;
    color: #4f46e5;
    font-size: 0.9em;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}
.wcfmd-showcase-carousel__all:hover { text-decoration: underline; }

.wcfmd-showcase-carousel__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px;
}
.wcfmd-showcase-carousel__track::-webkit-scrollbar { height: 6px; }
.wcfmd-showcase-carousel__track::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.wcfmd-showcase-carousel__thumb {
    flex: 0 0 110px;
    scroll-snap-align: start;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}
.wcfmd-showcase-carousel__thumb img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    transition: transform 0.15s ease;
}
.wcfmd-showcase-carousel__thumb:hover img {
    transform: scale(1.03);
}
.wcfmd-showcase-carousel__thumb-name {
    font-size: 0.75em;
    color: #6b7280;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */

.wcfmd-showcase-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wcfmd-showcase-lightbox[hidden] { display: none; }
.wcfmd-showcase-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}
.wcfmd-showcase-lightbox__panel {
    position: relative;
    background: #fff;
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    padding: 24px;
    padding-top: 56px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.wcfmd-showcase-lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
}
.wcfmd-showcase-lightbox__close:hover { background: #e5e7eb; }
.wcfmd-showcase-lightbox__title {
    position: absolute;
    top: 16px;
    left: 24px;
    font-weight: 600;
    font-size: 1.1em;
    color: #111827;
}
.wcfmd-showcase-lightbox__content {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-right: 8px;
}
.wcfmd-showcase-lightbox__item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wcfmd-showcase-lightbox__item img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    background: #f3f4f6;
}
.wcfmd-showcase-lightbox__item figcaption {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wcfmd-showcase-lightbox__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9em;
}
.wcfmd-showcase-lightbox__name {
    font-weight: 600;
    color: #111827;
}
.wcfmd-showcase-lightbox__date {
    color: #6b7280;
    font-size: 0.9em;
}
.wcfmd-showcase-lightbox__footer {
    padding-top: 16px;
    text-align: center;
}
.wcfmd-showcase-lightbox__more {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
}
.wcfmd-showcase-lightbox__more:hover:not(:disabled) { background: #e5e7eb; }
.wcfmd-showcase-lightbox__more:disabled { opacity: 0.6; cursor: wait; }

@media (max-width: 600px) {
    .wcfmd-showcase-lightbox__panel {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .wcfmd-showcase-carousel__thumb { flex-basis: 90px; }
    .wcfmd-showcase-carousel__thumb img { width: 90px; height: 90px; }
}

/* =========================================================
   CARROSSEL ABAIXO DA GALERIA (swap imagem principal)
   ========================================================= */

.wcfmd-showcase-below-gallery {
    margin: 16px 0 24px;
    padding: 0;
}
.wcfmd-showcase-below-gallery__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 12px;
}
.wcfmd-showcase-below-gallery__title {
    font-size: 0.95em;
    color: #111827;
    font-weight: 600;
}
.wcfmd-showcase-below-gallery__hint {
    font-size: 0.8em;
    color: #6b7280;
}

.wcfmd-showcase-below-gallery__track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 8px;
}
.wcfmd-showcase-below-gallery__track::-webkit-scrollbar { height: 6px; }
.wcfmd-showcase-below-gallery__track::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.wcfmd-showcase-below-gallery__thumb {
    flex: 0 0 90px;
    scroll-snap-align: start;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    position: relative;
}
.wcfmd-showcase-below-gallery__thumb img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid transparent;
}
.wcfmd-showcase-below-gallery__thumb:hover img {
    transform: scale(1.03);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.wcfmd-showcase-below-gallery__thumb.is-active img {
    border-color: #4f46e5;
}
.wcfmd-showcase-below-gallery__thumb-name {
    font-size: 0.7em;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

@media (max-width: 600px) {
    .wcfmd-showcase-below-gallery__thumb { flex-basis: 76px; }
    .wcfmd-showcase-below-gallery__thumb img { width: 76px; height: 76px; }
    .wcfmd-showcase-below-gallery__thumb-name { max-width: 76px; }
}

/* =========================================================
   SETAS DE NAVEGAÇÃO NO MODO SHOWCASE
   ========================================================= */

.wcfmd-showcase-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(17, 24, 39, 0.75);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.15s ease, transform 0.15s ease;
    backdrop-filter: blur(4px);
}
.wcfmd-showcase-arrow:hover {
    background: rgba(17, 24, 39, 0.95);
}
.wcfmd-showcase-arrow--prev { left: 12px; }
.wcfmd-showcase-arrow--next { right: 12px; }

/* Indicador visual sutil quando modo showcase está ativo */
.wcfmd-showcase-mode .wcfmd-showcase-below-gallery__title::after {
    content: ' · Navegando pelas entregas';
    color: #4f46e5;
    font-weight: 400;
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .wcfmd-showcase-arrow {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    .wcfmd-showcase-arrow--prev { left: 6px; }
    .wcfmd-showcase-arrow--next { right: 6px; }
}
