/* ============================================================
   Testimonial Marquee for Elementor — style.css
   ============================================================ */

/* Google Font (fallback if not loaded by PHP) */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;600;700&display=swap');

/* ── Wrapper & Track ── */
.tm-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 6%,
        black 94%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 6%,
        black 94%,
        transparent 100%
    );
}

.tm-track {
    display: flex;
    align-items: stretch;
    width: max-content;
    will-change: transform;
}

/* ── Marquee Animations ── */
@keyframes tm-scroll-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes tm-scroll-right {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.tm-track.tm-anim-left  { animation: tm-scroll-left  linear infinite; }
.tm-track.tm-anim-right { animation: tm-scroll-right linear infinite; }

/* Pause on hover */
.tm-wrapper.tm-pause-hover:hover .tm-track,
.tm-wrapper.tm-has-video-playing .tm-track {
    animation-play-state: paused !important;
}

/* ── Base Card ── */
.tm-card {
    flex-shrink: 0;
    width: 340px;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #efefef;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    margin-right: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

/* ── Text Card Inner ── */
.tm-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
}

/* ── Header ── */
.tm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tm-avatar-wrap { flex-shrink: 0; }

.tm-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.tm-customer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tm-customer-name {
    font-family: 'Dancing Script', cursive;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-verified {
    font-size: 13px;
    color: #888888;
    font-weight: 400;
    line-height: 1.4;
}

/* ── Quote ── */
.tm-quote-wrap {
    flex: 1;
    margin-bottom: 18px;
}

.tm-quote {
    font-size: 15px;
    line-height: 1.65;
    color: #333333;
    margin: 0;
    font-style: normal;
}

/* ── Product Box ── */
.tm-product-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7f5ef;
    border-radius: 14px;
    padding: 10px 12px;
    margin-top: auto;
}

.tm-product-img-wrap {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.tm-product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 3px;
    min-width: 0;
}

.tm-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
}

.tm-price {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ── Shop Button ── */
.tm-shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px 20px;
    background: #1a1a1a;
    color: #ffffff !important;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.tm-shop-btn:hover {
    background: #3a3a3a;
    transform: scale(1.04);
}

/* ══════════════════════════════════════════
   VIDEO CARD — Hover-reveal design
   Default : content (naam/quote) visible
   Hover   : video overlay slides in, content hides
   Always  : product box stays at bottom
══════════════════════════════════════════ */

.tm-card-video {
    display: flex;
    flex-direction: column;
}

/* Content layer — visible by default, hides on hover */
.tm-video-content {
    flex: 1;
    transition: opacity 0.3s ease;
}
.tm-card-video:hover .tm-video-content,
.tm-card-video.tm-playing .tm-video-content {
    opacity: 0;
    pointer-events: none;
}

/* Video overlay — covers the content area (not product box) */
.tm-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 100px;          /* product box height — stays uncovered */
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.97);
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 10;
    cursor: pointer;
}
.tm-card-video:hover .tm-video-overlay {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}
.tm-card-video.tm-playing .tm-video-overlay {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

/* Thumbnail fills overlay */
.tm-video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
}
.tm-card-video:hover .tm-video-thumb {
    transform: scale(1.04);
}
.tm-card-video.tm-playing .tm-video-thumb {
    opacity: 0;
}

/* Play button centered */
.tm-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    cursor: pointer;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.35));
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.tm-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}
.tm-card-video.tm-playing .tm-play-btn {
    opacity: 0;
    pointer-events: none;
}

/* iframe fills overlay */
.tm-iframe-wrap {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #000;
}
.tm-card-video.tm-playing .tm-iframe-wrap {
    opacity: 1;
    pointer-events: all;
}
.tm-iframe-wrap iframe,
.tm-iframe-wrap video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    object-fit: cover;
}

/* Product box — ALWAYS visible, never hidden */
.tm-product-always {
    position: relative;
    z-index: 20;
    padding: 12px 16px 16px;
    background: #ffffff;
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}
.tm-product-always .tm-product-box {
    margin-top: 0;
}

/* Close button (shows when playing) */
.tm-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s;
    padding: 0;
}
.tm-card-video.tm-playing .tm-close-btn {
    display: flex;
}
.tm-close-btn:hover {
    background: rgba(0,0,0,0.85);
}

/* Elementor Editor: show static preview */
.elementor-editor-active .tm-track {
    animation: none !important;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.elementor-editor-active .tm-wrapper {
    -webkit-mask-image: none;
    mask-image: none;
    overflow-x: auto;
}
