/* =========================================
   92MOBILE - DESIGN SYSTEM (style.css)
   Mobile-First | Glassmorphism | Zero CLS
   ========================================= */

/* 1. DESIGN TOKENS */
:root {
    --bg-color: #FFFFFF;
    --bg-secondary: #FAFAFA;
    --text-main: #1A1A1A;
    --text-muted: #757575;
    --text-light: #9E9E9E;
    --accent-primary: #007AFF;
    --accent-primary-light: rgba(0, 122, 255, 0.1);
    --accent-secondary: #FF9500;
    --fomo-gradient: linear-gradient(135deg, #FF9500 0%, #FFCC00 100%);
    --success-color: #34C759;
    --danger-color: #FF3B30;
    --skeleton-bg: #E8E8E8;
    --skeleton-shine: linear-gradient(90deg, #E8E8E8 0%, #F5F5F5 50%, #E8E8E8 100%);
    --border-color: #EEEEEE;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-blur: blur(20px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50px;
    --header-height: 60px;
    --bottom-nav-height: 60px;
    --ad-bottom-height: 50px;
    --screen-padding: 16px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 2. RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-stack);
    background-color: #F0F0F0;
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: 16px;
}

/* Image Utilities */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.object-cover {
    object-fit: cover;
}

picture {
    display: block;
    width: 100%;
    height: 100%;
}

picture img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Blog Article Content Images */
.blog-article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 3. APP CONTAINER */
.app-container {
    width: 100%;
    max-width: 430px;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

/* 4. GLASSMORPHISM HEADER */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: var(--header-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 var(--screen-padding);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.app-header.scrolled {
    border-bottom-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.search-bar {
    width: 100%;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    gap: 8px;
    transition: all 0.3s ease;
}

.search-icon {
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* 5. MAIN CONTENT AREA */
.main-scroll-view {
    flex: 1;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--ad-bottom-height) + 10px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 6. SECTIONS */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px var(--screen-padding) 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.see-all {
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 600;
}

/* 7. CATEGORY CHIPS */
.categories-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 var(--screen-padding);
    gap: 10px;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 72px;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-chip:active {
    transform: scale(0.95);
}

.category-chip .chip-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    box-shadow: var(--shadow-sm);
}

.category-name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 8. PRODUCT CARDS */
.products-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 var(--screen-padding) 16px;
    gap: 12px;
    scrollbar-width: none;
}

.products-scroll::-webkit-scrollbar {
    display: none;
}

.product-card {
    flex: 0 0 160px;
    scroll-snap-align: start;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: white;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.product-card:active {
    transform: scale(0.97);
}

.product-img-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fomo-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.badge-fomo {
    background: var(--fomo-gradient);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.product-details {
    padding: 10px;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.current-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-primary);
}

.old-price {
    font-size: 11px;
    text-decoration: line-through;
    color: var(--text-muted);
}

.discount-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--success-color);
}

/* 9. PRODUCT GRID (Listing) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 var(--screen-padding) 16px;
}

.product-grid .product-card {
    flex: unset;
}

/* 10. BUTTONS */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    background: transparent;
}

.btn-ghost {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 14px;
    padding: 8px;
}

/* 11. SKELETON LOADING */
.skeleton {
    background: var(--skeleton-bg);
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--skeleton-shine);
    animation: shimmer 1.5s infinite;
}

/* 12. BOTTOM FIXED AREA */
.bottom-fixed-area {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    z-index: 1000;
}

.ad-slot-bottom-wrapper {
    width: 100%;
    height: var(--ad-bottom-height);
    background: #F8F8F8;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-slot-bottom {
    width: 320px;
    height: 50px;
}

/* 13. BOTTOM NAV */
.bottom-nav {
    width: 100%;
    height: var(--bottom-nav-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 4px 0;
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-item .icon {
    width: 22px;
    height: 22px;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
}

/* 14. ICON BASE */
.icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 15. AD CONTAINERS */
.ad-container,
.ad-skeleton {
    min-height: 100px;
    border-radius: var(--radius-sm);
    margin: 8px var(--screen-padding);
}

.ad-in-article {
    margin: 20px 0;
}

.homepage-hero-ad {
    padding: 12px var(--screen-padding);
}

.ad-slot-hero {
    width: 100%;
    max-width: 300px;
    height: 250px;
    margin: 0 auto;
}

/* 16. TRUST BADGES */
.trust-badges {
    display: flex;
    gap: 8px;
    padding: 12px var(--screen-padding);
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

/* 17. ACCORDION */
.accordion {
    border-top: 1px solid var(--border-color);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px var(--screen-padding);
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
}

.accordion-header .chevron {
    transition: transform 0.3s;
    width: 18px;
    height: 18px;
}

.accordion-header.active .chevron {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 0 var(--screen-padding) 14px;
    display: none;
}

.accordion-body.show {
    display: block;
}

/* 18. STICKY CTA BAR */
.sticky-cta {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--ad-bottom-height));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    padding: 10px var(--screen-padding);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-color);
    z-index: 999;
}

/* 19. GALLERY */
.gallery-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.gallery-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery-scroll::-webkit-scrollbar {
    display: none;
}

.gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    aspect-ratio: 4/3;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s;
}

.gallery-dot.active {
    background: var(--accent-primary);
    width: 20px;
    border-radius: 4px;
}

/* 20. CHECKOUT PROGRESS */
.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px var(--screen-padding);
    gap: 0;
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    background: white;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.progress-step.active {
    border-color: var(--accent-primary);
    color: white;
    background: var(--accent-primary);
}

.progress-step.completed {
    border-color: var(--success-color);
    color: white;
    background: var(--success-color);
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    position: relative;
}

.progress-line.filled {
    background: var(--success-color);
}

/* 21. FORM STYLES */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-main);
    background: white;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* 22. PAYMENT CARDS */
.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.payment-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-radio.checked {
    border-color: var(--accent-primary);
}

.payment-radio.checked::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
}

/* 23. COMPARE TABLE */
.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th,
.compare-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    text-align: left;
}

.compare-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.compare-table .winner {
    color: var(--success-color);
    font-weight: 600;
}

/* 24. BLOG STYLES */
.blog-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
    background: white;
}

.blog-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
    object-fit: cover;
}

.blog-card-body {
    padding: 14px;
}

.blog-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.blog-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.blog-toc {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
}

.blog-toc h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

.blog-toc a {
    display: block;
    font-size: 13px;
    color: var(--accent-primary);
    padding: 4px 0;
}

/* 25. QUIZ STYLES */
.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

/* 26. CHAT BUBBLE */
.chat-bubble {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--ad-bottom-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 998;
    cursor: pointer;
}

.chat-bubble .icon {
    width: 24px;
    height: 24px;
    stroke: white;
}

/* 27. STAR RATING */
.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star {
    color: #FFD700;
    font-size: 14px;
}

.star.empty {
    color: var(--border-color);
}

.rating-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* 28. FLASH MESSAGES */
.flash-message {
    padding: 12px var(--screen-padding);
    margin: 8px var(--screen-padding);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.flash-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.flash-error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* 29. VIGNETTE OVERLAY */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vignette-content {
    width: 90%;
    max-width: 350px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
}

.vignette-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.vignette-close-timer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* 30. LOADING SCREEN */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 31. EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px var(--screen-padding);
    color: var(--text-muted);
}

.empty-state .icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    stroke: var(--text-light);
}

/* ANIMATIONS */
@keyframes shimmer {
    to {
        left: 100%;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(0, 122, 255, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-pop-in {
    animation: popIn 0.3s ease forwards;
}

.animate-pulse {
    animation: pulseGlow 2s infinite;
}

/* UTILITY CLASSES */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.p-16 {
    padding: var(--screen-padding);
}

.gap-8 {
    gap: 8px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}