/* css/components/hero-transition.css */

.hero-stitch-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 8vh; /* Account for header */
}

/* Background image */
.hero-stitch-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* ─── Center: Product ─────────────────── */
.hero-stitch-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 40px 20px 120px; /* bottom padding gives room for abs-positioned panels */
}

.hero-stitch-visual {
    width: 340px;
    position: relative;
}

/* Crossfade container: both images stacked at fixed size */
.hero-product-switcher {
    position: relative;
    width: 100%;
    aspect-ratio: 725 / 1036;
}

/* Product float + tilt animation — on WRAPPER so compositor never re-promotes images */
@keyframes floatStitch {
    0%   { transform: translateY(0)    rotate(12deg); }
    50%  { transform: translateY(-18px) rotate(14deg); }
    100% { transform: translateY(0)    rotate(12deg); }
}

/* Each image has its OWN float wrapper so both animate independently and are
   always on the GPU — flipping is-active ONLY changes opacity, zero compositor work */
.hero-product-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    animation: floatStitch 6s ease-in-out infinite;
    pointer-events: none;
}

.hero-product-wrapper.is-active {
    pointer-events: auto;
}

.hero-stitch-product {
    width: 100%;
    height: 100%;
    object-fit: contain;
    will-change: opacity;
    transition: opacity 0.4s ease;
    opacity: 0;
    display: block;
}

/* Only the active image is visible — pure opacity, zero layout, zero compositor promotion */
.hero-product-wrapper.is-active .hero-stitch-product {
    opacity: 1;
}

/* ─── Floating Bubbles ────────────────── */

/* Bubble floats UP only — no rotation so text stays upright */
@keyframes floatBubble {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-12px); }
    100% { transform: translateY(0); }
}

.stitch-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    color: var(--color-charcoal-plum);
    animation: floatBubble 4s ease-in-out infinite alternate;
    z-index: 3;
    pointer-events: none;
}

/* pH Balanced — top left */
.stitch-bubble-1 {
    width: 110px; height: 110px;
    top: 18%; left: 12%;
    animation-delay: 0s;
}

/* Hypo-allergenic — bottom left */
.stitch-bubble-2 {
    width: 100px; height: 100px;
    bottom: 22%; left: 18%;
    animation-delay: 1.2s;
}

/* Ultra-Soft — top right */
.stitch-bubble-3 {
    width: 110px; height: 110px;
    top: 18%; right: 12%;
    animation-delay: 0.6s;
}

/* Parabens Free — bottom right */
.stitch-bubble-4 {
    width: 100px; height: 100px;
    bottom: 22%; right: 18%;
    animation-delay: 1.8s;
}

.bubble-text {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    font-family: var(--font-display);
    color: var(--color-charcoal);
    text-align: center;
    letter-spacing: 0.01em;
}

/* ─── Buttons ─────────────────────────── */
.hero-stitch-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    width: 100%;
}

.btn-stitch-primary,
.btn-stitch-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 30px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-stitch-primary {
    background-color: var(--color-charcoal-plum);
    color: var(--color-white);
    border: 2px solid var(--color-charcoal-plum);
}
.btn-stitch-primary:hover {
    background-color: transparent;
    color: var(--color-charcoal-plum);
}

.btn-stitch-secondary {
    background-color: transparent;
    color: var(--color-charcoal-plum);
    border: 2px solid var(--color-charcoal-plum);
}
.btn-stitch-secondary:hover {
    background-color: var(--color-charcoal-plum);
    color: var(--color-white);
}

/* ─── Bottom-left: Thumbnail Selector ── */
.hero-thumbnails-container {
    position: absolute;
    bottom: 6%;
    left: 5%;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

.thumbnails-title {
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-charcoal-plum);
    margin-bottom: 6px;
}

.hero-thumbnails {
    display: flex;
    flex-direction: row;
    gap: var(--space-2);
}

.thumbnail-btn {
    background: rgba(255,255,255,0.75);
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 10px;
    width: 75px;
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.thumbnail-btn img {
    width: 100%;
    height: auto;
    transform: rotate(12deg);
    filter: drop-shadow(-5px 10px 15px rgba(0,0,0,0.1));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.thumbnail-btn:hover {
    background: rgba(255,255,255,0.85);
}

.thumbnail-btn:hover img {
    transform: rotate(15deg) scale(1.08);
}

/* Active: no border, just a subtle glow */
.thumbnail-btn.active {
    border-color: transparent;
    background: rgba(255,255,255,0.85);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.thumbnail-btn.active img {
    filter: drop-shadow(-8px 15px 20px rgba(0,0,0,0.2));
    transform: rotate(12deg) scale(1.12);
}

/* ─── Bottom-right: Inspiration Text ─── */
.hero-stitch-right {
    position: absolute;
    bottom: 6%;
    right: 5%;
    z-index: 5;
    max-width: 260px;
}

.hero-inspiration {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.inspiration-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-charcoal-plum);
    opacity: 0.55;
    border-bottom: 1.5px solid currentColor;
    padding-bottom: 6px;
    display: inline-block;
}

.inspiration-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-charcoal-plum);
    font-weight: 500;
    opacity: 0.85;
}

/* ─── Responsive ─────────────────────── */
@media (max-width: 768px) {
    .hero-stitch-section {
        padding-top: 12vh;
        padding-bottom: 110px; /* space for abs-positioned panels */
    }

    .hero-stitch-visual {
        width: 260px;
    }

    .hero-thumbnails-container {
        bottom: 6%;
        left: 5%;
    }

    .hero-stitch-right {
        bottom: 6%;
        right: 5%;
        max-width: 150px;
    }

    /* Decrease size of Choose Variant images box */
    .thumbnail-btn {
        width: 55px;
        height: 80px;
        padding: 6px;
    }
    .thumbnails-title {
        font-size: 0.65rem;
    }
    .inspiration-label {
        font-size: 0.65rem;
    }
    .inspiration-text {
        font-size: 0.72rem;
    }

    /* Resize buttons for mobile */
    .hero-stitch-buttons {
        gap: var(--space-2);
        padding: 0 10px; /* Prevent them from touching screen edges on very small devices */
    }
    .btn-stitch-primary,
    .btn-stitch-secondary {
        padding: 10px 16px;
        font-size: 11px;
        gap: 6px;
    }
    .btn-stitch-primary svg,
    .btn-stitch-secondary svg {
        width: 16px;
        height: 16px;
    }

    /* Move bottom bubbles down to clear the buttons */
    .stitch-bubble-1 { top: 10%; left: 4%; width: 85px; height: 85px; }
    .stitch-bubble-2 { bottom: 18%; left: 2%; width: 75px; height: 75px; }
    .stitch-bubble-3 { top: 10%; right: 4%; width: 85px; height: 85px; }
    .stitch-bubble-4 { bottom: 18%; right: 2%; width: 75px; height: 75px; }
    .bubble-icon { font-size: 20px; }
    .bubble-text { font-size: 10px; }
}
