
body{background:#f8fafc;font-family:system-ui,-apple-system,"Be Vietnam Pro",Segoe UI,Roboto,sans-serif;color:#0f172a;}

/* =========================
   PRELOADER
========================= */
#preloaderOverlay{
  position:fixed;
  inset:0;
  background:linear-gradient(180deg, rgba(3,7,18,0.86), rgba(6,10,26,0.86));
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2147483650; /* above everything including petals */
  transition:opacity .45s ease, visibility .45s ease;
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}
#preloaderOverlay.hide{ opacity:0; visibility:hidden; pointer-events:none; }
.preloader-inner{display:flex;flex-direction:column;align-items:center;gap:18px;padding:22px;}
.mandala-wrap{width:124px;height:124px;display:flex;align-items:center;justify-content:center;}
.mandala{
  width:100%;
  height:100%;
  animation: mandala-rotate 3.2s linear infinite;
  filter:drop-shadow(0 10px 30px rgba(0,0,0,0.35));
}
@keyframes mandala-rotate { to { transform: rotate(360deg); } }

.loader-label{color:#e6eef7;font-weight:800;letter-spacing:0.6px;}
.loader-bar{width:340px;height:10px;background:rgba(255,255,255,0.08);border-radius:999px;overflow:hidden;border:1px solid rgba(255,255,255,0.06)}
.loader-fill{height:100%;width:0%;background:linear-gradient(90deg,#ff8a8a 0%, #ff6fbf 50%, #8b5cf6 100%);transition:width .25s linear;box-shadow:0 6px 20px rgba(139,92,246,0.18) inset;}
.loader-percent{margin-top:6px;color:rgba(255,255,255,0.85);font-weight:700;font-size:13px;}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mandala{ animation: none; }
  .loader-fill{ transition: none; }
}

/* =========================
   LAYOUT (FIX CHỒNG LẤN)
   Desktop: sidebar fixed trái + content giữa + right-col fixed phải (sticky)
========================= */
:root{--sbw:210px;--rcw:270px;--mh:56px;}
.main-wrap{min-height:100vh;}
.content{padding:22px 14px 40px;}
.inner{max-width:980px;margin:0 auto;display:flex;flex-direction:column;}
.page-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}

@media(min-width:901px){
  .content{margin-left:var(--sbw);margin-right:var(--rcw);}
  .right-col{position:fixed;top:0;right:0;width:var(--rcw);height:100vh;overflow-y:auto;}
}

/* NOTICE BANNER (running text) */
/* Animation defined to move text from right to left (repeat) */
.notice-banner{
  width:100%;
  background:linear-gradient(90deg,#fffbeb,#fff7ed);
  border:1px solid #f3e8ff;
  padding:10px 14px;
  border-radius:12px;
  margin-bottom:12px;
  overflow:hidden;
  display:flex;
  align-items:center;
  gap:12px;
}
.notice-banner .label{font-weight:900;color:#7c2d12;flex:0 0 auto;}
.notice-banner .marquee-wrap{flex:1;overflow:hidden;position:relative;}
.notice-banner .marquee{
  display:inline-block;
  white-space:nowrap;
  will-change:transform;
  /* explicit direction: right -> left */
  animation:marquee-rtl 14s linear infinite;
  font-weight:800;color:#92400e;
}
@keyframes marquee-rtl{
  0%{ transform: translateX(100%); }
  100%{ transform: translateX(-100%); }
}
@media (max-width:900px){
  .notice-banner{padding:8px 10px;border-radius:8px;}
  .notice-banner .label{display:none;}
  .notice-banner .marquee{animation-duration:10s;}
}

/* AD CAROUSEL
   Make the ad/banner visible on both PC and mobile.
   - Ensure display:block on all viewports
   - Make images responsive and keep a reasonable height on mobile
*/
.ad-carousel{width:100%;overflow:hidden;border-radius:14px;margin-bottom:14px;border:1px solid #e6eef7;background:#fff;display:block !important;z-index:1}
.ad-track{display:flex;transition:transform .6s cubic-bezier(.4,0,.2,1);will-change:transform}
.ad-slide{min-width:100%;flex-shrink:0;display:block}
.ad-slide img{
  width:100%;
  height:260px;
  object-fit:cover;
  display:block;
  border-radius:14px;
}
.ad-dots{display:flex;gap:8px;justify-content:center;padding:10px 6px;background:transparent}
.ad-dot{width:10px;height:10px;border-radius:999px;background:#e6eef7;cursor:pointer;transition:all .18s}
.ad-dot.active{width:28px;background:linear-gradient(90deg,#60a5fa,#3b82f6);box-shadow:0 4px 12px rgba(59,130,246,.18)}
@media(max-width:900px){
  /* on mobile, slightly reduce height but keep visible */
  .ad-slide img{height:160px}
  .ad-carousel{margin-bottom:12px}
}

/* =========================
   PRODUCT CAROUSEL (UPDATED)
   - Center active slide will be shown centered in the viewport
   - Images forced to consistent display size using aspect-ratio and object-fit
   - Product title & price overlay on the image
   - No product description displayed
   - Title above carousel centered
   - Carousel loops seamlessly by cloning slides (when hitting clones it jumps back to originals without visible backward animation)
*/
.product-carousel{width:100%;overflow:hidden;border-radius:14px;margin:10px 0 18px;padding:0;background:transparent;border:0}
.product-track{display:flex;align-items:center;gap:18px;transition:transform .6s cubic-bezier(.4,0,.2,1);will-change:transform;padding:12px 0}
.product-slide{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:560px;max-width:75vw;box-sizing:border-box}
.product-card{width:100%;border-radius:12px;overflow:hidden;position:relative;border:1px solid #eef6ff;background:#fff;box-shadow:0 12px 36px rgba(2,6,23,0.06);display:flex;align-items:stretch;gap:0}

/* fixed image area: enforce same display size with aspect-ratio */
.product-card .img-wrap{width:100%;height:320px;overflow:hidden;position:relative;display:block;flex:1}
.product-card .img-wrap img{
  width:100%;
  height:100%;
  object-fit:cover; /* crop to fill box */
  display:block;
  transform: translateZ(0);
}

/* overlay on image: name, price and add button */
.product-card .img-overlay{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  padding:10px 12px;
  border-radius:10px;
  background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.46));
  display:flex;
  flex-direction:column;
  gap:6px;
  color:#fff;
  text-shadow:0 6px 18px rgba(0,0,0,0.55);
}
.product-card .img-overlay .title{font-size:1.05rem;font-weight:900}
.product-card .img-overlay .price{font-size:1rem;font-weight:900;color:#fde68a}
.product-card .img-overlay .add-btn{align-self:flex-start;padding:8px 12px;border-radius:8px;background:#10b981;color:#fff;border:0;font-weight:800;cursor:pointer}

/* hide description/meta per request */
.product-card .meta{display:none !important}

/* Active visual scale for center slide (optional gentle emphasis) */
.product-slide.active .product-card{
  transform: scale(1.01);
  transition:transform .35s ease;
}

/* mobile adjustments */
@media(max-width:900px){
  .product-slide{width:92vw;max-width:640px}
  .product-card .img-wrap{height:200px}
  .product-card .img-overlay{left:10px;right:10px;bottom:10px}
}

/* PRODUCT TITLE ABOVE CAROUSEL */
.product-section-title{font-weight:900;font-size:1.05rem;margin:8px 6px 10px;color:#0f172a;text-align:center}

/* Petal canvas: sit above all UI so petals aren't clipped by text/containers */
.petal-canvas{
  position:fixed;
  left:0;
  top:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:2147483647; /* very high so petals overlay all content */
  mix-blend-mode:normal;
  will-change:transform;
}

/* rest of styles ... (unchanged) */
.sidebar{width:var(--sbw);min-height:100vh;background:#fff;border-right:1px solid #e5e7eb;position:fixed;top:0;left:0;bottom:0;display:flex;flex-direction:column;z-index:10;}

.sidebar .logo{
  height:60px;
  display:flex;
  align-items:center;
  gap:10px;
  padding-left:20px;
  border-bottom:1px solid #e5e7eb;
  font-weight:700; /* LOGO đậm hơn */
  font-size:19px;
}

.sidebar nav{
  flex:1;
  padding:18px 0 0;
  display:flex;
  flex-direction:column;
}

.sidebar nav a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 28px;
  color:#444;
  font-size:15px;
  border-radius:10px 0 0 10px;
  margin-bottom:4px;
  text-decoration:none;
  transition:.18s;
  font-weight:700; /* MENU đậm */
}

.sidebar nav a.active,
.sidebar nav a:hover{
  background:#f2f2f4;
  color:#111;
  font-weight:900; /* ACTIVE / HOVER đậm hơn */
}

.sidebar .bottom{
  padding:16px 20px;
  font-size:13px;
  color:#888;
  border-top:1px solid #e5e7eb;
}

/* =========================
   RIGHT COL
========================= */
.right-col{background:#fff;border-left:1px solid #e5e7eb;padding:18px 16px;}
.right-col h3{font-size:14px;font-weight:800;color:#1e3a8a;display:flex;gap:6px;align-items:center;margin-bottom:14px;letter-spacing:.5px;text-transform:uppercase;}

/* small stat display */
.stat-box{display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:12px;background:#f8fafc;border:1px solid #eef2ff;color:#0f172a;font-weight:800;text-align:center;}
.stat-num{font-size:1.25rem;color:#0f172a;font-weight:900;}
.stat-label{font-size:0.85rem;color:#64748b;font-weight:800;}

/* =========================
   ONLINE USER ITEM (kept in CSS but not used)
========================= */
.online-item{display:flex;gap:10px;border:1px solid #e5e7eb;border-radius:12px;padding:10px 10px;margin-bottom:10px;background:#fff;transition:.15s;cursor:pointer;}
.online-item:hover{background:#f1f5f9;border-color:#d9e3ec;}
.ava{width:40px;height:40px;border-radius:999px;overflow:hidden;flex:0 0 40px;box-shadow:0 2px 6px rgba(96,165,250,.25);display:flex;align-items:center;justify-content:center;background:#eef6ff;}
.ava img{width:100%;height:100%;object-fit:cover;display:block;}
.o-meta{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.2;}
.o-name{font-weight:700;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#0f172a;}
.o-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;}
.ping{width:10px;height:10px;background:#22c55e;border-radius:50%;box-shadow:0 0 0 4px #dcfce7;margin-top:6px;}

/* =========================
   POSTS LIST
   Ensure vertical scrollbar for posts area and smooth touch scrolling
========================= */
.auth-box{background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px 16px;font-size:.95rem;margin-bottom:18px;box-shadow:0 10px 24px -22px rgba(2,132,199,.35);}
.auth-box a{color:#2563eb;font-weight:800;text-decoration:none;}
.auth-box a:hover{text-decoration:underline;}
.announcements-scroll{
  max-height:calc(100vh - 190px);
  overflow-y:auto;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  padding-right:6px;
  scrollbar-width:thin;
  scrollbar-color:#93c5fd #e2e8f0;
}
.announcements-scroll::-webkit-scrollbar{width:10px;}
.announcements-scroll::-webkit-scrollbar-track{background:#f1f5f9;border-radius:12px;}
.announcements-scroll::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#93c5fd 0%,#3b82f6 95%);border-radius:12px;border:2px solid #f1f5f9;}
.empty{padding:50px 10px;text-align:center;color:#94a3b8;font-weight:800;}

.blog-post{background:#fff;border:1px solid #e5e7eb;border-radius:18px;overflow:hidden;box-shadow:0 10px 26px -22px rgba(2,132,199,.45);margin-bottom:14px;transition:.18s ease;}
.blog-post:hover{transform:translateY(-1px);border-color:#cfe8ff;box-shadow:0 18px 40px -30px rgba(2,132,199,.55);}
.blog-cover{height:88px;background:radial-gradient(700px 140px at 18% 0%, rgba(59,130,246,.35), transparent 60%),radial-gradient(520px 160px at 86% 70%, rgba(34,197,94,.14), transparent 55%),linear-gradient(180deg, #0b1220, #0f172a);position:relative;}
.blog-cover-inner{position:absolute; inset:0;display:flex; align-items:flex-end; justify-content:space-between;padding:10px 12px;gap:10px;}
.blog-cover-badge,.blog-cover-cta{display:inline-flex; align-items:center; gap:8px;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);color:#e2e8f0;font-size:12px;backdrop-filter: blur(6px);white-space:nowrap;}
.blog-cover-badge{font-weight:900;letter-spacing:.2px;}
.blog-cover-cta{font-weight:800;opacity:.92;}
.blog-body{ padding:12px 14px 12px; }
.blog-title{font-size:1.05rem;line-height:1.25;font-weight:950;color:#0f172a;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.blog-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;color:#64748b;font-size:.78rem;font-weight:850;margin-bottom:10px;}
.meta-chip{display:inline-flex; align-items:center; gap:7px;padding:5px 9px;border-radius:999px;background:#f1f5f9;border:1px solid #e2e8f0;color:#334155;}
.meta-sub{ color:#94a3b8; font-weight:800; }
.blog-excerpt{font-size:.98rem;line-height:1.7;color:#334155;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
.blog-actions{margin-top:12px;display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;}
.readpage-btn{display:inline-flex;align-items:center;gap:8px;padding:9px 12px;border-radius:12px;font-weight:900;border:1px solid #e2e8f0;background:#fff;color:#0f172a;text-decoration:none;}
.readpage-btn:hover{background:#f1f5f9;transform:translateY(-1px);}

.mobile-header{display:none;align-items:center;justify-content:space-between;position:fixed;top:0;left:0;right:0;z-index:200;background:#fff;border-bottom:1px solid #e5e7eb;height:var(--mh);padding:0 10px;}
.mobile-header .mh-btn{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;font-size:23px;background:#f3f6fa;border:1px solid #e5e7eb;box-shadow:0 2px 8px rgba(96,165,250,.15);cursor:pointer;transition:.15s;}
.mobile-header .mh-logo{display:flex;align-items:center;gap:10px;font-size:19px;font-weight:700;}

/* Mobile menu overlay (when open, dim the rest of the screen) */
.mobile-menu-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.36);backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .25s;z-index:100;}
.mobile-menu-overlay.open{opacity:1;pointer-events:auto;}

/* =========================
   MOBILE MENU / ONLINE SIDEBAR / POST MODAL / RESPONSIVE
========================= */
.mobile-menu-btn{display:none;position:fixed;top:16px;left:16px;z-index:130;width:44px;height:44px;border-radius:12px;background:#fff;border:1px solid #e5e7eb;align-items:center;justify-content:center;font-size:22px;cursor:pointer;box-shadow:0 2px 8px #0002;transition:.15s;}
.mobile-menu{position:fixed;top:0;left:0;height:100%;width:220px;background:#fff;border-right:1px solid #e5e7eb;transform:translateX(-100%);z-index:120;display:flex;flex-direction:column;padding:18px 0 26px;gap:10px;transition:.3s cubic-bezier(.4,0,.2,1);box-shadow:2px 0 14px -4px rgba(0,0,0,.16);}
.mobile-menu.open{transform:translateX(0);}
.mobile-menu .logo{display:flex;align-items:center;gap:10px;padding:0 18px 12px;border-bottom:1px solid #e5e7eb;font-size:19px;font-weight:800;}
.mobile-menu a{padding:10px 28px;color:#334155;font-size:15px;text-decoration:none;display:flex;align-items:center;gap:10px;border-radius:10px;transition:.18s;font-weight:400;}
.mobile-menu a.active,.mobile-menu a:hover{background:#f1f5f9;color:#0f172a;font-weight:400;}

/* =========================
   MOBILE ONLINE SIDEBAR
   (only shows stats now)
========================= */
#mobileOnlineOverlay{position:fixed;inset:0;background:rgba(0,0,0,.29);backdrop-filter:blur(2px);z-index:300;opacity:0;pointer-events:none;transition:.22s;}
#mobileOnlineOverlay.open{opacity:1;pointer-events:auto;}
#mobileOnlineSidebar{position:fixed;top:0;right:0;width:300px;max-width:96vw;height:100vh;background:#fff;border-left:1px solid #e5e7eb;z-index:320;transform:translateX(100%);transition:.29s cubic-bezier(.4,0,.2,1);box-shadow:-2px 0 16px -6px rgba(96,165,250,.35);display:flex;flex-direction:column;}
#mobileOnlineSidebar.open{transform:translateX(0);}
#mobileOnlineSidebar .mobsb-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 12px;border-bottom:1px solid #e5e7eb;}
#mobileOnlineSidebar .mobsb-title{font-weight:900;font-size:17px;color:#2563eb;display:flex;align-items:center;gap:7px;}
#mobileOnlineSidebar .mobsb-close{font-size:23px;color:#888;cursor:pointer;padding:7px;border-radius:8px;transition:.16s;}
#mobileOnlineSidebar .mobsb-close:hover{background:#f3f6fa;}
#mobileOnlineSidebar .mobsb-body{padding:14px 16px 8px;flex:1;overflow-y:auto;}
#mobileOnlineSidebar .online-item{margin-bottom:10px;}

/* =========================
   RESPONSIVE
========================= */
@media(max-width:900px){
  .sidebar{display:none}
  .right-col{display:none}
  /* Mobile header visible on small screens — add background image here */
  .mobile-header{
    display:flex;
    /* background image for mobile header — change URL to your preferred image */
    background-image:
      linear-gradient(to right, rgba(2,6,23,0.15), rgba(2,6,23,0.15)),
      url('https://i.imgur.com/BqdhR0h.png');
    background-size:cover;
    background-position:center;
    color:#fff;
    border-bottom: none;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02);
  }
  .mobile-header .mh-btn{
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    box-shadow: none;
  }
  .mobile-header .mh-btn:hover{
    background: rgba(255,255,255,0.12);
  }
  .mobile-header .mh-logo img{
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
  }
  .mobile-header .mh-logo span{
    color: #fff;
    font-weight:800;
    text-shadow: 0 2px 6px rgba(0,0,0,0.35);
  }

  .content{margin:0;padding-top:calc(var(--mh) + 16px);}
  .blog-cover{ height:74px; }
  .blog-body{ padding:12px 12px 12px; }
  .blog-actions{ justify-content:space-between; }
  .readpage-btn{ flex:1; justify-content:center; }
}
@media(min-width:901px){
  #mobileOnlineOverlay,#mobileOnlineSidebar{display:none!important;}
}
