/* ==========================================================
   MINGL TESTIMONIALS  -  "Fruit Ice Cream Shop"
   A real fruit drops into a waffle bowl and becomes a scoop.
   The review card is topped with glossy icing in the fruit's colour.
   Prefix: mg-tt-  (replaces the old .mingl-testimonial* /
   .mingl-scoop* / .mingl-review* rules - delete those).
========================================================== */

.mg-tt {
    --c-main: #f9c34f;
    --c-dark: #e29a1c;
    --c-light: #fff0bd;
    --c-accent: #d98a0c;
    --c-glow: rgba(249, 195, 79, 0.34);
    --tt-ink: #18382b;
    --tt-body: #4a3d44;
    --tt-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    position: relative;
    padding: 96px 0 90px;
    background: #fff7f5;
    overflow: hidden;
    isolation: isolate;
}

/* ---------- background ---------- */
.mg-tt-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.mg-tt-blob {
    position: absolute;
    border-radius: 50%;
    background: var(--c-glow);
    filter: blur(70px);
    transition: background-color 0.9s ease;
}
.mg-tt-blob-a { width: 460px; height: 460px; left: -120px; top: 6%; }
.mg-tt-blob-b { width: 380px; height: 380px; right: -90px; bottom: -4%; opacity: 0.8; }

.mg-tt-sprinkles { position: absolute; inset: 0; }
.mg-tt-sprinkle {
    position: absolute;
    width: 12px;
    height: 4.5px;
    border-radius: 3px;
    opacity: 0.55;
    animation: mgFloat var(--dur, 12s) ease-in-out var(--del, 0s) infinite alternate;
}

/* ---------- heading ---------- */
.mg-tt-head { text-align: center; margin: 0 auto 36px; max-width: 640px; }

.mg-tt-head h2 {
    margin: 0 0 12px;
    color: var(--tt-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 4.4vw, 64px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -1px;
}
.mg-tt-head p { margin: 0; color: #6c6068; font-size: 16px; line-height: 1.7; }

.mg-tt-js:not(.is-seen) .mg-tt-head { opacity: 0; transform: translateY(18px); }
.mg-tt-head { transition: opacity 0.8s var(--tt-ease), transform 0.8s var(--tt-ease); }

/* ---------- layout ---------- */
.mg-tt-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
}

/* ---------- stage (bowl + scoops) ---------- */
.mg-tt-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mg-tt-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 320px;
    height: 320px;
    margin: -160px 0 0 -160px;
    border-radius: 50%;
    background: var(--c-glow);
    filter: blur(14px);
    transition: background-color 0.7s ease;
    animation: mgBreathe 5s ease-in-out infinite;
}

.mg-tt-svg {
    position: relative;
    display: block;
    width: min(100%, 350px);
    height: auto;
    overflow: visible;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.25s ease-out;
}

.mg-tt-ground { fill: rgba(70, 35, 45, 0.2); }

.mg-tt-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 8px 18px 8px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #f3d6de;
    border-color: color-mix(in srgb, var(--c-main) 45%, #fff);
    color: var(--tt-ink);
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(120, 50, 70, 0.08);
}
.mg-tt-badge-fruit { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.mg-tt-badge.is-swap span,
.mg-tt-badge.is-swap img { animation: mgSwap 0.5s var(--tt-ease); }

/* ---------- bowl + scoop internals (SVG) ---------- */
.mg-tt-bowl { transform-box: fill-box; transform-origin: 50% 100%; }
.mg-tt-bowl.is-hit { animation: mgBowlHit 0.55s ease-out; }

.mg-tt-scoop-pos { transition: transform 0.65s cubic-bezier(0.34, 1.4, 0.5, 1); }

.mg-tt-scoop-in {
    transform-box: fill-box;
    transform-origin: 50% 55%;
}
.mg-tt-scoop-shadow { fill: rgba(60, 20, 25, 0.34); }

/* little fruit garnish, only on the top scoop */
.mg-tt-garn {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transform: scale(0.2);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
.mg-tt-scoop-pos.is-top.is-ready .mg-tt-garn {
    opacity: 1;
    transform: none;
    transition: opacity 0.3s 0.5s, transform 0.55s cubic-bezier(0.3, 1.7, 0.5, 1) 0.5s;
}

/* idle jiggle on the top scoop, then one-shot states override it */
.mg-tt-scoop-pos.is-top .mg-tt-scoop-in { animation: mgJiggle 3.8s ease-in-out infinite; }
.mg-tt-scoop-pos .mg-tt-scoop-in.is-wait { opacity: 0; animation: none; }
.mg-tt-scoop-pos .mg-tt-scoop-in.is-dropping { animation: mgForm 0.85s both; }
.mg-tt-scoop-pos .mg-tt-scoop-in.is-hop { animation: mgHop 0.55s ease-out; }
.mg-tt-scoop-pos .mg-tt-scoop-in.is-pop { animation: mgPop 0.42s ease-in forwards; }

/* ---------- review card ---------- */
.mg-tt-review { min-width: 0; }

.mg-tt-card {
    --frost-h: 112px;
    position: relative;
    padding: calc(var(--frost-h) + 10px) 38px 0;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #f5dbe3;
    border-color: color-mix(in srgb, var(--c-main) 35%, #fff);
    box-shadow: 0 26px 50px rgba(120, 50, 70, 0.10);
    overflow: hidden;
    transition: border-color 0.6s ease;
}

/* glossy icing that pours over the top edge of the card (built by JS) */
.mg-tt-frost {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 112px;
    pointer-events: none;
}
.mg-tt-frost-layer { position: absolute; top: 0; left: 0; width: 100%; }
.mg-tt-frost svg { display: block; overflow: visible; }

.mg-tt-sweep { animation: mgSweep 7s ease-in-out infinite; }
.mg-tt-bead {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: mgBead 7s ease-in infinite;
}
.mg-tt:not(.is-inview) .mg-tt-sweep,
.mg-tt:not(.is-inview) .mg-tt-bead,
.mg-tt.is-paused .mg-tt-sweep,
.mg-tt.is-paused .mg-tt-bead { animation-play-state: paused; }

.mg-tt-stars { margin-bottom: 14px; color: #f2a318; font-size: 19px; letter-spacing: 3px; line-height: 1; }
.mg-tt-star { display: inline-block; }
.mg-tt-card.is-in .mg-tt-star { animation: mgStar 0.55s calc(var(--i) * 70ms) both cubic-bezier(0.3, 1.7, 0.5, 1); }

.mg-tt-quote { margin: 0 0 26px; padding: 0; border: 0; }

.mg-tt-text {
    margin: 0;
    min-height: 140px;
    color: var(--tt-body);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(19px, 1.7vw, 23px);
    line-height: 1.7;
}
.mg-tt-w { display: inline-block; }
.mg-tt-card.is-in .mg-tt-w { animation: mgWord 0.55s calc(var(--i) * 26ms + 120ms) both var(--tt-ease); }

.mg-tt-author { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-top: 1px dashed #e6c9d2; }
.mg-tt-card.is-in .mg-tt-author { animation: mgSlide 0.6s 0.25s both var(--tt-ease); }

.mg-tt-avatar {
    position: relative;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fff 0, var(--c-light) 25%, var(--c-main) 75%);
    color: #5a2a3a;
    font-size: 18px;
    font-weight: 700;
    transition: background 0.5s ease;
}
.mg-tt-author h3 { margin: 0 0 2px; color: var(--tt-ink); font-size: 17px; font-weight: 600; }
.mg-tt-author span:not(.mg-tt-avatar) { color: #8a7480; font-size: 14px; }

.mg-tt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-bottom: 22px; }

/* fruit picker: click a fruit, it drops into the bowl */
.mg-tt-fruits { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mg-tt-fruit {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 5px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.3, 1.7, 0.5, 1), background-color 0.3s, box-shadow 0.3s;
    -webkit-tap-highlight-color: transparent;
}
.mg-tt-fruit img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 3px rgba(70, 25, 35, 0.28));
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}
.mg-tt-fruit:hover { transform: translateY(-4px) scale(1.14); }
.mg-tt-fruit:active { transform: scale(0.9); }
.mg-tt-fruit.is-active {
    background: #fff;
    background: color-mix(in srgb, var(--dot) 26%, #fff);
    box-shadow: 0 0 0 2px var(--dot), 0 8px 16px color-mix(in srgb, var(--dot) 45%, transparent);
    transform: translateY(-3px) scale(1.12);
}

.mg-tt-nav { display: flex; align-items: center; gap: 8px; }
.mg-tt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #f1c9d5;
    border-radius: 50%;
    background: #fff;
    color: var(--c-accent);
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.mg-tt-btn:hover { background: var(--c-accent); color: #fff; transform: translateY(-2px); }

.mg-tt-fruit:focus-visible,
.mg-tt-btn:focus-visible { outline: 3px solid var(--tt-ink); outline-offset: 3px; }

/* auto-play timer: a strip of sauce that fills, then the next scoop drops */
.mg-tt-timer { height: 5px; background: rgba(0, 0, 0, 0.05); }
.mg-tt-timer span {
    display: block;
    height: 100%;
    background: var(--c-main);
    transform-origin: 0 50%;
    transform: scaleX(0);
}
.mg-tt-timer span.is-run { animation: mgTimer 7s linear forwards; }
.mg-tt-card:hover .mg-tt-timer span,
.mg-tt-card:focus-within .mg-tt-timer span,
.mg-tt.is-paused .mg-tt-timer span,
.mg-tt:not(.is-inview) .mg-tt-timer span { animation-play-state: paused; }

.mg-tt-note { margin: 16px 6px 0; color: #9d8691; font-size: 13px; line-height: 1.6; }

/* ---------- keyframes ---------- */
@keyframes mgForm {
    0%   { transform: scale(0.25, 0.18); opacity: 0; animation-timing-function: ease-out; }
    26%  { transform: scale(1.16, 0.84); opacity: 1; animation-timing-function: ease-out; }
    52%  { transform: scale(0.94, 1.09); animation-timing-function: ease-in-out; }
    76%  { transform: scale(1.03, 0.97); animation-timing-function: ease-out; }
    100% { transform: none; opacity: 1; }
}
@keyframes mgPop { 0% { transform: none; opacity: 1; } 35% { transform: scale(1.08, 0.9); opacity: 1; } 100% { transform: scale(0.15); opacity: 0; } }
@keyframes mgHop {
    0%, 100% { transform: none; }
    40% { transform: translateY(-24px) scale(0.96, 1.07); }
    72% { transform: translateY(0) scale(1.09, 0.9); }
}
@keyframes mgJiggle {
    0%, 100% { transform: rotate(0) scale(1, 1); }
    30% { transform: rotate(-1.1deg) scale(1.008, 0.992); }
    65% { transform: rotate(1.1deg) scale(0.992, 1.008); }
}
@keyframes mgBowlHit {
    0%   { transform: none; }
    24%  { transform: translateY(4px) scale(1.03, 0.955); }
    55%  { transform: translateY(-1.5px) scale(0.99, 1.012); }
    100% { transform: none; }
}
@keyframes mgBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes mgFloat { from { transform: translate(0, 0) rotate(var(--rot, 0deg)); } to { transform: translate(14px, -26px) rotate(calc(var(--rot, 0deg) + 40deg)); } }
@keyframes mgWord { from { opacity: 0; transform: translateY(0.5em); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes mgStar { from { opacity: 0; transform: scale(0) rotate(-60deg); } to { opacity: 1; transform: none; } }
@keyframes mgSlide { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes mgSwap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mgTimer { to { transform: scaleX(1); } }
@keyframes mgSweep { 0%, 55% { transform: translateX(0); } 100% { transform: translateX(1100px); } }
@keyframes mgBead {
    0%, 8%  { opacity: 0; transform: translateY(0) scale(0.2); }
    30%     { opacity: 1; transform: translateY(0) scale(1); }
    74%     { opacity: 1; transform: translateY(26px) scale(1); }
    100%    { opacity: 0; transform: translateY(40px) scale(0.85); }
}

/* ---------- responsive ---------- */
@media (max-width: 991px) {
    .mg-tt { padding: 76px 0 72px; }
    .mg-tt-layout { grid-template-columns: 1fr; gap: 30px; }
    .mg-tt-svg { width: min(100%, 310px); }
    .mg-tt-glow { width: 260px; height: 260px; margin: -130px 0 0 -130px; }
    .mg-tt-text { min-height: 0; }
}

@media (max-width: 575px) {
    .mg-tt { padding: 62px 0 60px; }
    .mg-tt-card { padding-left: 22px; padding-right: 22px; border-radius: 22px; }
    .mg-tt-foot { flex-direction: column; align-items: flex-start; gap: 18px; }
    .mg-tt-btn { width: 42px; height: 42px; }
    .mg-tt-svg { width: min(100%, 270px); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .mg-tt *,
    .mg-tt *::before,
    .mg-tt *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
    .mg-tt-js:not(.is-seen) .mg-tt-head { opacity: 1; transform: none; }
    .mg-tt-scoop-pos .mg-tt-scoop-in.is-wait { opacity: 1; }
}

/* ==========================================================
   MOBILE ONLY: 30% BOWL / 70% REVIEW, SIDE BY SIDE
   Desktop and tablet layouts remain unchanged.
========================================================== */
@media (max-width: 767px) {
    .mg-tt { padding: 48px 0 52px; }

    .mg-tt .container { padding-left: 12px; padding-right: 12px; }

    .mg-tt-head { margin-bottom: 22px; }
    .mg-tt-head h2 { font-size: clamp(29px, 7vw, 38px); }
    .mg-tt-head p { font-size: 13px; }

    .mg-tt-layout {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
        align-items: center;
        gap: 10px;
    }

    .mg-tt-stage,
    .mg-tt-review { min-width: 0; width: 100%; }
    .mg-tt-stage { align-self: center; }

    .mg-tt-svg { display: block; width: 100%; max-width: 100%; height: auto; }

    .mg-tt-glow { width: 100px; height: 100px; margin: -50px 0 0 -50px; filter: blur(10px); }

    .mg-tt-badge {
        max-width: 100%;
        padding: 5px 6px;
        margin-top: 0;
        gap: 4px;
        font-size: 9px;
        line-height: 1.25;
        white-space: normal;
        text-align: center;
        overflow-wrap: anywhere;
        border-radius: 10px;
    }
    .mg-tt-badge-fruit { width: 12px; height: 12px; }

    .mg-tt-card { padding: calc(var(--frost-h) + 6px) 11px 0; border-radius: 15px; }

    .mg-tt-stars { font-size: 13px; letter-spacing: 1px; margin-bottom: 9px; }
    .mg-tt-quote { margin-bottom: 12px; }
    .mg-tt-text { min-height: 0; font-size: clamp(12px, 3vw, 15px); line-height: 1.5; }

    .mg-tt-author { gap: 7px; padding: 10px 0; }
    .mg-tt-avatar { width: 28px; height: 28px; font-size: 12px; }
    .mg-tt-author h3 { font-size: 12px; }
    .mg-tt-author span:not(.mg-tt-avatar) { display: block; font-size: 10px; line-height: 1.35; }

    .mg-tt-foot { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding-bottom: 14px; }

    .mg-tt-fruits { gap: 2px; justify-content: center; }
    .mg-tt-fruit { width: 30px; height: 30px; padding: 3px; }
    .mg-tt-fruit:hover,
    .mg-tt-fruit.is-active { transform: translateY(-2px) scale(1.1); }

    .mg-tt-nav { justify-content: center; gap: 7px; }
    .mg-tt-btn { width: 30px; height: 30px; font-size: 13px; }

    .mg-tt-note { margin: 10px 0 0; font-size: 10px; line-height: 1.5; }
}

/* Two-button navigation after removing the Pause/Play control */
.mg-tt-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.mg-tt-nav .mg-tt-btn {
    flex: 0 0 auto;
}
@media (max-width: 767px) {
    .mg-tt-nav { gap: 10px; }
}
