:root{
    --bg:#222222;
    --text:#e9eef6;
  
    --gap:22px;
    --max:1200px;
  
    --uiScale: .90;
  
    --cardBg: rgba(255,255,255,.06);
    --cardBorder: rgba(255,255,255,.10);
    --thumbBorder: rgba(255,255,255,.14);
    --shadow:0 18px 45px rgba(0,0,0,.55);
    --radius:10px;
  
    --buyBg:#12b6ad;
    --buyHover:#16c6bc;
  
    --metaBg: rgba(0,0,0,.32);
    --metaTextDim: rgba(233,238,246,.65);
  
    --btnGlass: rgba(255,255,255,.06);
    --btnGlassHover: rgba(255,255,255,.09);
    --btnGlassBorder: rgba(255,255,255,.10);
    --btnGlassBorderActive: rgba(255,255,255,.22);
  }
  
  *{ box-sizing:border-box; }
  body{
    margin:0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
  }
  
  /* Wrap */
  .wrap{
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 18px 80px;
  }
  .grid{ min-width: 0; }
  .toolbar{ min-width: 0; }
  .search{ min-width: 0; }
  
  /* Toolbar */
  .toolbar{
    display:grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items:center;
    gap: 12px;
    margin-bottom: 18px;
  }
  
  .search{
    position:relative;
    width:100%;
    min-width:0;
  }
  .search input{
    width:100%;
    height: 42px;
    appearance:none;
    background: rgba(255,255,255,.08);
    color: var(--text);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    padding: 12px 14px 12px 42px;
    font-size: 14px;
    font-weight: 650;
    box-shadow: 0 10px 22px rgba(0,0,0,.35);
    outline:none;
  }
  .search input::placeholder{ color: rgba(233,238,246,.65); }
  .search input:focus{
    border-color: rgba(255,255,255,.22);
    box-shadow: 0 12px 26px rgba(0,0,0,.45);
  }
  .search .ic{
    position:absolute;
    left:14px;
    top:50%;
    transform: translateY(-50%);
    width:18px;
    height:18px;
    fill: rgba(233,238,246,.85);
    opacity: .9;
    pointer-events:none;
  }
  
  .right-tools{
    display:flex;
    align-items:center;
    gap:10px;
    justify-self:end;
    flex:0 0 auto;
  }
  
  .select{
    position:relative;
    width: 88px;
    max-width: 60vw;
  }
  .select select{
    width:100%;
    height:42px;
    appearance:none;
    background: rgba(255,255,255,.08);
    color: var(--text);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    padding: 10px 34px 10px 12px;
    font-size: 14px;
    font-weight: 750;
    box-shadow: 0 10px 22px rgba(0,0,0,.35);
    outline:none;
    cursor:pointer;
  }
  .select select:focus{
    border-color: rgba(255,255,255,.22);
    box-shadow: 0 12px 26px rgba(0,0,0,.45);
  }
  .select:after{
    content:"";
    position:absolute;
    right:14px;
    top:50%;
    width:10px;
    height:10px;
    transform: translateY(-60%) rotate(45deg);
    border-right:2px solid rgba(233,238,246,.75);
    border-bottom:2px solid rgba(233,238,246,.75);
    pointer-events:none;
    opacity:.9;
  }
  .select select option{
    background:#111722;
    color: rgba(233,238,246,.95);
  }
  
  .layout-group{ display:flex; align-items:center; }
  .layout-btn{
    width:42px;
    height:42px;
    border-radius: 6px;
    border: 1px solid var(--btnGlassBorder);
    background: var(--btnGlass);
    cursor:pointer;
    display:grid;
    place-items:center;
    box-shadow: 0 10px 22px rgba(0,0,0,.28);
    transition: transform .12s ease, background .15s ease, border-color .15s ease;
  }
  .layout-btn:hover{ transform: translateY(-1px); background: var(--btnGlassHover); }
  .layout-btn.active{ border-color: var(--btnGlassBorderActive); background: rgba(255,255,255,.14); }
  .layout-ic{ width:18px; height:18px; fill: rgba(255,255,255,.88); opacity:.95; }
  
  /* Grid */
  .grid{
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
  }
  .grid.cols-6{ grid-template-columns: repeat(6, 1fr); }
  
  @media (max-width:1100px){
    .grid{ grid-template-columns: repeat(3,1fr); }
    .grid.cols-6{ grid-template-columns: repeat(4,1fr); }
  }
  @media (max-width:820px){
    .grid{ grid-template-columns: repeat(2,1fr); }
    .grid.cols-6{ grid-template-columns: repeat(3,1fr); }
  }
  @media (max-width:520px){
    .wrap{ padding: 12px 12px 70px; }
    .grid{ grid-template-columns: repeat(2, 1fr); }
    .grid.cols-6{ grid-template-columns: repeat(2, 1fr); }
    .toolbar{ gap: 10px; }
    .select{ width: 86px; }
  }
  
  /* Empty */
  .empty{
    opacity:.75;
    padding: 18px 0 0;
    font-size: 14px;
  }
  
  /* Product Card */
  .card{
    background: var(--cardBg);
    border: 1px solid var(--cardBorder);
    border-radius: var(--radius);
    padding: 5px;
    box-shadow: var(--shadow);
  }
  
  .thumb{
    border-radius: 6px;
    overflow:hidden;
    aspect-ratio: 16 / 10;
    background: #0b0f14;
    border: 1px solid var(--thumbBorder);
    cursor: pointer;
  }
  .thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition: transform .25s ease;
  }
  .card:hover .thumb img{ transform: scale(1.2); }
  
  .buy-btn{
    width:100%;
    height:30px;
    margin-top: 10px;
    border:0;
    border-radius: 4px;
    background: var(--buyBg);
    color:#fff;
    font-weight: 900;
    font-size: 16px;
    letter-spacing: .6px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 10px;
    cursor:pointer;
    box-shadow: 0 10px 22px rgba(0,0,0,.35);
    transition: transform .12s ease, background .15s ease;
  }
  .buy-btn:hover{ background: var(--buyHover); transform: translateY(-1px); }
  .buy-btn:active{ transform: translateY(0); }
  
  .buy-btn svg{
    width:18px; height:18px;
    fill:#fff; opacity:.95;
    display:block;
  }
  
  @keyframes spin { to { transform: rotate(360deg); } }
  .buy-btn .spinner{
    display:none;
    width:18px; height:18px;
    border:2px solid rgba(255,255,255,.35);
    border-top-color:#fff;
    border-radius:50%;
    animation: spin .8s linear infinite;
  }
  .buy-btn.loading .buy-label{ display:none; }
  .buy-btn.loading svg{ display:none; }
  .buy-btn.loading .spinner{ display:block; }
  .buy-btn.loading{ pointer-events:none; opacity:.95; }
  
  .meta{
    margin-top: 10px;
    background: var(--metaBg);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 10px 10px 8px;
  }
  .meta-title{
    font-weight: 900;
    font-size: 13px;
    color: rgba(233,238,246,.95);
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .1px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
  }
  .meta-row{
    margin-top: 6px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size: 13px;
    color: var(--metaTextDim);
  }
  .meta-id{ opacity:.95; }
  .meta-state{ opacity:.9; }
  
  /* Modal */
  body.modal-lock{ overflow:hidden; }
  
  .modal{
    position:fixed;
    inset:0;
    background: rgba(29, 29, 29, 0.72);
    display:none;
    align-items:center;
    justify-content:center;
    padding: 18px;
    z-index: 999;
  }
  .modal.open{ display:flex; }
  
  .modal-card{
    width: min(1100px, 96vw);
    background: #202020;
    border-radius: 18px;
    overflow:hidden;
    box-shadow: 0 26px 70px rgba(36, 36, 36, 0.6);
    border: 1px solid rgba(255,255,255,.08);
  }
  .modal-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: var(--text);
  }
  .modal-title{
    font-weight: 800;
    font-size: 16px;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 46px);
  }
  .modal-close{
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(233,238,246,.9);
    font-size: 20px;
    cursor:pointer;
  }
  .modal-close:hover{ background: rgba(255,255,255,.06); }
  
  /* Modal layout (image left + info right) */
  .modal-content{
    display:grid;
    grid-template-columns: 1.35fr .85fr;
    gap: 14px;
    padding: 14px;
    background: #0b0f14;
  }
  .modal-media{
    border-radius: 14px;
    background: #131313;
    border: 1px solid rgba(255,255,255,.10);
    min-height: 420px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
  }
  .modal-media img{
    max-width: 100%;
    max-height: 72vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display:block;
  }
  
  .modal-info{
    border-radius: 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    padding: 14px;
    display:flex;
    flex-direction: column;
    gap: 10px;
  }
  .modal-h1{
    font-weight: 950;
    font-size: 18px;
    letter-spacing: .2px;
    line-height: 1.2;
    word-break: break-word;
    text-transform: uppercase;
  }
  .modal-lines{
    display:grid;
    gap: 6px;
    font-size: 13px;
    color: rgba(233,238,246,.82);
  }
  .modal-lines .k{
    color: rgba(233,238,246,.60);
    font-weight: 800;
    margin-right: 6px;
  }
  .modal-desc{
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(233,238,246,.75);
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 10px;
  
    /* ✅ bỏ giới hạn + bỏ cuộn */
    max-height: none;
    overflow: visible;
  
    white-space: pre-line; /* giữ xuống dòng nếu bạn dùng textContent có \n */
  }
  .modal-download{
    margin-top: auto;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: #12b6ad;
    color: #fff;
    font-weight: 950;
    font-size: 15px;
    letter-spacing: .4px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 10px;
    box-shadow: 0 14px 30px rgba(0,0,0,.45);
    transition: transform .12s ease, filter .15s ease;
  }
  .modal-download:hover{ transform: translateY(-1px); filter: brightness(1.03); }
  .modal-download:active{ transform: translateY(0); }
  
  .modal-download .spinner{
    display:none;
    width:18px; height:18px;
    border:2px solid rgba(255,255,255,.35);
    border-top-color:#fff;
    border-radius:50%;
    animation: spin .8s linear infinite;
  }
  .modal-download.loading .dl-ic{ display:none; }
  .modal-download.loading .spinner{ display:block; }
  .modal-download.loading{ pointer-events:none; opacity:.95; }
  
  .modal-note{
    font-size: 12px;
    color: rgba(233,238,246,.55);
  }
  
  /* Mobile modal */
  @media (max-width: 900px){
    .modal-content{ grid-template-columns: 1fr; }
    .modal-media{ min-height: 260px; }
    .modal-media img{ max-height: 52vh; }
  }
  
  /* Floating home */
  .fab-home{
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2000;
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    color: rgba(233,238,246,.95);
    font-weight: 800;
    letter-spacing: .6px;
  }
  .fab-home .bubble{
    width:56px;
    height:56px;
    border-radius: 50%;
    background:#f36c21;
    display:grid;
    place-items:center;
    box-shadow: 0 18px 40px rgba(0,0,0,.45);
    animation: wobble .75s ease-in-out infinite;
    transform-origin: 50% 70%;
  }
  .fab-home .bubble svg{
    width:34px;
    height:34px;
    fill:#fff;
    display:block;
  }
  .fab-home .label{
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 12px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform .12s ease, background .15s ease, border-color .15s ease;
  }
  .fab-home:hover .label{
    transform: translateY(-2px);
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.22);
  }
  @keyframes wobble{
    0%   { transform: rotate(0deg) translateY(0); }
    15%  { transform: rotate(-10deg) translateY(-1px); }
    35%  { transform: rotate(10deg)  translateY(-1px); }
    55%  { transform: rotate(-7deg)  translateY(0); }
    75%  { transform: rotate(7deg)   translateY(0); }
    100% { transform: rotate(0deg) translateY(0); }
  }
  @media (max-width:520px){
    .fab-home{ right:12px; bottom:12px; }
    .fab-home .bubble{ width:52px; height:52px; }
    .fab-home .bubble svg{ width:32px; height:32px; }
    .fab-home .label{ padding: 9px 12px; font-size: 11px; }
  }
  .share-row{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
  }
  
  .share-btn{
    height: 44px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-weight: 950;
    font-size: 14px;
    letter-spacing: .2px;
    cursor: pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 10px;
    box-shadow: 0 14px 30px rgba(0,0,0,.35);
    transition: transform .12s ease, filter .15s ease;
  }
  .share-btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }
  .share-btn:active{ transform: translateY(0); }
  
  .share-btn span{ opacity:.95; }
  
  /* ✅ Pinterest / Facebook brand colors */
  .share-pin{ background:#E60023; }   /* Pinterest Red */
  .share-fb{  background:#1877F2; }   /* Facebook Blue */
  
  /* chữ icon đơn giản */
  .share-btn::first-letter{
    font-size: 18px;
    font-weight: 1000;
    line-height: 1;
  }
  
  /* Mobile: xếp dọc nếu muốn */
  @media (max-width: 900px){
    .share-row{ grid-template-columns: 1fr; }
  }
  