
:root {
    --sidebar-w: 260px;
    --accent: #4f46e5;       /* Vibrant Indigo */
    --bg-body: #f8fafc;     /* Very Light Gray/White */
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-main: #1e293b;   /* Dark Slate */
    --text-dim: #64748b;    /* Muted Slate */
    --border: #e2e8f0;      /* Soft Border */
    --radius: 16px;
    --img-h-featured: 200px;
    --img-h-square: 150px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-body); color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    display: flex; min-height: 100vh;
}

/* --- 1. SIDEBAR (PC Only) --- */
.sidebar {
    width: var(--sidebar-w); height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed; left: 0; top: 0;
    padding: 35px 24px; z-index: 1000;
    display: flex; flex-direction: column;
}
.logo { font-size: 24px; font-weight: 900; color: var(--accent); letter-spacing: -1.5px; text-decoration: none; display: block; }
.sidebar .logo { margin-bottom: 45px; }

.cat-group { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-link {
    padding: 12px 16px; border-radius: 12px; color: var(--text-dim);
    text-decoration: none; font-size: 14px; font-weight: 600;
    transition: var(--transition); display: flex; align-items: center; gap: 12px;
}
.cat-link:hover { background: #f1f5f9; color: var(--accent); }
.cat-link.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }

/* --- 2. MAIN CONTENT --- */
.main-wrapper {
    flex: 1; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column; min-width: 0;
}

.top-header {
    padding: 20px 45px; display: flex; align-items: center;
    justify-content: space-between; position: sticky; top: 0;
    background: rgba(248, 250, 252, 0.8); backdrop-filter: blur(15px);
    z-index: 900; border-bottom: 1px solid transparent; transition: 0.3s;
}
/* Mobile Logo in Header (Hidden on PC) */
.top-header .logo { display: none; font-size: 20px; margin-right: 15px; }

.top-header.scrolled { border-bottom: 1px solid var(--border); }

.search-box { position: relative; width: 100%; max-width: 500px; }
.search-box input {
    width: 100%; padding: 12px 48px; border-radius: 14px;
    background: #fff; border: 1px solid var(--border); color: var(--text-main);
    outline: none; font-size: 14px; transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.search-box i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

/* Mobile Independent Category Bar (Hidden on PC) */
.mobile-cat-row { display: none; }

.content-body { padding: 10px 45px 80px; flex: 1; }
.section-title { font-size: 20px; font-weight: 800; margin: 45px 0 25px; color: var(--text-main); display: flex; align-items: center; gap: 12px; }
.section-title::before { content: ""; width: 4px; height: 20px; background: var(--accent); border-radius: 2px; }

/* GRIDS */
.grid-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 28px; }
.grid-popular { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px; }

/* CARDS */
.card {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    text-decoration: none; color: inherit; border: 1px solid var(--border);
    transition: var(--transition); display: flex; flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.card__img-box { width: 100%; overflow: hidden; background: #f1f5f9; position: relative; }
.card__img-box img { width: 100%; height: 100%; object-fit: cover; display: block; transition: 0.6s; }
.card:hover .card__img-box img { transform: scale(1.05); }
.grid-featured .card__img-box { height: var(--img-h-featured); }
.grid-popular .card__img-box { height: var(--img-h-square); }
.card__info { padding: 18px; }
.card__title { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.card__tag { font-size: 12px; color: var(--text-dim); font-weight: 500; }

/* --- 3. FOOTER --- */
.footer { background: #fff; border-top: 1px solid var(--border); padding: 0px 45px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 60px; }
.footer-links h5 { font-size: 14px; margin-bottom: 25px; color: var(--text-main); text-transform: uppercase; letter-spacing: 1.2px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 14px; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 14px; transition: 0.2s; }
.footer-links a:hover { color: var(--accent); padding-left: 4px; }
.footer-seo-row { max-width: 1200px; margin: 60px auto 0; padding-top: 50px; border-top: 1px solid var(--border); }
.footer-seo-row h4 { color: var(--text-main); font-size: 18px; margin-bottom: 20px; font-weight: 800; }
.footer-seo-row p { color: var(--text-dim); font-size: 14px; line-height: 1.8; text-align: justify; }
.footer-bottom { max-width: 1200px; margin: 60px auto 0; padding-top: 25px; display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--border); }

/* --- 4. UTILITIES --- */
.back-to-top { position: fixed; bottom: 40px; right: 40px; width: 50px; height: 50px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 2000; box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4); }
.back-to-top.show { opacity: 1; visibility: visible; }

/* ==========================================
   MOBILE ADJUSTMENTS (MODIFIED)
   ========================================== */
@media (max-width: 1024px) {
    body { flex-direction: column; }
    .sidebar { display: none; } /* Hide Sidebar */
    .main-wrapper { margin-left: 0; }

    /* Show Logo in Header for Mobile */
    .top-header { padding: 12px 20px; display: flex; position: sticky; top: 0; background: #fff; }
    .top-header .logo { display: block; flex-shrink: 0; }
    .search-box { max-width: none; flex-grow: 1; }
    .search-box input { padding: 10px 40px; }

    /* Mobile Independent Category Bar */
    .mobile-cat-row {
        display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px;
        background: #fff; border-bottom: 1px solid var(--border);
        position: sticky; top: 65px; /* Stay below header */
        z-index: 850; scrollbar-width: none;
    }
    .mobile-cat-row::-webkit-scrollbar { display: none; }
    .m-item {
        padding: 6px 16px; background: #f1f5f9; border-radius: 20px;
        white-space: nowrap; font-size: 13px; color: var(--text-dim);
        text-decoration: none; font-weight: 600;
    }
    .m-item.active { background: var(--accent); color: #fff; }

    .content-body { padding: 10px 20px 80px; }
    .grid-featured { grid-template-columns: 1fr; gap: 20px; }
    .grid-popular { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .footer-grid { grid-template-columns: 1fr; gap: 40px; padding: 40px 20px; }
}