/* =====================================================================
   PRODUCT-HOME — Interactive Product Showcase
   Namespace: .product-home (frontend) / .product-home-admin (admin)
   Dark / carbon · Tomato Orange (#FF6347) · không đụng global CSS
   ===================================================================== */

.product-home{
  --ph-orange: var(--color-orange, #FF6347);
  --ph-bg: #07090a;
  --ph-panel: rgba(255,255,255,.03);
  --ph-border: rgba(255,255,255,.10);
  --ph-border-2: rgba(255,255,255,.16);
  --ph-text: #f5f5f5;
  --ph-dim: #9aa0a6;
  position:relative;
  width:100%;
  background:
    radial-gradient(1200px 600px at 22% 20%, rgba(var(--site-primary-rgb,255,99,71),.06), transparent 60%),
    linear-gradient(180deg,#0a0d0e 0%, #07090a 100%);
  color:var(--ph-text);
  padding:64px 0 56px;
  overflow:hidden;
  border-top:1px solid rgba(255,255,255,.05);
  border-bottom:1px solid rgba(255,255,255,.05);
  font-family:'Barlow Condensed','Smooch Sans',system-ui,sans-serif;
}
.product-home *{box-sizing:border-box;}
.product-home__inner{max-width:1480px;margin:0 auto;padding:0 32px;}

/* ---- topbar ---- */
.ph-topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px;}
.ph-eyebrow{display:inline-flex;align-items:center;gap:10px;color:var(--ph-orange);
  font-weight:700;font-size:13px;letter-spacing:.28em;text-transform:uppercase;}
.ph-eyebrow__dash{width:34px;height:2px;background:var(--ph-orange);display:inline-block;}
.ph-nav{display:flex;align-items:center;gap:10px;}
.ph-nav__btn{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--ph-border-2);background:rgba(255,255,255,.02);color:var(--ph-text);
  border-radius:50%;cursor:pointer;transition:.18s;}
.ph-nav__btn:hover{border-color:var(--ph-orange);color:var(--ph-orange);background:rgba(var(--site-primary-rgb,255,99,71),.08);}
.ph-nav__btn svg{fill:currentColor;}
.ph-nav__grid{border-radius:8px;}
.ph-counter{font-weight:600;font-size:18px;letter-spacing:.08em;color:var(--ph-dim);min-width:78px;text-align:center;}
.ph-counter b{color:var(--ph-orange);font-size:22px;}
.ph-counter i{opacity:.5;font-style:normal;margin:0 4px;}

/* ---- stage / slides (stack để fade+slide, không CLS) ---- */
.ph-stage{position:relative;display:grid;}
.ph-slide{grid-area:1/1;min-width:0;
  opacity:0;visibility:hidden;transform:translateX(34px) scale(.99);filter:blur(6px);
  transition:opacity .5s ease,transform .55s cubic-bezier(.2,.7,.2,1),filter .5s ease;
  pointer-events:none;}
.ph-slide.is-active{opacity:1;visibility:visible;transform:none;filter:none;pointer-events:auto;}
.ph-slide.is-prev{transform:translateX(-34px) scale(.99);}

.ph-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:46px;align-items:stretch;}

/* ---- viewer ---- */
.ph-viewer-col{display:flex;flex-direction:column;gap:14px;min-width:0;}
.ph-viewer{position:relative;flex:1;aspect-ratio:4/3;width:100%;
  border:1px solid var(--ph-border);border-radius:16px;overflow:hidden;
  background:
    radial-gradient(80% 80% at 50% 45%, rgba(255,255,255,.045), transparent 70%),
    linear-gradient(180deg,#0e1113,#090b0c);
  box-shadow:inset 0 0 60px rgba(0,0,0,.5);
  touch-action:none;user-select:none;}
.ph-badges{position:absolute;top:14px;left:14px;z-index:6;display:flex;align-items:center;gap:8px;}
.ph-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 11px;border-radius:8px;
  font-size:11.5px;font-weight:800;letter-spacing:.1em;line-height:1;backdrop-filter:blur(6px);}
.ph-badge--mode{border:1px solid var(--ph-border-2);background:rgba(10,12,14,.7);color:var(--ph-text);}
.ph-badge--mode svg{fill:var(--ph-orange);}
.ph-badge--new{background:var(--ph-orange);color:#0a0d0e;box-shadow:0 4px 14px rgba(var(--site-primary-rgb,255,99,71),.4);}
.ph-badge--hot{background:linear-gradient(90deg,#ff4d2d,#ff8a3d);color:#0a0d0e;box-shadow:0 4px 14px rgba(var(--site-primary-rgb,255,99,71),.4);}
.ph-viewer__full{position:absolute;top:14px;right:14px;z-index:6;width:38px;height:38px;border-radius:9px;
  border:1px solid var(--ph-border-2);background:rgba(10,12,14,.7);color:var(--ph-text);cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;transition:.18s;backdrop-filter:blur(6px);}
.ph-viewer__full:hover{border-color:var(--ph-orange);color:var(--ph-orange);}
.ph-viewer__full svg{fill:currentColor;}

/* thumbnails (cột dọc trái) */
.ph-thumbs{position:absolute;top:60px;left:14px;z-index:5;display:flex;flex-direction:column;gap:10px;}
.ph-thumb{width:62px;height:62px;border-radius:10px;overflow:hidden;cursor:pointer;padding:0;
  border:1px solid var(--ph-border-2);background:#0c0f10;transition:.18s;}
.ph-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.ph-thumb:hover{border-color:var(--ph-border-2);transform:translateY(-1px);}
.ph-thumb.is-active{border-color:var(--ph-orange);box-shadow:0 0 0 1px var(--ph-orange),0 6px 18px rgba(var(--site-primary-rgb,255,99,71),.25);}

/* toolbar (cột dọc phải) */
.ph-tools{position:absolute;top:64px;right:14px;z-index:5;display:flex;flex-direction:column;
  border:1px solid var(--ph-border);border-radius:12px;overflow:hidden;background:rgba(10,12,14,.55);backdrop-filter:blur(6px);}
.ph-tool{display:flex;flex-direction:column;align-items:center;gap:4px;width:64px;padding:11px 4px;
  border:0;border-bottom:1px solid var(--ph-border);background:transparent;color:var(--ph-dim);
  cursor:pointer;font-size:10px;font-weight:600;letter-spacing:.05em;transition:.16s;}
.ph-tool:last-child{border-bottom:0;}
.ph-tool svg{width:18px;height:18px;fill:currentColor;}
.ph-tool:hover{color:var(--ph-orange);background:rgba(var(--site-primary-rgb,255,99,71),.08);}
.ph-tool.is-on{color:var(--ph-orange);background:rgba(var(--site-primary-rgb,255,99,71),.12);}

/* canvas + layers */
.ph-canvas{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;}
.ph-2d{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;}
.ph-2d-img{max-width:94%;max-height:92%;object-fit:contain;will-change:transform;
  transition:transform .12s ease-out;cursor:grab;filter:drop-shadow(0 24px 50px rgba(0,0,0,.55));}
.ph-2d.is-grabbing .ph-2d-img{cursor:grabbing;transition:none;}
.ph-noimg{color:var(--ph-dim);font-size:14px;opacity:.7;}
.ph-glow{position:absolute;inset:0;pointer-events:none;mix-blend-mode:screen;opacity:.0;transition:opacity .4s,background .4s;z-index:1;}
.ph-glow.is-on{opacity:.55;}
.ph-360,.ph-3d{position:absolute;inset:0;}
.ph-360{display:flex;align-items:center;justify-content:center;cursor:ew-resize;}
.ph-360 img{max-width:94%;max-height:92%;object-fit:contain;pointer-events:none;}
.ph-3d{width:100%;height:100%;}
.ph-3d .pv-canvas-gl{width:100%!important;height:100%!important;display:block;}
/* VIDEO mode — object-fit contain, nền đen, KHÔNG crop sản phẩm, không toolbar 3D */
.ph-video{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#000;z-index:1;}
.ph-video-el{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;background:#000;border-radius:2px;outline:none;}
.ph-video-el::-webkit-media-controls-panel{background:linear-gradient(transparent,rgba(0,0,0,.6));}

/* hotspots */
.ph-hotspot{position:absolute;z-index:4;transform:translate(-50%,-50%);}
.ph-hotspot__dot{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:var(--ph-orange);color:#fff;cursor:pointer;box-shadow:0 0 0 4px rgba(var(--site-primary-rgb,255,99,71),.25);
  animation:ph-pulse 2s infinite;}
.ph-hotspot__dot svg{width:13px;height:13px;fill:#fff;}
@keyframes ph-pulse{0%{box-shadow:0 0 0 0 rgba(var(--site-primary-rgb,255,99,71),.45);}70%{box-shadow:0 0 0 10px rgba(var(--site-primary-rgb,255,99,71),0);}100%{box-shadow:0 0 0 0 rgba(var(--site-primary-rgb,255,99,71),0);}}
.ph-hotspot__pop{position:absolute;bottom:130%;left:50%;transform:translateX(-50%) translateY(6px);
  min-width:160px;max-width:240px;padding:10px 12px;border-radius:10px;background:#0c0f11;border:1px solid var(--ph-border-2);
  opacity:0;visibility:hidden;transition:.18s;pointer-events:none;z-index:7;box-shadow:0 14px 34px rgba(0,0,0,.5);}
.ph-hotspot__pop strong{display:block;color:var(--ph-orange);font-size:13px;margin-bottom:3px;}
.ph-hotspot__pop span{display:block;color:var(--ph-dim);font-size:12px;line-height:1.4;}
.ph-hotspot:hover .ph-hotspot__pop,.ph-hotspot:focus .ph-hotspot__pop,.ph-hotspot:focus-within .ph-hotspot__pop{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0);}

.ph-360badge{position:absolute;left:18px;bottom:16px;z-index:5;color:var(--ph-dim);font-weight:700;font-size:20px;letter-spacing:.06em;display:flex;align-items:center;gap:8px;}
.ph-360badge__arrow{width:34px;height:14px;border-bottom:2px solid var(--ph-dim);border-radius:0 0 14px 14px;opacity:.6;}

/* hints under viewer */
.ph-hints{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;
  border:1px solid var(--ph-border);border-radius:12px;padding:12px 16px;color:var(--ph-dim);
  font-size:12px;font-weight:600;letter-spacing:.08em;background:rgba(255,255,255,.02);}
.ph-hints span{display:inline-flex;align-items:center;gap:6px;}
.ph-hints svg{fill:var(--ph-orange);opacity:.85;}
.ph-hints i{opacity:.4;font-style:normal;}

/* ---- info col ---- */
.ph-info-col{display:flex;flex-direction:column;min-width:0;padding-top:6px;}
.ph-cat{display:flex;align-items:center;gap:14px;color:var(--ph-orange);font-weight:700;font-size:14px;
  letter-spacing:.22em;text-transform:uppercase;margin-bottom:14px;}
.ph-cat__line{flex:1;height:1px;background:linear-gradient(90deg,var(--ph-orange),transparent);max-width:120px;}
.ph-title{margin:0 0 18px;line-height:.96;font-weight:800;letter-spacing:.01em;text-transform:uppercase;}
.ph-title__a{display:block;color:var(--ph-orange);font-size:clamp(36px,4.4vw,68px);}
.ph-title__b{display:block;color:#fff;font-size:clamp(34px,4vw,62px);}
.ph-lead{color:#e7e7e7;font-size:18px;font-weight:600;margin:0 0 12px;}
.ph-desc{color:var(--ph-dim);font-size:15px;line-height:1.65;margin:0 0 24px;max-width:560px;
  font-family:'Smooch Sans',system-ui,sans-serif;}

.ph-features{display:grid;grid-template-columns:1fr 1fr;gap:16px 26px;margin-bottom:28px;}
.ph-feature{display:flex;align-items:flex-start;gap:12px;}
.ph-feature__ico{flex:0 0 auto;width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--color-border-orange,rgba(var(--site-primary-rgb,255,99,71),.45));background:rgba(var(--site-primary-rgb,255,99,71),.08);}
.ph-feature__ico svg{width:18px;height:18px;fill:var(--ph-orange);}
.ph-feature__txt strong{display:block;color:#fff;font-size:14px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;}
.ph-feature__txt small{display:block;color:var(--ph-dim);font-size:13px;margin-top:2px;}

.ph-cta{display:inline-flex;align-items:center;gap:12px;align-self:flex-start;
  padding:15px 30px;border:1px solid var(--ph-orange);border-radius:8px;color:var(--ph-orange);
  font-weight:700;font-size:14px;letter-spacing:.12em;text-transform:uppercase;text-decoration:none;
  transition:.2s;background:linear-gradient(90deg,rgba(var(--site-primary-rgb,255,99,71),.06),transparent);}
.ph-cta:hover{background:var(--ph-orange);color:#0a0d0e;box-shadow:0 10px 30px rgba(var(--site-primary-rgb,255,99,71),.3);}
.ph-cta svg{fill:currentColor;transition:transform .2s;}
.ph-cta:hover svg{transform:translateX(4px);}
.ph-cta.is-disabled{opacity:.5;cursor:default;pointer-events:none;}

/* ---- spec bar ---- */
.ph-specbar{display:grid;grid-template-columns:repeat(4,1fr);gap:0;margin-top:34px;
  border:1px solid var(--ph-border);border-radius:14px;overflow:hidden;background:rgba(255,255,255,.015);}
.ph-spec{display:flex;align-items:center;gap:14px;padding:20px 24px;border-right:1px solid var(--ph-border);}
.ph-spec:last-child{border-right:0;}
.ph-spec__ico{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--ph-border-2);background:rgba(var(--site-primary-rgb,255,99,71),.06);}
.ph-spec__ico svg{width:20px;height:20px;fill:var(--ph-orange);}
.ph-spec__txt small{display:block;color:var(--ph-dim);font-size:11px;letter-spacing:.16em;text-transform:uppercase;}
.ph-spec__txt strong{display:block;color:#fff;font-size:17px;font-weight:700;margin-top:3px;}

/* text stagger khi slide active */
.ph-slide.is-active .ph-cat,.ph-slide.is-active .ph-title,.ph-slide.is-active .ph-lead,
.ph-slide.is-active .ph-desc,.ph-slide.is-active .ph-features,.ph-slide.is-active .ph-cta{
  animation:ph-rise .55s both;}
.ph-slide.is-active .ph-title{animation-delay:.05s;}
.ph-slide.is-active .ph-lead{animation-delay:.10s;}
.ph-slide.is-active .ph-desc{animation-delay:.15s;}
.ph-slide.is-active .ph-features{animation-delay:.20s;}
.ph-slide.is-active .ph-cta{animation-delay:.25s;}
@keyframes ph-rise{from{opacity:0;transform:translateY(14px);}to{opacity:1;transform:none;}}
@media (prefers-reduced-motion:reduce){
  .ph-slide,.ph-slide *{animation:none!important;transition:opacity .2s!important;}
}

/* fullscreen */
.ph-viewer:fullscreen{width:100vw;height:100vh;aspect-ratio:auto;border-radius:0;background:#06080a;}
.ph-viewer:fullscreen .ph-2d-img{max-width:70%;max-height:80%;}

/* ---- responsive ---- */
@media (max-width:1080px){
  .ph-grid{gap:30px;}
  .ph-features{gap:14px 18px;}
}
@media (max-width:900px){
  .product-home{padding:44px 0 40px;}
  .product-home__inner{padding:0 18px;}
  .ph-grid{grid-template-columns:1fr;gap:26px;}
  .ph-viewer{aspect-ratio:1/1;}
  /* thumbnails -> hàng ngang dưới viewer */
  .ph-thumbs{position:static;flex-direction:row;flex-wrap:wrap;order:2;margin-top:12px;}
  .ph-viewer-col{}
  .ph-tools{top:auto;bottom:12px;right:12px;flex-direction:row;}
  .ph-tool{width:auto;flex-direction:row;gap:6px;padding:9px 10px;border-bottom:0;border-right:1px solid var(--ph-border);}
  .ph-tool:last-child{border-right:0;}
  .ph-tool span{display:none;}
  .ph-title__a{font-size:clamp(30px,8vw,44px);}
  .ph-title__b{font-size:clamp(28px,7.4vw,40px);}
  .ph-features{grid-template-columns:1fr 1fr;}
  .ph-cta{align-self:stretch;justify-content:center;}
  .ph-specbar{grid-template-columns:1fr 1fr;}
  .ph-spec:nth-child(2n){border-right:0;}
  .ph-spec{border-bottom:1px solid var(--ph-border);}
}
@media (max-width:540px){
  .ph-topbar{flex-wrap:wrap;gap:12px;}
  .ph-features{grid-template-columns:1fr;}
  .ph-specbar{grid-template-columns:1fr;}
  .ph-spec{border-right:0;}
  .ph-thumb{width:52px;height:52px;}
  .ph-2d-img{max-width:88%;}
}

/* =====================================================================
   3D VIEWER — loading / error / pro toolbar (ProductViewer / Three.js)
   ===================================================================== */
.pv-canvas-gl{position:absolute;inset:0;}
/* hidden attribute must win over the display:flex below */
.pv-loading[hidden],.pv-error[hidden],.ph-360[hidden],.ph-3d[hidden]{display:none!important;}
/* loading (real progress) */
.pv-loading{position:absolute;inset:0;z-index:8;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;
  background:rgba(7,9,10,.82);backdrop-filter:blur(3px);}
.pv-loading__ring{width:46px;height:46px;border-radius:50%;border:3px solid rgba(var(--site-primary-rgb,255,99,71),.2);border-top-color:var(--ph-orange);animation:pv-spin .8s linear infinite;}
@keyframes pv-spin{to{transform:rotate(360deg);}}
.pv-loading__txt{font-size:13px;font-weight:700;letter-spacing:.18em;color:var(--ph-text);text-transform:uppercase;}
.pv-loading__pct{font-size:28px;font-weight:800;color:var(--ph-orange);line-height:1;}
.pv-loading__bar{width:180px;max-width:60%;height:4px;border-radius:3px;background:rgba(255,255,255,.1);overflow:hidden;}
.pv-loading__bar i{display:block;height:100%;background:var(--ph-orange);transition:width .2s ease;}
/* error → 2D fallback prompt */
.pv-error{position:absolute;inset:0;z-index:8;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  text-align:center;padding:20px;background:rgba(7,9,10,.88);}
.pv-error svg{fill:var(--ph-orange);}
.pv-error strong{font-size:16px;color:var(--ph-text);}
.pv-error span{font-size:13px;color:var(--ph-dim);}
/* pro toolbar */
.pv-toolbar{position:absolute;top:62px;right:14px;z-index:7;display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-height:calc(100% - 80px);}
.pv-tb-toggle{width:40px;height:40px;border-radius:10px;border:1px solid var(--ph-border-2);background:rgba(10,12,14,.72);
  color:var(--ph-text);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;backdrop-filter:blur(6px);transition:.18s;flex:0 0 auto;}
.pv-tb-toggle:hover{border-color:var(--ph-orange);color:var(--ph-orange);}
.pv-tb-toggle svg{stroke:currentColor;}
.pv-toolbar.is-open .pv-tb-toggle{color:var(--ph-orange);border-color:var(--ph-orange);background:rgba(var(--site-primary-rgb,255,99,71),.12);}
.pv-tb-panel{display:none;width:214px;max-height:100%;overflow-y:auto;padding:12px;border:1px solid var(--ph-border);border-radius:12px;
  background:rgba(8,10,12,.88);backdrop-filter:blur(10px);box-shadow:0 18px 50px rgba(0,0,0,.55);}
.pv-toolbar.is-open .pv-tb-panel{display:block;}                 /* mobile: opt-in */
@media (min-width:901px){
  .pv-tb-panel{display:block;}                                  /* desktop: open by default */
  .pv-toolbar.is-closed .pv-tb-panel{display:none;}             /* gear collapses it */
}
.pv-tb-panel::-webkit-scrollbar{width:7px;}.pv-tb-panel::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16);border-radius:4px;}
.pv-tb-grp{margin-bottom:12px;}
.pv-tb-grp:last-child{margin-bottom:0;}
.pv-tb-grp>b{display:block;font-size:10px;font-weight:800;letter-spacing:.16em;color:var(--ph-dim);margin-bottom:7px;}
.pv-tb-row{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px;}
.pv-tb-btn{flex:1 1 auto;min-width:40px;padding:7px 8px;border:1px solid var(--ph-border-2);border-radius:7px;background:rgba(255,255,255,.03);
  color:var(--ph-text);font-size:11px;font-weight:600;letter-spacing:.02em;cursor:pointer;transition:.15s;white-space:nowrap;}
.pv-tb-btn:hover{border-color:var(--ph-orange);color:var(--ph-orange);background:rgba(var(--site-primary-rgb,255,99,71),.08);}
.pv-tb-btn.is-on{border-color:var(--ph-orange);color:#0a0d0e;background:var(--ph-orange);}
.pv-tb-views .pv-tb-btn{flex:1 1 28%;}
.pv-tb-rng{display:flex;flex-direction:column;gap:3px;margin:7px 0;font-size:10px;font-weight:700;letter-spacing:.06em;color:var(--ph-dim);text-transform:uppercase;}
.pv-tb-rng input[type=range]{width:100%;accent-color:var(--ph-orange);cursor:pointer;}

/* ---- UI polish (Phần 3) ---- */
.ph-cta{padding:16px 34px;font-size:15px;}
.ph-cta:hover{transform:translateY(-1px);}
.ph-spec{transition:background .18s;}
.ph-spec:hover{background:rgba(var(--site-primary-rgb,255,99,71),.06);}
.ph-spec:hover .ph-spec__ico{border-color:var(--ph-orange);}
.ph-feature{transition:transform .18s;}
.ph-feature:hover .ph-feature__ico{border-color:var(--ph-orange);background:rgba(var(--site-primary-rgb,255,99,71),.14);}
.ph-thumb img{transition:transform .2s;}
.ph-thumb:hover img{transform:scale(1.06);}

@media (max-width:900px){
  /* mobile: toolbar thành floating (gom nhóm, không che model) */
  .pv-toolbar{top:auto;bottom:14px;right:14px;max-height:none;}
  .pv-tb-panel{position:absolute;bottom:48px;right:0;width:200px;max-height:54vh;}
}

/* =====================================================================
   ADMIN — .product-home-admin
   ===================================================================== */
.product-home-admin .ph-fieldset{border:1px solid var(--color-border,rgba(255,255,255,.12));border-radius:10px;padding:18px 20px;margin-bottom:22px;}
.product-home-admin .ph-fieldset legend{padding:0 10px;font-weight:700;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--color-orange,#FF6347);}
.product-home-admin .grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
.product-home-admin .grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
@media (max-width:760px){.product-home-admin .grid-3,.product-home-admin .grid-2{grid-template-columns:1fr;}}
.product-home-admin .ph-empty{padding:22px;border:1px dashed var(--color-border-orange,#FF6347);border-radius:8px;text-align:center;color:var(--color-text-dim,#b5b5b5);background:rgba(var(--site-primary-rgb,255,99,71),.04);margin-bottom:16px;}

.product-home-admin .ph-card{border:1px solid var(--color-border,rgba(255,255,255,.14));border-radius:10px;margin-bottom:14px;background:var(--color-panel-2,#15191c);overflow:hidden;}
.product-home-admin .ph-card.is-off{opacity:.62;}
.product-home-admin .ph-card__head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;}
.product-home-admin .ph-card__toggle{display:flex;align-items:center;gap:12px;flex:1;min-width:0;border:0;background:transparent;color:inherit;cursor:pointer;text-align:left;padding:4px;}
.product-home-admin .ph-card__thumb{width:46px;height:46px;border-radius:8px;overflow:hidden;background:#0c0f10;border:1px solid var(--color-border,rgba(255,255,255,.12));flex:0 0 auto;}
.product-home-admin .ph-card__thumb img{width:100%;height:100%;object-fit:cover;}
.product-home-admin .ph-card__name{font-weight:600;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.product-home-admin .ph-card__mode{font-size:11px;font-weight:700;letter-spacing:.08em;color:var(--color-orange,#FF6347);border:1px solid var(--color-border-orange,rgba(var(--site-primary-rgb,255,99,71),.45));border-radius:5px;padding:2px 7px;}
.product-home-admin .ph-card__head-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto;}
.product-home-admin .ph-switch{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--color-text-dim,#b5b5b5);cursor:pointer;}
.product-home-admin .ph-card__body{display:none;padding:0 14px 16px;border-top:1px solid var(--color-border,rgba(255,255,255,.1));}
.product-home-admin .ph-card--open .ph-card__body{display:block;}

.product-home-admin .ph-subtabs{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0;}
.product-home-admin .ph-subtab{padding:7px 13px;border:1px solid var(--color-border,rgba(255,255,255,.14));border-radius:6px;background:transparent;color:var(--color-text-dim,#b5b5b5);font-size:12px;font-weight:600;cursor:pointer;}
.product-home-admin .ph-subtab.is-active{border-color:var(--color-orange,#FF6347);color:var(--color-orange,#FF6347);background:rgba(var(--site-primary-rgb,255,99,71),.08);}
.product-home-admin .ph-subpanel{display:none;}
.product-home-admin .ph-subpanel.is-active{display:block;}
.product-home-admin .ph-sub-h{font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text,#f5f5f5);margin:6px 0 10px;}
.product-home-admin .ph-hint{font-size:12px;color:var(--color-text-dim,#b5b5b5);margin:0 0 12px;}

.product-home-admin .ph-media,.product-home-admin .ph-media-multi{border:1px dashed var(--color-border,rgba(255,255,255,.16));border-radius:8px;padding:10px 12px;}
.product-home-admin .ph-media label,.product-home-admin .ph-media-multi label{display:block;font-size:12px;font-weight:600;margin-bottom:8px;color:var(--color-text,#f5f5f5);}
.product-home-admin .ph-media-preview{min-height:0;margin-bottom:8px;}
.product-home-admin .ph-media-preview img{max-width:140px;max-height:100px;border-radius:6px;border:1px solid var(--color-border,rgba(255,255,255,.12));display:block;}
.product-home-admin .ph-model-name{font-size:12px;color:var(--color-orange,#FF6347);word-break:break-all;}
.product-home-admin .ph-media-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.product-home-admin .ph-upload-status{font-size:12px;color:var(--color-text-dim,#b5b5b5);}
.product-home-admin .ph-multi-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px;}
.product-home-admin .ph-multi-item{position:relative;width:64px;height:64px;border-radius:6px;overflow:hidden;border:1px solid var(--color-border,rgba(255,255,255,.12));}
.product-home-admin .ph-multi-item img{width:100%;height:100%;object-fit:cover;}
.product-home-admin .ph-multi-del{position:absolute;top:2px;right:2px;width:18px;height:18px;border:0;border-radius:50%;background:rgba(0,0,0,.7);color:#fff;cursor:pointer;font-size:13px;line-height:1;}

.product-home-admin .ph-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:10px;}
.product-home-admin .ph-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.product-home-admin .ph-row input{flex:1;min-width:120px;}
.product-home-admin .ph-row .ph-row-icon{flex:0 0 110px;min-width:90px;}
.product-home-admin .ph-row-del{flex:0 0 auto;width:30px;height:30px;border:1px solid #ff6a6a;color:#ff6a6a;background:transparent;border-radius:6px;cursor:pointer;font-size:16px;line-height:1;}
.product-home-admin .ph-add-row{margin-bottom:6px;}

/* =====================================================================
   V2.1 — Icon field + Icon Picker + Admin Preview + UX
   ===================================================================== */
/* ---- icon field (button preview thay input text) ---- */
.product-home-admin .ph-icon-field{flex:0 0 150px;min-width:130px;}
.ph-icon-pick{display:flex;align-items:center;gap:8px;width:100%;padding:6px 10px;height:38px;
  border:1px solid var(--color-border,rgba(255,255,255,.16));border-radius:6px;background:rgba(255,255,255,.03);
  color:var(--color-text-dim,#b5b5b5);cursor:pointer;transition:.15s;text-align:left;}
.ph-icon-pick:hover{border-color:var(--color-orange,#FF6347);color:var(--color-orange,#FF6347);}
.ph-icon-pick.has-icon{color:var(--color-text,#f5f5f5);}
.ph-icon-pick__preview{width:22px;height:22px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;}
.ph-icon-pick__preview svg{width:20px;height:20px;fill:var(--color-orange,#FF6347);}
.ph-icon-pick__label{font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* ---- icon picker modal ---- */
.mcip-overlay{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;
  background:rgba(4,6,8,.72);backdrop-filter:blur(4px);padding:20px;}
.mcip-overlay.is-open{display:flex;}
.mcip-dialog{width:min(680px,100%);max-height:82vh;display:flex;flex-direction:column;border-radius:14px;overflow:hidden;
  background:#0f1316;border:1px solid var(--color-border-orange,rgba(var(--site-primary-rgb,255,99,71),.35));box-shadow:0 30px 80px rgba(0,0,0,.6);}
.mcip-head{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.08);}
.mcip-search{flex:1;display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid rgba(255,255,255,.14);border-radius:8px;background:rgba(255,255,255,.03);color:#9aa0a6;}
.mcip-input{flex:1;border:0;background:transparent;color:#f5f5f5;font-size:14px;outline:none;}
.mcip-clear,.mcip-close{border:0;background:transparent;color:#9aa0a6;font-size:22px;line-height:1;cursor:pointer;padding:0 6px;}
.mcip-clear:hover,.mcip-close:hover{color:var(--color-orange,#FF6347);}
.mcip-tabs{display:flex;align-items:center;gap:8px;padding:10px 16px;border-bottom:1px solid rgba(255,255,255,.06);}
.mcip-tab{padding:6px 12px;border:1px solid rgba(255,255,255,.14);border-radius:20px;background:transparent;color:#9aa0a6;font-size:12px;font-weight:600;cursor:pointer;transition:.15s;}
.mcip-tab.is-active{border-color:var(--color-orange,#FF6347);color:var(--color-orange,#FF6347);background:rgba(var(--site-primary-rgb,255,99,71),.1);}
.mcip-count{margin-left:auto;font-size:11px;color:#6b7177;}
.mcip-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px;padding:16px;overflow-y:auto;}
.mcip-item{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;padding:12px 6px 8px;
  border:1px solid rgba(255,255,255,.12);border-radius:10px;background:rgba(255,255,255,.02);color:#e7e7e7;cursor:pointer;transition:.15s;}
.mcip-item:hover{border-color:var(--color-orange,#FF6347);background:rgba(var(--site-primary-rgb,255,99,71),.1);box-shadow:0 0 0 3px rgba(var(--site-primary-rgb,255,99,71),.18);transform:translateY(-1px);}
.mcip-item.is-selected{border-color:var(--color-orange,#FF6347);background:rgba(var(--site-primary-rgb,255,99,71),.16);box-shadow:0 0 0 1px var(--color-orange,#FF6347);}
.mcip-item svg{width:26px;height:26px;fill:var(--color-orange,#FF6347);}
.mcip-name{font-size:11.5px;font-weight:600;text-align:center;line-height:1.2;}
.mcip-key{font-size:10px;color:#6b7177;font-family:var(--font-mono,monospace);}
.mcip-fav{position:absolute;top:4px;left:6px;font-size:12px;color:#3a3f44;line-height:1;cursor:pointer;}
.mcip-fav.is-fav{color:#ffcf3d;}
.mcip-fav:hover{color:#ffcf3d;}
.mcip-tick{position:absolute;top:4px;right:6px;font-size:12px;color:var(--color-orange,#FF6347);font-weight:800;}
.mcip-empty{padding:30px;text-align:center;color:#6b7177;font-size:13px;}

/* ---- admin realtime preview modal ---- */
.php-prev-overlay{position:fixed;inset:0;z-index:9998;display:none;background:rgba(4,6,8,.8);backdrop-filter:blur(4px);}
.php-prev-overlay.is-open{display:flex;align-items:stretch;justify-content:center;}
.php-prev-box{width:100%;max-width:1500px;margin:18px;display:flex;flex-direction:column;border-radius:14px;overflow:hidden;
  background:#07090a;border:1px solid rgba(255,255,255,.12);box-shadow:0 30px 80px rgba(0,0,0,.6);}
.php-prev-bar{display:flex;align-items:center;gap:16px;padding:12px 18px;background:#0f1316;border-bottom:1px solid rgba(255,255,255,.08);}
.php-prev-bar strong{color:var(--color-orange,#FF6347);font-size:13px;letter-spacing:.14em;text-transform:uppercase;}
.php-prev-devices{display:flex;gap:6px;margin:0 auto;}
.php-prev-devices button{padding:7px 16px;border:1px solid rgba(255,255,255,.16);border-radius:7px;background:transparent;color:#9aa0a6;font-size:12px;font-weight:600;cursor:pointer;transition:.15s;}
.php-prev-devices button.is-active{border-color:var(--color-orange,#FF6347);color:#0a0d0e;background:var(--color-orange,#FF6347);}
.php-prev-close{border:0;background:transparent;color:#9aa0a6;font-size:26px;line-height:1;cursor:pointer;}
.php-prev-close:hover{color:var(--color-orange,#FF6347);}
.php-prev-scroll{flex:1;overflow:auto;display:flex;justify-content:center;background:#050607;}
.php-prev-stage{width:100%;transition:max-width .25s ease;}
.php-prev-stage[data-device="tablet"]{max-width:768px;}
.php-prev-stage[data-device="mobile"]{max-width:402px;}
.php-prev-stage .product-home{padding:28px 0;border:0;}
.php-prev-stage .ph-viewer{aspect-ratio:4/3;}
.php-prev-extra{display:flex;gap:14px;flex-wrap:wrap;max-width:1480px;margin:8px auto 0;padding:0 32px 24px;}
.php-prev-extra figure{margin:0;width:150px;}
.php-prev-extra img{width:100%;height:100px;object-fit:cover;border-radius:8px;border:1px solid rgba(255,255,255,.12);}
.php-prev-extra figcaption{font-size:11px;color:#9aa0a6;text-align:center;margin-top:4px;letter-spacing:.08em;text-transform:uppercase;}

/* ---- UX: help text / tooltip ---- */
.product-home-admin .ph-help{display:flex;gap:8px;align-items:flex-start;padding:10px 12px;margin:0 0 14px;
  border-left:3px solid var(--color-orange,#FF6347);background:rgba(var(--site-primary-rgb,255,99,71),.06);border-radius:0 8px 8px 0;
  font-size:12.5px;color:var(--color-text-dim,#b5b5b5);line-height:1.5;}
.product-home-admin .ph-help b{color:var(--color-text,#f5f5f5);}

/* preview device emulation: media queries key off viewport, not container,
   so force the stacked layout + smaller title for tablet/mobile preview */
.php-prev-stage[data-device="tablet"] .ph-grid,
.php-prev-stage[data-device="mobile"] .ph-grid{grid-template-columns:1fr;gap:24px;}
.php-prev-stage[data-device="tablet"] .ph-specbar{grid-template-columns:1fr 1fr;}
.php-prev-stage[data-device="mobile"] .ph-specbar{grid-template-columns:1fr;}
.php-prev-stage[data-device="mobile"] .ph-title__a{font-size:34px;}
.php-prev-stage[data-device="mobile"] .ph-title__b{font-size:30px;}
.php-prev-stage[data-device="mobile"] .product-home__inner,
.php-prev-stage[data-device="tablet"] .product-home__inner{padding:0 18px;}
.php-prev-stage[data-device="mobile"] .ph-features{grid-template-columns:1fr;}

/* =====================================================================
   Part 13 — AI Product Assistant popup
   ===================================================================== */
.ph-ai-bar{display:flex;align-items:center;gap:12px;margin:0 0 16px;flex-wrap:wrap;}
.ph-ai-generate{background:linear-gradient(90deg,#ff6347,#ff8a3d);border:0;color:#0a0d0e;font-weight:700;}
.ph-ai-generate:hover{filter:brightness(1.08);}
.ph-ai-hint{font-size:12px;color:var(--color-text-dim,#b5b5b5);}
.ph-ai-overlay{position:fixed;inset:0;z-index:10000;display:none;align-items:center;justify-content:center;background:rgba(4,6,8,.74);backdrop-filter:blur(4px);padding:20px;}
.ph-ai-overlay.is-open{display:flex;}
.ph-ai-box{width:min(640px,100%);max-height:86vh;display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:#0f1316;border:1px solid var(--color-border-orange,rgba(var(--site-primary-rgb,255,99,71),.4));box-shadow:0 30px 80px rgba(0,0,0,.6);}
.ph-ai-head{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.08);}
.ph-ai-head strong{color:#f5f5f5;font-size:15px;}
.ph-ai-model{margin-left:auto;font-size:11px;color:var(--color-orange,#FF6347);font-family:var(--font-mono,monospace);background:rgba(var(--site-primary-rgb,255,99,71),.1);padding:4px 9px;border-radius:6px;}
.ph-ai-close{border:0;background:transparent;color:#9aa0a6;font-size:24px;line-height:1;cursor:pointer;}
.ph-ai-close:hover{color:var(--color-orange,#FF6347);}
.ph-ai-body{padding:16px;overflow-y:auto;}
.ph-ai-desc{font-size:13px;color:var(--color-text-dim,#b5b5b5);line-height:1.55;margin:0 0 14px;}
.ph-ai-mode{display:flex;flex-direction:column;gap:8px;margin-bottom:14px;}
.ph-ai-mode label{display:flex;align-items:center;gap:8px;font-size:13px;color:#e7e7e7;cursor:pointer;}
.ph-ai-warn{padding:10px 12px;border-radius:8px;background:rgba(var(--site-primary-rgb,255,99,71),.1);border:1px solid rgba(var(--site-primary-rgb,255,99,71),.35);color:#ffb4a3;font-size:12.5px;margin-bottom:12px;}
.ph-ai-warn a{color:var(--color-orange,#FF6347);}
.ph-ai-run{width:100%;}
.ph-ai-type{font-size:12px;color:var(--color-text-dim,#b5b5b5);margin-bottom:12px;padding:8px 10px;border-left:3px solid var(--color-orange,#FF6347);background:rgba(var(--site-primary-rgb,255,99,71),.06);border-radius:0 6px 6px 0;}
.ph-ai-sec{border:1px solid rgba(255,255,255,.1);border-radius:9px;margin-bottom:10px;overflow:hidden;}
.ph-ai-sec__h{display:flex;align-items:center;gap:8px;padding:10px 12px;background:rgba(255,255,255,.03);font-weight:600;font-size:13px;color:#f5f5f5;cursor:pointer;}
.ph-ai-sec__b{padding:10px 12px;font-size:12.5px;color:var(--color-text-dim,#cfcfcf);line-height:1.5;}
.ph-ai-sec__b p{margin:0;}
.ph-ai-sec__b div{margin-bottom:4px;}
.ph-ai-list{margin:0;padding-left:18px;}
.ph-ai-list li{margin-bottom:4px;}
.ph-ai-list b{color:#f5f5f5;}
.ph-ai-tags{display:flex;gap:6px;flex-wrap:wrap;}
.ph-ai-tags span{padding:3px 9px;border-radius:14px;background:rgba(var(--site-primary-rgb,255,99,71),.12);color:var(--color-orange,#FF6347);font-size:11px;font-weight:600;}
.ph-ai-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px;padding-top:12px;border-top:1px solid rgba(255,255,255,.08);}

/* =====================================================================
   Media V2 — Mode block (auto-detect) + 3 media cards + PHP limits
   ===================================================================== */
.product-home-admin .ph-mode-block{border:1px solid var(--color-border-orange,rgba(var(--site-primary-rgb,255,99,71),.4));border-radius:10px;padding:14px 16px;margin-bottom:16px;background:rgba(var(--site-primary-rgb,255,99,71),.05);}
.product-home-admin .ph-mode-block__top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.product-home-admin .ph-mode-block__cur{display:flex;align-items:center;gap:10px;}
.product-home-admin .ph-mode-block__lbl{font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--color-text-dim,#b5b5b5);text-transform:uppercase;}
.product-home-admin .ph-mode-badge2{font-weight:800;font-size:14px;letter-spacing:.06em;padding:5px 14px;border-radius:8px;background:var(--color-orange,#FF6347);color:#0a0d0e;}
.product-home-admin .ph-mode-badge2[data-mode="2d"]{background:#4a86e8;color:#fff;}
.product-home-admin .ph-mode-badge2[data-mode="360"]{background:#a479e2;color:#fff;}
.product-home-admin .ph-mode-badge2[data-mode="3d"]{background:var(--color-orange,#FF6347);color:#0a0d0e;}
.product-home-admin .ph-auto-toggle{display:inline-flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:var(--color-text,#f5f5f5);cursor:pointer;}
.product-home-admin .ph-mode-reason{margin-top:8px;font-size:12.5px;color:var(--color-text-dim,#cfcfcf);}
.product-home-admin .ph-mode-override{margin-top:10px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.product-home-admin .ph-mode-override label{font-size:12px;color:var(--color-text-dim,#b5b5b5);}
.product-home-admin .ph-mode-override select{max-width:200px;}
.product-home-admin .ph-mode-warn{flex-basis:100%;font-size:12.5px;color:#ffb4a3;background:rgba(var(--site-primary-rgb,255,99,71),.1);border-radius:6px;padding:8px 10px;}

.product-home-admin .ph-media-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;}
.product-home-admin .ph-mode-badge2[data-mode="video"]{background:#e0408a;color:#fff;}
.product-home-admin .ph-media-video{max-width:100%;max-height:120px;border-radius:6px;background:#000;display:block;}
.product-home-admin .ph-static-note{font-size:12px;color:var(--color-text-dim,#9aa0a6);padding:8px 10px;border:1px dashed var(--color-border,rgba(255,255,255,.16));border-radius:6px;}
.product-home-admin .ph-mcard{border:1px solid var(--color-border,rgba(255,255,255,.14));border-radius:10px;padding:12px;background:var(--color-panel-2,#15191c);display:flex;flex-direction:column;gap:10px;}
.product-home-admin .ph-mcard__head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.product-home-admin .ph-mcard__t{font-weight:700;font-size:13px;color:var(--color-text,#f5f5f5);}
.product-home-admin .ph-mcard__t i{color:var(--color-orange,#FF6347);font-style:normal;}
.product-home-admin .ph-mcard__status{font-size:11px;font-weight:700;padding:3px 9px;border-radius:12px;white-space:nowrap;}
.product-home-admin .ph-mcard__status.is-ok{background:rgba(58,210,159,.16);color:#3ad29f;}
.product-home-admin .ph-mcard__status.is-empty{background:rgba(255,255,255,.07);color:#9aa0a6;}
.product-home-admin .ph-mcard__status.is-warn{background:rgba(255,176,67,.16);color:#ffb043;}
.product-home-admin .ph-mcard .ph-media,.product-home-admin .ph-mcard .ph-media-multi{border:0;padding:0;}
.product-home-admin .ph-model-meta{display:block;font-size:11px;color:var(--color-text-dim,#9aa0a6);margin-top:3px;}
.product-home-admin .ph-media-extra{margin-top:14px;border:1px solid var(--color-border,rgba(255,255,255,.12));border-radius:8px;padding:10px 12px;}
.product-home-admin .ph-media-extra summary{cursor:pointer;font-weight:600;font-size:13px;color:var(--color-text-dim,#cfcfcf);}
.product-home-admin .grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;}

.product-home-admin .ph-limit-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px;}
.product-home-admin .ph-limit{border:1px solid var(--color-border,rgba(255,255,255,.14));border-radius:8px;padding:10px 12px;display:flex;flex-direction:column;gap:3px;}
.product-home-admin .ph-limit b{font-size:11px;color:var(--color-text-dim,#9aa0a6);font-family:var(--font-mono,monospace);}
.product-home-admin .ph-limit span{font-size:16px;font-weight:800;color:var(--color-text,#f5f5f5);}
.product-home-admin .ph-limit.is-ok{border-color:rgba(58,210,159,.4);}
.product-home-admin .ph-limit.is-ok span{color:#3ad29f;}
.product-home-admin .ph-limit.is-low{border-color:rgba(var(--site-primary-rgb,255,99,71),.5);}
.product-home-admin .ph-limit.is-low span{color: var(--site-primary,#FF6347);}

@media (max-width:860px){
  .product-home-admin .ph-media-cards{grid-template-columns:1fr;}
  .product-home-admin .grid-3{grid-template-columns:1fr;}
  .product-home-admin .ph-limit-grid{grid-template-columns:1fr 1fr;}
}
