/**
 * Smiley Testimonials Dual CSS — v2.2
 * Reutilizable en cualquier landing Smiley
 * v2.2: scroll activado + distribución vertical optimizada + legibilidad mejorada
 */

:root {
    --std-red:    #ff0000;
    --std-green:  #33cc33;
    --std-yellow: #fbbf24;
    --std-dark:   #1a202c;
    --std-gray:   #4a5568;
    --std-acento: #33cc33; /* override via inline style */
}

/* =====================================================
   CUADRANTE PRINCIPAL
   ===================================================== */

.std-dual-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 40px;
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.04),
        0 10px 30px rgba(0,0,0,0.07),
        0 20px 60px rgba(0,0,0,0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--std-dark);
}

/* =====================================================
   HEADER
   ===================================================== */

.std-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 32px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 16px;
    border: 3px solid var(--std-acento);
    margin-bottom: 44px;
    box-shadow: 0 4px 20px rgba(51,204,51,0.12);
}

.std-header-icon { font-size: 48px; line-height: 1; }

.std-header-title {
    font-size: 26px;
    font-weight: 900;
    color: var(--std-dark);
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.std-header-sub {
    font-size: 15px;
    color: var(--std-gray);
    margin: 0;
}

.std-header-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.std-stat {
    font-size: 14px;
    font-weight: 700;
    padding: 6px 14px;
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    border: 2px solid var(--std-acento);
    color: var(--std-dark);
}

/* =====================================================
   DUAL CONTAINER
   ===================================================== */

.std-dual-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.std-flip-section,
.std-video-section {
    display: flex;
    flex-direction: column;
}

.std-section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--std-dark);
    margin: 0 0 22px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   FLIP DISPLAY
   ===================================================== */

.std-main-display {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 9/16;
    margin: 0 auto 22px;
    perspective: 1500px;
}

.std-display-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.23,1,0.32,1);
    transform-style: preserve-3d;
}

.std-main-display:hover .std-display-inner { transform: rotateY(180deg); }

.std-display-front,
.std-display-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}

.std-main-display:hover .std-display-front,
.std-main-display:hover .std-display-back {
    box-shadow: 0 20px 60px rgba(51,204,51,0.3);
}

.std-display-front { background: #f3f4f6; }

/* ── Reverso — scroll activado ── */
.std-display-back {
    background: linear-gradient(135deg, var(--std-red) 0%, var(--std-yellow) 50%, var(--std-green) 100%);
    transform: rotateY(180deg);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0;
}

.std-display-back::-webkit-scrollbar { width: 4px; }
.std-display-back::-webkit-scrollbar-track { background: transparent; }
.std-display-back::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.5); border-radius: 4px; }

/* ── Contenido del reverso ── */
.std-back-content {
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 100%;
    padding: 28px 22px;
    box-sizing: border-box;
}

.std-quote-icon {
    font-size: 28px;
    opacity: 0.2;
    line-height: 1;
    font-family: Georgia, serif;
    flex-shrink: 0;
}

/* =====================================================
   TEXTO DEL TESTIMONIO — v2.2 optimizado
   ===================================================== */

.std-testimony-text {
    font-size: 17px;
    line-height: 1.75;
    text-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        0 2px 12px rgba(0,0,0,0.25);
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: center;
}

.std-testimony-author {
    font-size: 14px;
    font-weight: 700;
    font-style: italic;
    opacity: 0.95;
    flex-shrink: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.35);
    width: 60%;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* =====================================================
   IMAGEN FRONTAL
   ===================================================== */

.std-main-image {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: opacity 0.4s ease;
}

.std-main-flag {
    position: absolute;
    top: 16px; right: 16px;
    font-size: 30px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 7px 11px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 10; line-height: 1;
}

.std-verified-badge {
    position: absolute;
    top: 16px; left: 16px;
    background: var(--std-acento);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(51,204,51,0.4);
    z-index: 10;
}

.std-custom-badge {
    position: absolute;
    bottom: 80px; left: 16px; right: 16px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px; font-weight: 700;
    text-align: center;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.std-main-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 22px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.std-main-name {
    font-size: 22px; font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    margin: 0;
}

.std-main-rating {
    font-size: 18px;
    color: var(--std-yellow);
    letter-spacing: 3px; line-height: 1;
}

.std-hover-hint {
    position: absolute;
    bottom: 22px; right: 14px;
    background: rgba(102,126,234,0.95);
    color: #fff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
    animation: stdPulse 2.5s infinite;
    backdrop-filter: blur(10px);
    z-index: 5;
}

@keyframes stdPulse {
    0%,100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.08); opacity: 0.85; }
}

/* =====================================================
   CARRUSEL MINIATURAS
   ===================================================== */

.std-carousel-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.std-carousel-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 4px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--std-red) #f7fafc;
}

.std-carousel-track::-webkit-scrollbar { height: 5px; }
.std-carousel-track::-webkit-scrollbar-track { background: #f7fafc; border-radius: 10px; }
.std-carousel-track::-webkit-scrollbar-thumb { background: var(--std-red); border-radius: 10px; }

.std-thumbnail {
    position: relative;
    min-width: 85px; width: 85px;
    aspect-ratio: 9/16;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.std-thumbnail:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--std-acento);
    box-shadow: 0 8px 20px rgba(51,204,51,0.35);
}

.std-thumbnail.std-active {
    border-color: var(--std-red);
    box-shadow: 0 0 0 3px var(--std-red), 0 6px 16px rgba(255,0,0,0.4);
    transform: scale(1.08);
}

.std-thumbnail img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.std-thumb-flag {
    position: absolute;
    top: 5px; right: 5px;
    font-size: 14px;
    background: rgba(255,255,255,0.95);
    border-radius: 5px;
    padding: 2px 5px;
    line-height: 1;
}

.std-carousel-btn {
    background: var(--std-red);
    color: #fff;
    border: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(255,0,0,0.3);
    flex-shrink: 0;
}

.std-carousel-btn:hover {
    background: var(--std-acento);
    transform: scale(1.15);
}

/* =====================================================
   VIDEO PLAYER
   ===================================================== */

.std-video-player {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 9/16;
    margin: 0 auto 22px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.std-youtube-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.std-video-badge {
    position: absolute;
    top: 14px; right: 14px;
    background: linear-gradient(135deg, var(--std-red), #cc0000);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(255,0,0,0.4);
    z-index: 10;
}

/* Playlist videos */
.std-video-playlist {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 0 auto 12px;
}

.std-video-thumb {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.std-video-thumb:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--std-red);
    box-shadow: 0 8px 20px rgba(255,0,0,0.35);
}

.std-video-thumb.std-active {
    border-color: var(--std-red);
    box-shadow: 0 0 0 3px var(--std-red), 0 6px 16px rgba(255,0,0,0.4);
    transform: scale(1.08);
}

.std-video-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.std-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.std-video-thumb:hover .std-video-overlay { background: rgba(0,0,0,0.6); }

.std-play-icon {
    font-size: 30px; color: #fff;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.std-video-duration {
    position: absolute;
    bottom: 7px; right: 7px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 11px; font-weight: 600;
}

.std-video-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    padding: 8px;
}

.std-video-name {
    font-size: 11px; font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    display: block; line-height: 1.3;
}

/* =====================================================
   HELPERS
   ===================================================== */

.std-helper {
    text-align: center;
    color: var(--std-gray);
    font-size: 13px;
    font-style: italic;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    margin: 0;
}

.std-no-content {
    text-align: center;
    padding: 40px 20px;
    color: var(--std-gray);
    font-size: 15px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {
    .std-dual-container { grid-template-columns: 1fr; gap: 48px; }
    .std-main-display,
    .std-video-player   { max-width: 100%; }
}

@media (max-width: 768px) {
    .std-dual-wrapper { padding: 28px 18px; }
    .std-header-title { font-size: 20px; }
    .std-hover-hint   { display: none; }
    .std-testimony-text { font-size: 15px; }
}

@media (max-width: 480px) {
    .std-dual-wrapper { padding: 20px 12px; }
    .std-header-title { font-size: 17px; }
    .std-thumbnail    { min-width: 72px; width: 72px; }
    .std-testimony-text { font-size: 14px; }
}