/* UNIVERSAL RESET */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* PC BACKGROUND (Void) */
/* PC BACKGROUND (Clean White) */
html {
    background-color: #ffffff;
    height: 100%;
}

/* APP SIMULATION CONTAINER */
body {
    margin: 0 auto;
    /* Center on Desktop */
    padding: 0;
    width: 100%;
    max-width: 480px;
    /* PHONE WIDTH LOCK */
    min-height: 100vh;
    background-color: #F5F7FA;
    font-family: 'Prompt', sans-serif;
    color: #333;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    /* Elevation on PC */
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

@media (max-width: 480px) {
    html {
        background: #F5F7FA;
    }

    /* Match app bg on mobile */
    body {
        box-shadow: none;
    }
}

/* SHARED UTILS */
img {
    max-width: 100%;
    height: auto;
}

.text-center {
    text-align: center;
}

.w-100 {
    width: 100%;
}

/* Page Loader & Transitions */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.4s ease;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(238, 77, 45, 0.1);
    border-top: 4px solid #ee4d2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loader-fade-out {
    opacity: 0;
    pointer-events: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- SHOPEE STYLE COMPONENTS --- */

.quick-links {
    display: flex;
    overflow-x: auto;
    padding: 15px 10px;
    gap: 15px;
    background: white;
    scrollbar-width: none;
}

.quick-links::-webkit-scrollbar {
    display: none;
}

.ql-item {
    flex: 0 0 65px;
    text-align: center;
    text-decoration: none;
}

.ql-icon {
    width: 45px;
    height: 45px;
    border-radius: 18px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ql-text {
    font-size: 11px;
    color: #444;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category Grid */
.cat-grid-container {
    padding: 15px 0;
    background: white;
    margin-top: 10px;
    overflow: hidden;
}

.cat-grid-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 15px;
    padding: 0 15px;
    text-transform: uppercase;
}

.cat-grid-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.cat-grid-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.cat-grid {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 80px;
    /* Precise width for each item */
    gap: 12px 0;
    padding: 0 10px;
}

.cat-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 80px;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-grid-item:active {
    transform: scale(0.95);
}

.cat-grid-item.active .cat-grid-icon-box {
    background: #fffcf0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.1);
}

.cat-grid-item.active .cat-grid-text {
    color: #ee4d2d;
    font-weight: 600;
}

.cat-grid-icon-box {
    width: 45px;
    height: 45px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-grid-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cat-grid-text {
    font-size: 11px;
    color: #333;
    line-height: 1.25;
    width: 70px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.5em;
    /* Lock height for alignment */
}

/* Flash Sale */
.flash-sale-container {
    background: white;
    margin-top: 10px;
    padding: 15px 0;
}

.fs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 15px;
}

.fs-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fs-title {
    color: #ee4d2d;
    font-size: 18px;
    font-weight: 800;
    font-style: italic;
    text-transform: uppercase;
}

.fs-timer {
    display: flex;
    gap: 4px;
}

.timer-box {
    background: #333;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    min-width: 20px;
    text-align: center;
}

.fs-more {
    color: #ee4d2d;
    font-size: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fs-scroll {
    display: flex;
    overflow-x: auto;
    padding: 0 15px;
    gap: 10px;
    scrollbar-width: none;
}

.fs-scroll::-webkit-scrollbar {
    display: none;
}

.fs-card {
    flex: 0 0 120px;
    text-align: center;
    position: relative;
}

.fs-img-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.fs-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fs-price {
    color: #ee4d2d;
    font-size: 15px;
    font-weight: 700;
    margin-top: 8px;
}

.fs-discount-tag {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ffeb3b;
    color: #ee4d2d;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 4px;
    border-radius: 4px;
}

.fs-mall-tag {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #ee4d2d;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
}

.fs-progress-container {
    height: 12px;
    background: #ffe0d9;
    border-radius: 10px;
    margin-top: 5px;
    position: relative;
    overflow: hidden;
}

.fs-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff7337, #ee4d2d);
    border-radius: 10px;
}

.fs-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 9px;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Redesign Section Headers */
.section-title-box {
    padding: 15px 20px 10px;
    background: white;
    margin-top: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}