/**
 * TouchTry 3D Shoe Showcase Section
 * File: assets/css/tt-3d-section.css
 * 
 * Fully Responsive 360° 3D Product Viewer
 * Version: 1.0.0
 */

/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
.tt-3d-hero,
.tt-3d-hero * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.tt-3d-hero {
    /* Default Colors - Will be changed by JS on thumbnail click */
    --tt-bg1: #d946ef;
    --tt-bg2: #f0abfc;
    --tt-accent: #e879f9;
    --tt-white: #ffffff;
    --tt-dark: #1c1c1c;
    --tt-glass: rgba(255, 255, 255, 0.18);
    --tt-glass-border: rgba(255, 255, 255, 0.25);
    --tt-shadow: rgba(0, 0, 0, 0.2);
    --tt-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MAIN SECTION
   ============================================ */
.tt-3d-hero {
    width: 100%;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        var(--tt-bg1) 0%,
        var(--tt-accent) 50%,
        var(--tt-bg2) 100%
    );
    transition: background 0.6s ease;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   GRADIENT OVERLAY
   ============================================ */
.tt-3d-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 120% 80% at 50% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 100% 60% at 80% 80%, rgba(150, 100, 200, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 100% 60% at 20% 80%, rgba(100, 150, 200, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(0, 0, 0, 0.2) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   FLOATING PARTICLES
   ============================================ */
.tt-3d-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.tt-3d-particles span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    animation: tt-float 12s infinite ease-in-out;
}

.tt-3d-particles span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.tt-3d-particles span:nth-child(2) { left: 25%; top: 70%; animation-delay: 2s; }
.tt-3d-particles span:nth-child(3) { left: 55%; top: 25%; animation-delay: 4s; }
.tt-3d-particles span:nth-child(4) { left: 75%; top: 65%; animation-delay: 1s; }
.tt-3d-particles span:nth-child(5) { left: 85%; top: 30%; animation-delay: 3s; }
.tt-3d-particles span:nth-child(6) { left: 40%; top: 85%; animation-delay: 5s; }

@keyframes tt-float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.25;
    }
    25% {
        transform: translateY(-40px) translateX(15px) scale(1.3);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-80px) translateX(-10px) scale(0.9);
        opacity: 0.35;
    }
    75% {
        transform: translateY(-40px) translateX(20px) scale(1.1);
        opacity: 0.45;
    }
}

/* ============================================
   CONTAINER
   ============================================ */
.tt-3d-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    min-height: 100vh;
}

/* ============================================
   MAIN TITLE
   ============================================ */
.tt-3d-title {
    position: relative;
    text-align: center;
    z-index: 1;
    text-transform: uppercase;
    font-weight: 900;
    font-size: clamp(45px, 5vw, 130px);
    line-height: 1;
    letter-spacing: -3px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 4px 40px rgba(0, 0, 0, 0.25);
    margin-bottom: 0;
    user-select: none;
}

/* ============================================
   MODEL VIEWER WRAPPER
   ============================================ */
.tt-3d-model-wrap {
    position: relative;
    z-index: 2;
    margin-top: -100px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.tt-3d-viewer {
    width: min(800px, 95vw);
    height: min(550px, 55vh);
    background: transparent;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.3));
    touch-action: pan-y;
}

/* Hide model-viewer default UI */
.tt-3d-viewer::part(default-progress-bar),
.tt-3d-viewer::part(progress-bar),
.tt-3d-viewer::part(prompt) {
    display: none !important;
}

/* ============================================
   360° BADGE
   ============================================ */
.tt-3d-badge {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--tt-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--tt-glass-border);
    border-radius: 25px;
    color: var(--tt-white);
    font-size: 14px;
    font-weight: 700;
    animation: tt-pulse 2.5s ease-in-out infinite;
}

.tt-3d-badge svg {
    width: 18px;
    height: 18px;
}

@keyframes tt-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.02); }
}

/* ============================================
   GLASSMORPHISM PILL
   ============================================ */
.tt-3d-pill {
    position: relative;
    z-index: 3;
    margin-top: -30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(520px, 92vw);
    padding: 14px 16px 14px 32px;
    background: var(--tt-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--tt-glass-border);
    border-radius: 999px;
    box-shadow:
        0 10px 40px var(--tt-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.tt-3d-pill-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--tt-dark);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.tt-3d-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        var(--tt-bg1) 0%,
        var(--tt-accent) 50%,
        var(--tt-bg2) 100%
    );
    color: var(--tt-white);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
    transition: var(--tt-transition);
}

.tt-3d-pill-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(217, 70, 239, 0.5);
}

.tt-3d-pill-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

/* ============================================
   THUMBNAILS
   ============================================ */
.tt-3d-thumbs {
    position: relative;
    z-index: 4;
    margin-top: 40px;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.tt-3d-thumb {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--tt-transition);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.tt-3d-thumb::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: var(--tt-transition);
}

.tt-3d-thumb:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

.tt-3d-thumb img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
}

/* Active Thumbnail */
.tt-3d-thumb.is-active::before {
    border-color: var(--tt-white);
    box-shadow: 0 0 0 5px rgba(217, 70, 239, 0.35);
}

.tt-3d-thumb.is-active {
    box-shadow: 0 10px 40px rgba(217, 70, 239, 0.35);
    transform: scale(1.05);
}

/* ============================================
   RESPONSIVE - TABLET (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
    .tt-3d-hero {
        min-height: 90vh;
    }

    .tt-3d-container {
        padding: 30px 20px 50px;
    }

    .tt-3d-title {
        font-size: clamp(42px, 9vw, 100px);
        letter-spacing: -2px;
    }

    .tt-3d-model-wrap {
        margin-top: -80px;
    }

    .tt-3d-viewer {
        width: 98vw;
        height: 50vh;
    }

    .tt-3d-badge {
        top: 20px;
        right: 20px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .tt-3d-pill {
        width: min(480px, 95vw);
        padding: 12px 14px 12px 26px;
    }

    .tt-3d-pill-name {
        font-size: 16px;
    }

    .tt-3d-pill-btn {
        padding: 12px 22px;
        font-size: 15px;
    }

    .tt-3d-thumbs {
        gap: 16px;
        margin-top: 35px;
    }

    .tt-3d-thumb {
        width: 78px;
        height: 78px;
    }

    .tt-3d-thumb img {
        width: 55px;
        height: 55px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .tt-3d-hero {
        min-height: 100vh;
        min-height: 100svh;
    }

    .tt-3d-container {
        padding: 20px 16px 40px;
        min-height: 100vh;
        min-height: 100svh;
        justify-content: flex-start;
        padding-top: 60px;
    }

    .tt-3d-title {
        font-size: clamp(36px, 12vw, 65px);
        letter-spacing: -1px;
        line-height: 1.05;
        padding: 0 8px;
    }

    .tt-3d-model-wrap {
        margin-top: -50px;
        flex: 1;
        min-height: 0;
        width: 100%;
    }

    .tt-3d-viewer {
        width: 110vw;
        height: 45vh;
        max-height: 380px;
        margin-left: -5vw;
    }

    .tt-3d-badge {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
        gap: 4px;
    }

    .tt-3d-badge svg {
        width: 14px;
        height: 14px;
    }

    /* Pill - Side by side on mobile */
    .tt-3d-pill {
        margin-top: -10px;
        width: calc(100% - 20px);
        max-width: 400px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
        padding: 10px 12px 10px 18px;
    }

    .tt-3d-pill-name {
        font-size: 14px;
        font-weight: 700;
        text-align: left;
    }

    .tt-3d-pill-btn {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
    }

    .tt-3d-pill-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Thumbnails */
    .tt-3d-thumbs {
        margin-top: 25px;
        gap: 12px;
        padding: 0 10px;
    }

    .tt-3d-thumb {
        width: 68px;
        height: 68px;
    }

    .tt-3d-thumb img {
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .tt-3d-container {
        padding-top: 50px;
    }

    .tt-3d-title {
        font-size: clamp(32px, 11vw, 52px);
        padding: 0 5px;
    }

    .tt-3d-model-wrap {
        margin-top: -40px;
    }

    .tt-3d-viewer {
        width: 115vw;
        height: 40vh;
        max-height: 320px;
        margin-left: -7.5vw;
    }

    .tt-3d-pill {
        width: calc(100% - 16px);
        padding: 8px 10px 8px 14px;
        gap: 8px;
    }

    .tt-3d-pill-name {
        font-size: 13px;
    }

    .tt-3d-pill-btn {
        padding: 9px 14px;
        font-size: 12px;
    }

    .tt-3d-thumbs {
        gap: 10px;
    }

    .tt-3d-thumb {
        width: 60px;
        height: 60px;
    }

    .tt-3d-thumb img {
        width: 42px;
        height: 42px;
    }
}

/* ============================================
   RESPONSIVE - VERY SMALL (max-width: 380px)
   ============================================ */
@media (max-width: 380px) {
    .tt-3d-title {
        font-size: clamp(28px, 10vw, 44px);
    }

    .tt-3d-viewer {
        height: 38vh;
        max-height: 280px;
    }

    .tt-3d-pill-name {
        font-size: 12px;
    }

    .tt-3d-pill-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .tt-3d-thumb {
        width: 54px;
        height: 54px;
    }

    .tt-3d-thumb img {
        width: 38px;
        height: 38px;
    }
}

/* ============================================
   RESPONSIVE - LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .tt-3d-hero {
        min-height: 130vh;
    }

    .tt-3d-container {
        padding: 20px 24px 30px;
        min-height: auto;
    }

    .tt-3d-title {
        font-size: clamp(28px, 6vw, 50px);
    }

    .tt-3d-model-wrap {
        margin-top: -30px;
    }

    .tt-3d-viewer {
        height: 55vh;
        width: 45vw;
        margin-left: 0;
    }

    .tt-3d-badge {
        top: 10px;
        right: 10px;
    }

    .tt-3d-pill {
        margin-top: 10px;
        flex-direction: row;
        width: auto;
        max-width: 420px;
        padding: 10px 12px 10px 22px;
    }

    .tt-3d-thumbs {
        margin-top: 20px;
        gap: 10px;
    }

    .tt-3d-thumb {
        width: 55px;
        height: 55px;
    }

    .tt-3d-thumb img {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   RESPONSIVE - LARGE SCREENS (min-width: 1400px)
   ============================================ */
@media (min-width: 1400px) {
    .tt-3d-title {
        font-size: 150px;
    }

    .tt-3d-viewer {
        width: 900px;
        height: 600px;
    }

    .tt-3d-pill {
        width: 580px;
        padding: 16px 18px 16px 36px;
    }

    .tt-3d-pill-name {
        font-size: 20px;
    }

    .tt-3d-pill-btn {
        padding: 16px 32px;
        font-size: 17px;
    }

    .tt-3d-thumbs {
        gap: 24px;
        margin-top: 50px;
    }

    .tt-3d-thumb {
        width: 95px;
        height: 95px;
    }

    .tt-3d-thumb img {
        width: 70px;
        height: 70px;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .tt-3d-particles span {
        animation: none;
    }

    .tt-3d-badge {
        animation: none;
    }

    .tt-3d-hero,
    .tt-3d-pill-btn,
    .tt-3d-thumb {
        transition: none;
    }
}

/* ============================================
   TOUCH DEVICE INTERACTIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .tt-3d-thumb:active {
        transform: scale(0.95);
    }

    .tt-3d-pill-btn:active {
        transform: scale(0.97);
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.tt-3d-viewer[loading] {
    opacity: 0.6;
}

.tt-3d-viewer:not([loading]) {
    opacity: 1;
    transition: opacity 0.4s ease;
}