/* ==============================================
   AIOH Test LK — Fresh & Modern
   Palette: turquoise #00BFA5, coral #FF6B6B
   Audience: women 30-50, mobile-first
   ============================================== */

:root {
    --primary: #00BFA5;
    --primary-dark: #00a392;
    --primary-gradient: linear-gradient(135deg, #0CBABA, #00BFA5);
    --accent: #FF6B6B;
    --accent-light: #FF8A8A;
    --bg: #FFFFFF;
    --card-bg: #F5F7FA;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;
    --border: #E8ECEF;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 2px 16px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 32px rgba(0,191,165,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ─── Navbar ─── */
.test-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.test-navbar-brand {
    font-size: 26px;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}
.test-navbar-brand:hover .brand-text {
    transform: translateY(-1px);
    text-shadow:
        0 2px 4px rgba(0,191,165,0.3),
        0 4px 12px rgba(255,107,107,0.2);
}
.brand-text {
    background: linear-gradient(135deg, #00BFA5 30%, #FF6B6B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.12));
    transition: transform 0.2s, filter 0.2s;
}
.test-navbar-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.test-nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.test-nav-link:hover { color: var(--primary); }
.test-nav-btn {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 8px 20px;
    border: 2px solid var(--primary);
    border-radius: 24px;
    transition: all 0.2s;
}
.test-nav-btn:hover {
    background: var(--primary);
    color: #fff;
}
.test-nav-btn--topup {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.test-nav-btn--topup:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.nav-balance {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.nav-balance:hover {
    background: var(--primary-dark);
    color: #fff;
}
.nav-balance i {
    font-size: 15px;
}

/* ─── Main ─── */
.test-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 32px;
    overflow-x: hidden;
}
.test-main--wide {
    max-width: 1120px;
}

/* ─── Hero Section ─── */
.hero-section {
    position: relative;
    background: linear-gradient(160deg, #e0f7fa 0%, #ffffff 35%, #fce4ec 70%, #ede7f6 100%);
    padding: 40px 0 80px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    overflow: visible;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
}
.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 50px;
    display: block;
}
.hero-inner {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 1080px;
    margin: 0 auto;
}
.hero-text { flex: 1; }
.hero-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 12px;
}
.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(0,191,165,0.3);
}
.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,191,165,0.4);
    color: #fff;
}
.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.hero-cta--max {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
    padding: 14px 28px;
}
.hero-cta--max:hover {
    box-shadow: 0 6px 24px rgba(99,102,241,0.45);
}
.hero-max-logo {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    object-fit: contain;
}

/* Hero floating cards */
.hero-float {
    flex: 0 0 320px;
    position: relative;
    height: 340px;
}
.hero-float-card {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    text-align: center;
    animation: heroFloat 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.5s);
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.hero-float-card:hover {
    transform: scale(1.08);
    z-index: 5;
    box-shadow: 0 12px 40px rgba(0,191,165,0.25);
}
.hero-float-card img {
    width: 110px;
    height: 130px;
    object-fit: cover;
    object-position: top;
    border-radius: 12px;
    display: block;
}
.hero-float-name {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

/* Staggered positions for 6 cards (3x2-ish scattered) */
.hero-float-card:nth-child(1) { top: 0;   left: 0; }
.hero-float-card:nth-child(2) { top: 20px; left: 130px; }
.hero-float-card:nth-child(3) { top: 0;   left: 260px; }
.hero-float-card:nth-child(4) { top: 180px; left: 15px; }
.hero-float-card:nth-child(5) { top: 200px; left: 140px; }
.hero-float-card:nth-child(6) { top: 175px; left: 265px; }

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ─── Styles Section (categories + carousels) ─── */
.styles-section {
    padding: 32px 0 16px;
}
.styles-header {
    text-align: center;
    margin-bottom: 28px;
}
.styles-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.styles-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Category row */
.cat-row {
    margin-bottom: 28px;
}
.cat-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.cat-row-name {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
}
.cat-row-badge {
    background: var(--accent);
    color: #fff;
    padding: 2px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
}
.cat-row-all {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}
.cat-row-all:hover { opacity: 0.7; }

/* Style train carousel */
.cat-row-track-wrap {
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
}
.cat-row-track {
    display: flex;
    gap: 14px;
    will-change: transform;
}

.cat-row-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    z-index: 2;
    pointer-events: none;
}
.cat-row-fade-l { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.cat-row-fade-r { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

/* Category footer button */
.cat-row-footer { text-align: center; }
.cat-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    background: var(--card-bg);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.cat-row-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Style thumbnail card */
.style-thumb {
    flex: 0 0 auto;
    width: 140px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}
.style-thumb:hover {
    transform: translateY(-3px);
    color: inherit;
}
.style-thumb-img {
    position: relative;
    width: 140px;
    height: 170px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-card);
}
.style-thumb-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}
.style-thumb-price {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}
.style-thumb-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Category Page Header ─── */
.test-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0 16px;
}
.test-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.test-back-btn:hover { background: var(--border); color: var(--text-primary); }
.test-cat-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ─── Style Cards (category page, vertical feed) ─── */
.test-styles-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.test-style-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s;
}
.test-style-card:hover { box-shadow: var(--shadow-hover); }

.test-style-preview-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.test-style-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #eef2f5;
}
.test-style-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s;
}
.test-style-card:hover .test-style-preview img { transform: scale(1.03); }
.test-style-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, #e8f5e9, #e0f2f1);
}
.test-style-price {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.test-style-body {
    padding: 12px;
}
.test-style-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ─── Before / After ─── */
.test-ba-section {
    margin-bottom: 16px;
}
.test-ba-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
/* ─── BA Train (JS-driven auto-scroll + swipe) ─── */
.test-ba-track-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}
.test-ba-track {
    display: flex;
    gap: 14px;
    will-change: transform;
}

.test-ba-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    z-index: 2;
    pointer-events: none;
}
.test-ba-fade-left { left: 0; background: linear-gradient(to right, var(--card-bg), transparent); }
.test-ba-fade-right { right: 0; background: linear-gradient(to left, var(--card-bg), transparent); }

/* ─── BA Compact Pair ─── */
.ba-pair {
    display: flex;
    flex: 0 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.ba-img {
    position: relative;
    width: 140px;
    height: 170px;
    overflow: hidden;
}
.ba-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ba-tag {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.ba-tag-before {
    background: rgba(255,107,107,0.9);
    color: #fff;
}
.ba-tag-after {
    background: rgba(0,191,165,0.9);
    color: #fff;
}

/* Single example (no before image) */
.test-ba-single {
    flex: 0 0 auto;
    width: 160px;
    height: 160px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.test-ba-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Generate Button ─── */
.test-gen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    min-height: 44px;
    transition: opacity 0.2s, transform 0.15s;
}
.test-gen-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}
.test-gen-btn:active { transform: translateY(0); }

/* ─── Empty State ─── */
.test-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.test-empty i { font-size: 3rem; margin-bottom: 12px; display: block; }
.test-empty p { font-size: 16px; }

/* ─── Footer ─── */
.test-footer {
    text-align: center;
    padding: 24px 16px 32px;
    color: var(--text-muted);
    font-size: 13px;
}
.test-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.test-footer a:hover { color: var(--primary); }
.test-footer span { margin: 0 6px; }

/* ─── Appear Animation ─── */
.test-appear {
    opacity: 0;
    transform: translateY(20px);
    animation: testFadeUp 0.5s ease forwards;
}
@keyframes testFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─── */

/* Mobile: compact navbar + hero stacks vertically */
@media (max-width: 767px) {
    .test-navbar {
        padding: 10px 16px;
    }
    .test-navbar-brand {
        font-size: 22px;
    }
    .test-navbar-links {
        gap: 6px;
    }
    .nav-label {
        display: none;
    }
    .test-nav-link {
        font-size: 18px;
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .test-nav-btn {
        font-size: 16px;
        padding: 6px 10px;
    }
    .nav-balance {
        font-size: 13px;
        padding: 5px 10px;
        gap: 4px;
    }
    .hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 28px;
    }
    .hero-float {
        flex: 0 0 auto;
        width: 280px;
        height: 300px;
        margin: 0 auto;
    }
    .hero-float-card img { width: 80px; height: 100px; }
    .hero-float-card:nth-child(1) { top: 0;   left: 0; }
    .hero-float-card:nth-child(2) { top: 15px; left: 96px; }
    .hero-float-card:nth-child(3) { top: 0;   left: 192px; }
    .hero-float-card:nth-child(4) { top: 150px; left: 10px; }
    .hero-float-card:nth-child(5) { top: 165px; left: 100px; }
    .hero-float-card:nth-child(6) { top: 148px; left: 195px; }
    .hero-float-name { max-width: 80px; font-size: 10px; }
}

/* Tablet */
@media (min-width: 768px) {
    .hero-title { font-size: 38px; }
    .hero-section { padding: 56px 24px 64px; }
    .ba-img { width: 160px; height: 190px; }
    .test-ba-single { width: 180px; height: 180px; }

    .test-styles-feed {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .test-style-preview { aspect-ratio: 3/4; }
    .style-thumb-img { width: 150px; height: 185px; }
    .style-thumb { width: 150px; }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .hero-title { font-size: 44px; }
    .hero-float { flex: 0 0 430px; height: 380px; }
    .hero-float-card img { width: 120px; height: 145px; }
    .hero-float-card:nth-child(1) { top: 0;   left: 0; }
    .hero-float-card:nth-child(2) { top: 25px; left: 145px; }
    .hero-float-card:nth-child(3) { top: 0;   left: 286px; }
    .hero-float-card:nth-child(4) { top: 200px; left: 12px; }
    .hero-float-card:nth-child(5) { top: 220px; left: 150px; }
    .hero-float-card:nth-child(6) { top: 195px; left: 286px; }
    .hero-float-name { max-width: 120px; }
    .test-styles-feed {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    .test-style-name { font-size: 17px; }
    .test-cat-page-title { font-size: 26px; }
}

/* ===== Mobile category nav slider ===== */
.cat-nav-slider {
    margin: 0 0 16px;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    padding: 10px 0 8px;
}
.cat-nav-slider-viewport {
    position: relative;
    overflow: hidden;
    height: 104px;
}
.cat-nav-slider-viewport::before,
.cat-nav-slider-viewport::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 28px;
    z-index: 3;
    pointer-events: none;
}
.cat-nav-slider-viewport::before { left: 0; background: linear-gradient(to right, #fff 0%, transparent 100%); }
.cat-nav-slider-viewport::after  { right: 0; background: linear-gradient(to left, #fff 0%, transparent 100%); }
.cat-nav-slider-track {
    display: flex;
    gap: 8px;
    width: max-content;
    padding: 4px 8px;
}
.cat-nav-slider-item {
    flex-shrink: 0;
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    gap: 5px;
    padding: 4px 3px;
    border-radius: 10px;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.cat-nav-slider-item:active { background: rgba(102,126,234,0.1); }
.cat-nav-slider-item img {
    width: 64px; height: 64px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.2s;
    display: block;
}
.cat-nav-slider-item:active img { transform: scale(0.93); }
.cat-nav-slider-placeholder {
    width: 64px; height: 64px;
    border-radius: 10px;
    background: #f0f0f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 1.2rem;
}
.cat-nav-slider-item span {
    font-size: 0.6rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    line-height: 1.2;
    max-width: 66px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.scroll-to-top-btn {
    position: fixed;
    bottom: 76px; right: 14px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(102,126,234,0.45);
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.scroll-to-top-btn:active { transform: scale(0.88); }
