
:root{
  --annideee-font:"Noto Sans Thai","Leelawadee UI",Tahoma,Arial,sans-serif;
  --brand:#C76545;
  --brand-dark:#A94F34;
  --brand-soft:#F8ECE7;
  --surface:#fff;
  --surface-soft:#f7f7f8;
  --text:#202124;
  --muted:#71757b;
  --line:#e5e5e5;
  --card-radius:22px;
}

/* =========================================================
   GLOBAL INTERACTION / NAVIGATION
   ========================================================= */
.standard-detail-image,
.helper-detail-image,
.helper-alt-clickable{
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.standard-detail-image:focus,
.helper-detail-image:focus,
.helper-alt-clickable:focus{
  outline:2px solid rgba(199,101,69,.30);
  outline-offset:3px;
}
.helper-alt-clickable:active{transform:scale(.995)}
.related-card:has(.helper-detail-image){cursor:default}
.legacy-detail-redirect{display:none !important}

/* =========================================================
   FUTURE CATEGORY PLACEHOLDER
   ========================================================= */
.coming-soon-subtitle{
  display:inline-block;
  margin-top:6px;
  color:#777;
  font-size:14px;
  line-height:1.5;
}
.future-category-card .plus,
.future-category-card .add-icon,
.category-placeholder .plus,
.category-placeholder .add-icon{
  display:none !important;
}

/* =========================================================
   UNIVERSAL PRODUCT GRID / CARD
   Current: Fan + Power Bank
   Future categories: reuse .category-catalog-page + standard classes
   ========================================================= */
#catalogPage.is-grid #catalogList,
#catalogPage.is-grid #productGrid,
#powerBankPage.is-grid #pbGrid,
.category-catalog-page.is-grid .category-grid,
.catalog-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:start;
}

#catalogPage.is-grid .catalog-card,
#catalogPage.is-grid .product-card,
#powerBankPage.is-grid .pb-card,
.category-catalog-page.is-grid .category-product-card,
.catalog-card,
.category-product-card{
  position:relative;
  display:flex;
  flex-direction:column;
  width:100%;
  min-width:0;
  height:auto;
  min-height:0;
  padding:10px;
  margin:0;
  box-sizing:border-box;
  overflow:hidden;
  border-radius:var(--card-radius);
  background:var(--surface);
}

/* Reset old card-body layout behavior */
#catalogPage.is-grid .product-card>.category-card-body,
#powerBankPage.is-grid .pb-card>.category-card-body,
.category-catalog-page.is-grid .category-product-card>.category-card-body{
  position:static;
  inset:auto;
  transform:none;
  display:flex;
  flex-direction:column;
  width:100%;
  min-width:0;
  height:auto;
  min-height:0;
  margin:0;
  padding:0;
}

/* Image slot */
#catalogPage.is-grid .catalog-card>img,
#catalogPage.is-grid .product-card>img,
#powerBankPage.is-grid .pb-card>img,
.category-catalog-page.is-grid .category-product-card>img{
  position:static;
  inset:auto;
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:1/1;
  object-fit:contain;
  object-position:center;
  flex:0 0 auto;
  margin:0 0 10px;
  padding:0;
  border-radius:14px;
  background:var(--surface-soft);
}

/* Text reset */
#catalogPage.is-grid .catalog-brand,
#catalogPage.is-grid .product-brand,
#catalogPage.is-grid .catalog-card h3,
#catalogPage.is-grid .product-card h3,
#catalogPage.is-grid .catalog-specs,
#catalogPage.is-grid .product-spec,
#catalogPage.is-grid .catalog-price,
#catalogPage.is-grid .product-price,
#powerBankPage.is-grid .pb-brand,
#powerBankPage.is-grid .category-card-brand,
#powerBankPage.is-grid .pb-card h3,
#powerBankPage.is-grid .category-card-title,
#powerBankPage.is-grid .pb-spec-line,
#powerBankPage.is-grid .category-card-specs,
#powerBankPage.is-grid .pb-price,
#powerBankPage.is-grid .category-card-price{
  position:static;
  inset:auto;
  transform:none;
  float:none;
  grid-area:auto;
  grid-row:auto;
  grid-column:auto;
  width:100%;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}

/* Brand slot */
#catalogPage.is-grid .catalog-brand,
#catalogPage.is-grid .product-brand,
#powerBankPage.is-grid .pb-brand,
#powerBankPage.is-grid .category-card-brand{
  height:1.4em;
  min-height:1.4em;
  max-height:1.4em;
  margin:0;
  line-height:1.4;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

/* Title slot */
#catalogPage.is-grid .catalog-card h3,
#catalogPage.is-grid .product-card h3,
#powerBankPage.is-grid .pb-card h3,
#powerBankPage.is-grid .category-card-title{
  display:-webkit-box;
  height:4.2em;
  min-height:4.2em;
  max-height:4.2em;
  margin:4px 0 0;
  line-height:1.4;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow-wrap:anywhere;
}

/* Spec slot */
#catalogPage.is-grid .catalog-specs,
#catalogPage.is-grid .product-spec,
#powerBankPage.is-grid .pb-spec-line,
#powerBankPage.is-grid .category-card-specs{
  display:-webkit-box;
  height:3.2em;
  min-height:3.2em;
  max-height:3.2em;
  margin:4px 0 0;
  line-height:1.5;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow-wrap:anywhere;
}

/* Price slot */
#catalogPage.is-grid .catalog-price,
#catalogPage.is-grid .product-price,
#powerBankPage.is-grid .pb-price,
#powerBankPage.is-grid .category-card-price{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  height:3.6em;
  min-height:3.6em;
  margin:8px 0 0;
  line-height:1.2;
  overflow:hidden;
}
#catalogPage.is-grid .catalog-price small,
#catalogPage.is-grid .product-price small,
#powerBankPage.is-grid .pb-price small,
#powerBankPage.is-grid .category-card-price small{
  display:block;
  position:static;
  margin:0 0 2px;
  line-height:1.15;
  color:var(--brand);
}

/* =========================================================
   UNIVERSAL PRODUCT TOOLBAR
   ========================================================= */
.universal-product-toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:
    "summary summary"
    "actions actions";
  gap:12px;
  width:100%;
  margin:0 0 14px;
  box-sizing:border-box;
  font-family:var(--annideee-font);
}
.universal-result-summary{
  grid-area:summary;
  display:flex;
  align-items:baseline;
  gap:8px;
  min-width:0;
  white-space:nowrap;
}
.universal-result-summary b{
  margin:0;
  font-size:1.04rem;
  line-height:1.25;
  font-weight:800;
  color:var(--text);
  white-space:nowrap;
}
.universal-result-summary span{
  margin:0;
  font-size:.82rem;
  line-height:1.25;
  font-weight:500;
  color:#7a7d82;
  white-space:nowrap;
}
.universal-toolbar-actions{
  grid-area:actions;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);
  gap:10px;
  width:100%;
  min-width:0;
}
.universal-compare-toggle,
.universal-sort-select{
  width:100%;
  min-width:0;
  height:48px;
  min-height:48px;
  margin:0;
  box-sizing:border-box;
  border:1px solid #dedede;
  border-radius:16px;
  background:#fff;
  color:var(--text);
  font-family:inherit;
  font-size:.92rem;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  word-break:keep-all;
  overflow-wrap:normal;
}
.universal-compare-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:0 12px;
  cursor:pointer;
}
.universal-compare-toggle.is-active{
  border-color:var(--brand);
  background:var(--brand-soft);
  color:var(--brand-dark);
}
.universal-sort-select{
  appearance:auto;
  padding:0 38px 0 14px;
  text-overflow:ellipsis;
}

/* =========================================================
   UNIVERSAL COMPARE MODE
   ========================================================= */
.universal-compare-control{display:none !important}

.compare-mode-active .universal-compare-control{
  position:absolute !important;
  top:8px !important;
  left:8px !important;
  z-index:10 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  min-width:0 !important;
  height:36px !important;
  padding:0 9px !important;
  margin:0 !important;
  border:1px solid rgba(0,0,0,.10) !important;
  border-radius:999px !important;
  background:rgba(255,255,255,.96) !important;
  color:var(--text) !important;
  font-size:.78rem !important;
  font-weight:700 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  box-sizing:border-box !important;
}
.universal-compare-checkbox{
  appearance:none !important;
  -webkit-appearance:none !important;
  display:inline-grid !important;
  place-content:center !important;
  width:20px !important;
  height:20px !important;
  min-width:20px !important;
  flex:0 0 20px !important;
  margin:0 6px 0 0 !important;
  padding:0 !important;
  border:2px solid #8b8b8b !important;
  border-radius:4px !important;
  background:#fff !important;
  box-sizing:border-box !important;
}
.universal-compare-checkbox::before{
  content:"✓";
  display:block;
  color:#fff;
  font-size:16px;
  font-weight:900;
  line-height:1;
  transform:scale(0);
}
.universal-compare-checkbox:checked{
  background:var(--brand) !important;
  border-color:var(--brand) !important;
}
.universal-compare-checkbox:checked::before{transform:scale(1)}

/* One compare bar for every category */
.universal-compare-bar{
  position:fixed;
  left:50%;
  bottom:22px;
  transform:translateX(-50%);
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  width:auto;
  max-width:calc(100vw - 32px);
  min-height:64px;
  padding:0 28px;
  margin:0;
  border:0;
  border-radius:999px;
  background:#202124;
  color:#fff;
  font:700 18px/1.2 var(--annideee-font);
  white-space:nowrap;
  box-shadow:0 10px 30px rgba(0,0,0,.16);
}
.universal-compare-bar.hidden{display:none}

/* =========================================================
   HELPER / DETAIL / COMPARE — UNIVERSAL
   ========================================================= */















.unified-result-actions{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:10px !important;
}
.unified-result-actions.single-action,
.unified-result-actions:has(>a:only-child),
.unified-result-actions:has(>button:only-child){
  grid-template-columns:1fr !important;
}
.unified-result-actions>a,
.unified-result-actions>button{
  width:100% !important;
  box-sizing:border-box !important;
}
.unified-alt-right{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media(min-width:640px){
  .universal-product-toolbar{
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:"summary actions";
    align-items:center;
    gap:14px;
  }
  .universal-toolbar-actions{
    width:auto;
    grid-template-columns:150px 190px;
  }
}
@media(max-width:480px){
  
  
  
}
@media(max-width:420px){
  #catalogPage.is-grid #catalogList,
  #catalogPage.is-grid #productGrid,
  #powerBankPage.is-grid #pbGrid,
  .category-catalog-page.is-grid .category-grid,
  .catalog-grid{gap:10px}

  #catalogPage.is-grid .catalog-card,
  #catalogPage.is-grid .product-card,
  #powerBankPage.is-grid .pb-card,
  .category-catalog-page.is-grid .category-product-card{
    padding:8px;
  }
}
@media(max-width:390px){
  .universal-result-summary{gap:6px}
  .universal-result-summary b{font-size:1rem}
  .universal-result-summary span{font-size:.78rem}
  .universal-toolbar-actions{
    grid-template-columns:minmax(0,.95fr) minmax(0,1.35fr);
    gap:8px;
  }
  .universal-compare-toggle,
  .universal-sort-select{
    height:46px;
    min-height:46px;
    font-size:.87rem;
    border-radius:14px;
  }
  .universal-compare-toggle{padding:0 10px}
  .universal-sort-select{padding-left:12px}
}


/* =========================================================
   GRID CARD OWNERSHIP GUARD
   Grid mode always owns layout; legacy list/card rules cannot override it.
   ========================================================= */
#catalogPage.is-grid .catalog-card,
#catalogPage.is-grid .product-card,
#powerBankPage.is-grid .pb-card,
.category-catalog-page.is-grid .category-product-card{
  display:flex !important;
  flex-direction:column !important;
  grid-template-columns:none !important;
  grid-template-areas:none !important;
  align-items:stretch !important;
  gap:0 !important;
}

#powerBankPage.is-grid .pb-card>img,
#catalogPage.is-grid .catalog-card>img,
#catalogPage.is-grid .product-card>img,
.category-catalog-page.is-grid .category-product-card>img{
  grid-area:auto !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:1/1 !important;
}

#powerBankPage.is-grid .pb-brand,
#powerBankPage.is-grid .pb-card h3,
#powerBankPage.is-grid .pb-spec-line,
#powerBankPage.is-grid .pb-tags,
#powerBankPage.is-grid .pb-price,
#powerBankPage.is-grid .pb-actions{
  grid-area:auto !important;
  width:100% !important;
  min-width:0 !important;
}

#powerBankPage.is-grid .pb-card h3,
#powerBankPage.is-grid .pb-brand,
#powerBankPage.is-grid .pb-spec-line,
#powerBankPage.is-grid .pb-price{
  overflow-wrap:normal !important;
  word-break:normal !important;
}
