/* ===== Clean Custom Section Builder ===== */
.custom-section{
  position:relative;
  overflow:visible;
  background-color:var(--sec-bg, transparent) !important;
}
.custom-section.has-bg-image{
  background-image:var(--section-bg-image) !important;
  background-size:var(--section-bg-size, cover) !important;
  background-position:var(--section-bg-position, center center) !important;
  background-repeat:no-repeat !important;
}
.custom-section .wrap{
  width:100%;
  max-width:var(--container,1180px);
  margin-left:auto;
  margin-right:auto;
  padding-left:var(--g,24px);
  padding-right:var(--g,24px);
}
.custom-grid{
  display:grid;
  gap:22px;
  align-items:stretch;
  overflow:visible;
}
.custom-cols-1{grid-template-columns:1fr}
.custom-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.custom-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.custom-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.custom-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.custom-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}
.custom-col{min-width:0;position:relative;overflow:visible}
.custom-block{position:relative;margin:0 0 18px;overflow:visible;isolation:isolate}
html[data-edit="1"] .custom-section::before{content:"";position:absolute;inset:0;border:1px solid rgba(156,163,175,.9);pointer-events:none;z-index:20}
html[data-edit="1"] .custom-block::before{content:"";position:absolute;inset:0;border:1px dashed rgba(107,114,128,.75);pointer-events:none;z-index:19}

.pxth-custom-controls{
  position:absolute;top:0;left:50%;transform:translate(-50%,-100%);
  z-index:99990;display:inline-flex;gap:0;height:28px;background:#9ca3af;border-radius:4px 4px 0 0;overflow:hidden;box-shadow:0 8px 18px rgba(0,0,0,.16)
}
.pxth-block-controls{
  position:absolute;top:0;left:50%;transform:translate(-50%,-100%);
  z-index:100000;display:inline-flex;gap:0;height:26px;background:#6b7280;border-radius:4px 4px 0 0;overflow:hidden;box-shadow:0 8px 18px rgba(0,0,0,.16)
}
.pxth-custom-controls button,.pxth-block-controls button{
  min-width:28px;height:100%;margin:0;padding:0 8px;border:0;border-left:1px solid rgba(255,255,255,.25);
  background:transparent;color:#fff;font-size:12px;font-weight:900;cursor:pointer
}
.pxth-custom-controls button:first-child,.pxth-block-controls button:first-child{border-left:0}
.pxth-custom-controls button:hover,.pxth-block-controls button:hover{background:rgba(255,255,255,.18)}
.pxth-custom-controls button:last-child,.pxth-block-controls button:last-child{background:#ef4444}

.pxth-add-section-float{
  position:fixed;right:22px;bottom:24px;z-index:999998;border:0;border-radius:999px;padding:12px 18px;background:#64748b;color:#fff;font-weight:900;box-shadow:0 10px 28px rgba(15,23,42,.22);cursor:pointer
}
.pxth-add-block{
  width:100%;min-height:42px;margin:16px 0 0;padding:10px 14px;border:1px dashed #cbd5e1;border-radius:8px;background:#f8fafc;color:#111827;font-size:13px;font-weight:900;cursor:pointer
}
.pxth-add-block:hover{background:#f1f5f9;border-color:#64748b}

.block-text,.block-contact,.block-banner,.block-image,.block-social,.block-map,.block-facebook,.block-product,.block-gallery,.block-videos,.block-news{
  background:transparent!important;border-radius:0!important;box-shadow:none!important;padding:0!important;min-width:0
}
.custom-block[data-block-type="banner"]{
  width:100vw;margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);margin-bottom:0
}
.block-banner-image{
  width:100%;aspect-ratio:1900/700;border-radius:0;margin:0;background:#ddd center/cover no-repeat;overflow:hidden;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#888;font-size:42px;font-weight:500
}
.block-banner-image[style*="url("] .block-banner-placeholder{display:none}
.block-image-box,.block-product-image,.block-news-image,.block-gallery-image{
  width:100%;aspect-ratio:16/9;border-radius:10px;margin-bottom:14px;background:#eee center/cover no-repeat;overflow:hidden;cursor:pointer
}
.block-image-caption:empty{display:none}
.block-image-caption{font-size:14px;color:#666;text-align:center}
.block-gallery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.block-product-price{font-weight:900;margin:6px 0 8px}
.block-map iframe,.block-facebook iframe,.block-videos iframe{display:block;width:100%;border-radius:10px}
.block-map-empty,.block-video-empty{min-height:220px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:10px;color:#666}

.block-social{display:flex;gap:16px;flex-wrap:wrap;align-items:center}
.block-social--left{justify-content:flex-start}
.block-social--center{justify-content:center}
.block-social--right{justify-content:flex-end}
.block-social-btn{
  --social-bg:#64748b;display:inline-flex;align-items:center;gap:12px;min-height:58px;padding:8px 24px 8px 12px;border-radius:999px;background:var(--social-bg);color:#fff;text-decoration:none;box-shadow:0 8px 18px rgba(0,0,0,.18);line-height:1.15
}
.block-social-ico{width:42px;height:42px;min-width:42px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:rgba(0,0,0,.18);color:#000;font-weight:900;font-size:20px}
.block-social-copy{display:flex;flex-direction:column}
.block-social-copy b{font-size:15px;font-weight:900;color:#000}
.block-social-copy small{margin-top:3px;font-size:12px;font-weight:700;color:#000;opacity:.9}
.block-social--icon .block-social-btn{width:52px;min-width:52px;height:52px;min-height:52px;padding:0;justify-content:center}
.block-social--icon .block-social-copy{display:none}
.block-social--icon .block-social-ico{width:52px;height:52px;min-width:52px;background:transparent;color:#fff}

.pxth-custom-modal{position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:999999;display:none;padding:30px 16px;box-sizing:border-box}
.pxth-custom-modal.open{display:block}
.pxth-custom-panel{max-width:760px;margin:0 auto;background:#fff;color:#111;border-radius:14px;padding:22px;box-shadow:0 20px 70px rgba(0,0,0,.25);box-sizing:border-box}
.pxth-custom-panel h3{margin:0 0 16px;font-size:20px;line-height:1.3}
.pxth-custom-options{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.pxth-custom-options button{border:1px solid #d1d5db;border-radius:8px;background:#fff;color:#334155;padding:12px;font-weight:900;cursor:pointer}
.pxth-custom-options button:hover{background:#f1f5f9;border-color:#94a3b8}
.pxth-settings-group{margin:0 0 16px;padding:14px;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc}
.pxth-settings-title{font-weight:900;font-size:14px;margin:0 0 10px}
.pxth-settings-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pxth-settings-row label{display:block;font-size:12px;font-weight:800;color:#334155}
.pxth-settings-row input,.pxth-settings-row select{width:100%;height:34px;margin-top:5px;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:8px;padding:0 8px;font-size:13px;background:#fff}
.pxth-settings-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.pxth-settings-actions button{border:0;border-radius:10px;padding:10px 14px;font-weight:900;cursor:pointer}
.pxth-settings-close{background:#e5e7eb;color:#111}
.pxth-settings-save{background:#64748b;color:#fff}
.pxth-color-line{display:grid;grid-template-columns:42px minmax(0,1fr);gap:8px;align-items:center;margin-top:5px}
.pxth-color-line input[type=color]{width:42px;height:34px;padding:0;border:1px solid #cbd5e1;border-radius:8px;background:#fff}

@media(max-width:900px){
  .custom-section .wrap{padding-left:var(--g,18px);padding-right:var(--g,18px)}
  .custom-cols-4,.custom-cols-5,.custom-cols-6{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .custom-grid{grid-template-columns:1fr!important}
  .pxth-custom-options{grid-template-columns:1fr 1fr}
  .pxth-settings-row{grid-template-columns:1fr}
  .block-social{flex-direction:column;align-items:stretch}
  .block-social-btn{width:100%;box-sizing:border-box;justify-content:flex-start}
  .block-social--icon .block-social-btn{width:100%;min-width:0;justify-content:center}
}


/* =========================================================
   CSS Load Fix / Strong Editor UI
   ========================================================= */
html[data-edit="1"] .custom-section{
  position:relative !important;
  min-height:90px !important;
  padding:38px 0 28px !important;
  margin:0 !important;
  border-top:1px solid #d1d5db !important;
  border-bottom:1px solid #e5e7eb !important;
  overflow:visible !important;
}

html[data-edit="1"] .custom-section .wrap{
  display:block !important;
  max-width:1180px !important;
  margin:0 auto !important;
  padding-left:24px !important;
  padding-right:24px !important;
  box-sizing:border-box !important;
}

html[data-edit="1"] .custom-grid{
  display:grid !important;
  gap:22px !important;
  min-height:70px !important;
}

html[data-edit="1"] .custom-col{
  min-height:70px !important;
  border:1px dashed #cbd5e1 !important;
  border-radius:8px !important;
  padding:14px !important;
  box-sizing:border-box !important;
  background:rgba(248,250,252,.55) !important;
}

html[data-edit="1"] .custom-col:empty{
  min-height:70px !important;
}

html[data-edit="1"] .pxth-custom-controls,
html[data-edit="1"] .pxth-block-controls{
  font-family:Arial,sans-serif !important;
}

html[data-edit="1"] .pxth-custom-controls{
  position:absolute !important;
  top:0 !important;
  left:50% !important;
  transform:translate(-50%,-50%) !important;
  z-index:999990 !important;
  display:inline-flex !important;
  gap:0 !important;
  height:30px !important;
  background:#9ca3af !important;
  border-radius:5px !important;
  overflow:hidden !important;
  box-shadow:0 8px 18px rgba(0,0,0,.18) !important;
}

html[data-edit="1"] .pxth-block-controls{
  position:absolute !important;
  top:0 !important;
  left:50% !important;
  transform:translate(-50%,-100%) !important;
  z-index:999999 !important;
  display:inline-flex !important;
  gap:0 !important;
  height:28px !important;
  background:#6b7280 !important;
  border-radius:5px 5px 0 0 !important;
  overflow:hidden !important;
  box-shadow:0 8px 18px rgba(0,0,0,.18) !important;
}

html[data-edit="1"] .pxth-custom-controls button,
html[data-edit="1"] .pxth-block-controls button{
  appearance:none !important;
  -webkit-appearance:none !important;
  min-width:30px !important;
  width:auto !important;
  height:100% !important;
  margin:0 !important;
  padding:0 9px !important;
  border:0 !important;
  border-left:1px solid rgba(255,255,255,.25) !important;
  border-radius:0 !important;
  background:transparent !important;
  color:#fff !important;
  font-size:13px !important;
  line-height:1 !important;
  font-weight:900 !important;
  cursor:pointer !important;
}

html[data-edit="1"] .pxth-custom-controls button:first-child,
html[data-edit="1"] .pxth-block-controls button:first-child{
  border-left:0 !important;
}

html[data-edit="1"] .pxth-custom-controls button:hover,
html[data-edit="1"] .pxth-block-controls button:hover{
  background:rgba(255,255,255,.18) !important;
}

html[data-edit="1"] .pxth-custom-controls button:last-child,
html[data-edit="1"] .pxth-block-controls button:last-child{
  background:#ef4444 !important;
}

html[data-edit="1"] .pxth-add-block{
  appearance:none !important;
  -webkit-appearance:none !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  min-height:42px !important;
  margin:12px 0 0 !important;
  padding:10px 14px !important;
  border:1px dashed #cbd5e1 !important;
  border-radius:8px !important;
  background:#f8fafc !important;
  color:#111827 !important;
  font-size:13px !important;
  font-weight:900 !important;
  cursor:pointer !important;
  box-shadow:none !important;
}

html[data-edit="1"] .pxth-add-section-float{
  appearance:none !important;
  -webkit-appearance:none !important;
  position:fixed !important;
  right:22px !important;
  bottom:24px !important;
  z-index:999998 !important;
  border:0 !important;
  border-radius:999px !important;
  padding:12px 18px !important;
  background:#64748b !important;
  color:#fff !important;
  font-weight:900 !important;
  box-shadow:0 10px 28px rgba(15,23,42,.22) !important;
  cursor:pointer !important;
}

/* keep full width banner inside clean builder */
.custom-block[data-block-type="banner"]{
  width:100vw !important;
  margin-left:calc(50% - 50vw) !important;
  margin-right:calc(50% - 50vw) !important;
}



/* =========================================================
   Text Editor Heading Dropdown
   ========================================================= */
.pxth-rt-format-select,
.pxth-mini-format{
  height:34px !important;
  min-width:78px !important;
  border:1px solid #d1d5db !important;
  border-radius:8px !important;
  padding:0 9px !important;
  background:#fff !important;
  color:#111827 !important;
  font-size:13px !important;
  font-weight:900 !important;
  cursor:pointer !important;
}

.pxth-mini-text-modal{
  position:fixed !important;
  inset:0 !important;
  z-index:2147483600 !important;
  display:none !important;
  padding:52px 16px !important;
  background:rgba(15,23,42,.55) !important;
  box-sizing:border-box !important;
}

.pxth-mini-text-modal.open{display:block !important;}

.pxth-mini-text-panel{
  width:min(760px, calc(100vw - 32px)) !important;
  margin:0 auto !important;
  background:#fff !important;
  color:#111827 !important;
  border-radius:14px !important;
  overflow:hidden !important;
  box-shadow:0 24px 80px rgba(0,0,0,.35) !important;
}

.pxth-mini-text-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  padding:14px 16px !important;
  border-bottom:1px solid #e5e7eb !important;
  font-size:16px !important;
  font-weight:900 !important;
}

.pxth-mini-text-close{
  width:30px !important;
  height:30px !important;
  border:1px solid #d1d5db !important;
  border-radius:6px !important;
  background:#fff !important;
  color:#111 !important;
  font-weight:900 !important;
  cursor:pointer !important;
}

.pxth-mini-text-toolbar{
  display:flex !important;
  gap:7px !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  padding:12px 14px !important;
  border-bottom:1px solid #e5e7eb !important;
  background:#f8fafc !important;
}

.pxth-mini-text-toolbar button{
  height:34px !important;
  border:1px solid #d1d5db !important;
  border-radius:8px !important;
  padding:0 10px !important;
  background:#fff !important;
  color:#111827 !important;
  font-size:13px !important;
  font-weight:900 !important;
  cursor:pointer !important;
}

.pxth-mini-text-toolbar input[type=color]{
  width:42px !important;
  height:34px !important;
  padding:2px !important;
  border:1px solid #d1d5db !important;
  border-radius:8px !important;
  background:#fff !important;
}

.pxth-mini-editor{
  min-height:260px !important;
  padding:16px !important;
  outline:0 !important;
  font-size:16px !important;
  line-height:1.65 !important;
  background:#fff !important;
}

.pxth-mini-text-actions{
  display:flex !important;
  justify-content:flex-end !important;
  gap:10px !important;
  padding:14px !important;
  border-top:1px solid #e5e7eb !important;
  background:#fff !important;
}

.pxth-mini-text-actions button{
  border:0 !important;
  border-radius:999px !important;
  padding:10px 18px !important;
  font-weight:900 !important;
  cursor:pointer !important;
}

.pxth-mini-cancel{background:#e5e7eb !important;color:#111 !important;}
.pxth-mini-save{background:#0b7be8 !important;color:#fff !important;}



/* =========================================================
   Multi Product Block + Grid/List/Carousel
   ========================================================= */
.block-products{
  --product-cols:3;
  width:100%;
}

.block-product-toolbar{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin:0 0 14px;
  flex-wrap:wrap;
}

.block-product-toolbar button{
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
  padding:8px 12px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-product-toolbar button.active,
.block-product-toolbar button:hover{
  background:#64748b;
  color:#fff;
  border-color:#64748b;
}

.block-product-items{
  display:grid;
  grid-template-columns:repeat(var(--product-cols), minmax(0, 1fr));
  gap:22px;
}

.block-product-card{
  position:relative;
  min-width:0;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  box-shadow:0 8px 22px rgba(15,23,42,.06);
}

.block-products.is-list .block-product-items{
  grid-template-columns:1fr;
}

.block-products.is-list .block-product-card{
  display:grid;
  grid-template-columns:240px minmax(0,1fr);
  column-gap:18px;
  align-items:start;
}

.block-products.is-list .block-product-image{
  grid-row:1 / span 3;
  margin-bottom:0;
  aspect-ratio:4/3;
}

.block-products.is-carousel .block-product-items{
  display:flex;
  gap:18px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  padding-bottom:10px;
}

.block-products.is-carousel .block-product-card{
  flex:0 0 min(360px, 82vw);
  scroll-snap-align:start;
}

.block-product-add{
  width:100%;
  min-height:42px;
  margin:16px 0 0;
  border:1px dashed #cbd5e1;
  border-radius:10px;
  background:#f8fafc;
  color:#111827;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-product-add:hover{
  background:#f1f5f9;
  border-color:#64748b;
}

.block-product-remove{
  margin-top:12px;
  border:0;
  border-radius:999px;
  background:#fee2e2;
  color:#b91c1c;
  padding:7px 11px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}

.pxth-product-cols-select{
  width:100%;
  height:36px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  padding:0 10px;
  font-weight:800;
}

@media(max-width:900px){
  .block-product-items{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:760px){
  .block-product-items,
  .block-products.is-list .block-product-items{
    grid-template-columns:1fr;
  }

  .block-products.is-list .block-product-card{
    display:block;
  }

  .block-products.is-list .block-product-image{
    margin-bottom:14px;
  }

  .block-products.is-carousel .block-product-card{
    flex-basis:88vw;
  }

  .block-product-toolbar{
    justify-content:flex-start;
  }
}


/* =========================================================
   Product Carousel Arrows / No Scrollbar
   ========================================================= */
.block-product-carousel-nav{
  display:none;
  justify-content:flex-end;
  gap:8px;
  margin:0 0 12px;
}

.block-product-carousel-nav button{
  width:38px;
  height:38px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
  font-size:26px;
  line-height:1;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(15,23,42,.08);
}

.block-product-carousel-nav button:hover{
  background:#64748b;
  color:#fff;
  border-color:#64748b;
}

.block-products.is-carousel .block-product-carousel-nav{
  display:flex;
}

.block-products.is-carousel .block-product-items{
  display:flex !important;
  gap:18px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:x mandatory !important;
  scroll-behavior:smooth !important;
  padding-bottom:0 !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}

.block-products.is-carousel .block-product-items::-webkit-scrollbar{
  display:none !important;
  width:0 !important;
  height:0 !important;
}

.block-products.is-carousel .block-product-card{
  flex:0 0 calc((100% - (18px * (var(--product-cols) - 1))) / var(--product-cols)) !important;
  max-width:calc((100% - (18px * (var(--product-cols) - 1))) / var(--product-cols)) !important;
  scroll-snap-align:start !important;
}

@media(max-width:900px){
  .block-products.is-carousel .block-product-card{
    flex-basis:calc((100% - 18px) / 2) !important;
    max-width:calc((100% - 18px) / 2) !important;
  }
}

@media(max-width:760px){
  .block-products.is-carousel .block-product-card{
    flex-basis:100% !important;
    max-width:100% !important;
  }

  .block-product-carousel-nav{
    justify-content:center;
  }
}


/* =========================================================
   Gallery Album Builder
   ========================================================= */
.block-gallery-albums{
  --gallery-radius:10px;
  --gallery-cols:3;
  --gallery-mobile-cols:1;
  width:100%;
}

.block-gallery-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:flex-start;
  margin:0 0 16px;
}

.block-gallery-tabs button{
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
  padding:9px 14px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-gallery-tabs button.active,
.block-gallery-tabs button:hover{
  background:#0f172a;
  border-color:#0f172a;
  color:#fff;
}

.block-gallery-albums.tabs-left,
.block-gallery-albums.tabs-right{
  display:grid;
  gap:18px;
  align-items:start;
}

.block-gallery-albums.tabs-left{
  grid-template-columns:180px minmax(0,1fr);
}

.block-gallery-albums.tabs-right{
  grid-template-columns:minmax(0,1fr) 180px;
}

.block-gallery-albums.tabs-left .block-gallery-tabs,
.block-gallery-albums.tabs-right .block-gallery-tabs{
  flex-direction:column;
  margin:0;
}

.block-gallery-albums.tabs-left .block-gallery-tabs button,
.block-gallery-albums.tabs-right .block-gallery-tabs button{
  width:100%;
  text-align:center;
}

.block-gallery-albums.tabs-right .block-gallery-tabs{
  grid-column:2;
  grid-row:1;
}

.block-gallery-albums.tabs-right .block-gallery-main{
  grid-column:1;
  grid-row:1;
}

.block-gallery-panel{
  display:none;
}

.block-gallery-panel.active{
  display:block;
}

.block-gallery-grid{
  display:grid;
  grid-template-columns:repeat(var(--gallery-cols), minmax(0, 1fr));
  gap:14px;
}

.block-gallery-image-item{
  position:relative;
  overflow:hidden;
  border-radius:var(--gallery-radius);
  background:#eef2f7;
  aspect-ratio:1/1;
}

.block-gallery-image-item img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.block-gallery-image-item [data-gallery-image-remove]{
  position:absolute;
  top:8px;
  right:8px;
  z-index:3;
  width:28px;
  height:28px;
  border:0;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}

.gallery-dropzone{
  min-height:180px;
  border:2px dashed #93c5fd;
  border-radius:var(--gallery-radius);
  background:#eff6ff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  text-align:center;
  color:#0f172a;
  cursor:pointer;
  padding:18px;
  box-sizing:border-box;
  aspect-ratio:1/1;
}

.gallery-dropzone.dragover{
  background:#dbeafe;
  border-color:#0b7be8;
  transform:scale(.995);
}

.gallery-drop-plus{
  width:48px;
  height:48px;
  border-radius:999px;
  background:#fff;
  color:#0b7be8;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  font-weight:900;
  box-shadow:0 8px 22px rgba(15,23,42,.1);
}

.gallery-dropzone strong{
  font-size:15px;
  font-weight:900;
}

.gallery-dropzone span{
  font-size:14px;
  font-weight:800;
  color:#0b7be8;
}

.block-gallery-actions{
  display:flex;
  gap:8px;
  margin-top:14px;
  flex-wrap:wrap;
}

.block-gallery-actions button{
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#111827;
  padding:9px 14px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-gallery-actions button:hover{
  background:#f1f5f9;
}

.block-gallery-actions [data-gallery-delete-album]{
  color:#b91c1c;
  background:#fee2e2;
  border-color:#fecaca;
}

@media(max-width:900px){
  .block-gallery-grid{
    grid-template-columns:repeat(min(var(--gallery-cols), 2), minmax(0, 1fr));
  }

  .block-gallery-albums.tabs-left,
  .block-gallery-albums.tabs-right{
    grid-template-columns:1fr;
  }

  .block-gallery-albums.tabs-right .block-gallery-tabs,
  .block-gallery-albums.tabs-right .block-gallery-main{
    grid-column:auto;
    grid-row:auto;
  }

  .block-gallery-albums.tabs-left .block-gallery-tabs,
  .block-gallery-albums.tabs-right .block-gallery-tabs{
    flex-direction:row;
  }

  .block-gallery-albums.tabs-left .block-gallery-tabs button,
  .block-gallery-albums.tabs-right .block-gallery-tabs button{
    width:auto;
  }
}

@media(max-width:760px){
  .block-gallery-grid{
    grid-template-columns:repeat(var(--gallery-mobile-cols), minmax(0, 1fr));
  }
}



/* =========================================================
   Gallery Album Names + WebP Upload UI
   ========================================================= */
.pxth-gallery-album-name-list{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}

.pxth-gallery-album-name-list label{
  display:block;
  font-size:12px;
  font-weight:800;
  color:#334155;
}

.pxth-gallery-album-name-list input{
  display:block;
  width:100%;
  height:34px;
  margin-top:5px;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 8px;
  background:#fff;
  color:#111827;
  font-size:13px;
}

.gallery-dropzone::after{
  content:"อัปโหลดแล้วแปลงเป็น WebP ไม่เกิน 800x600 และพยายามบีบให้ใกล้ 50KB";
  display:block;
  max-width:260px;
  font-size:12px;
  line-height:1.45;
  color:#64748b;
  font-weight:700;
}

@media(max-width:760px){
  .pxth-gallery-album-name-list{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   Gallery Lightbox + Mobile Columns 1-4
   ========================================================= */
.block-gallery-image-item{
  cursor:zoom-in;
}

.pxth-gallery-lightbox{
  position:fixed;
  inset:0;
  z-index:2147483900;
  background:rgba(2,6,23,.88);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px 72px;
  box-sizing:border-box;
}

.pxth-gallery-lightbox figure{
  margin:0;
  width:min(1100px, 100%);
  max-height:calc(100vh - 64px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.pxth-gallery-lightbox img{
  display:block;
  max-width:100%;
  max-height:calc(100vh - 110px);
  object-fit:contain;
  border-radius:14px;
  box-shadow:0 24px 80px rgba(0,0,0,.4);
  background:#fff;
}

.pxth-gallery-lightbox figcaption{
  margin-top:10px;
  color:#fff;
  font-size:14px;
  font-weight:900;
}

.pxth-gallery-lightbox-close{
  position:absolute;
  top:18px;
  right:18px;
  width:42px;
  height:42px;
  border:0;
  border-radius:999px;
  background:#fff;
  color:#0f172a;
  font-size:26px;
  line-height:1;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 12px 32px rgba(0,0,0,.25);
}

.pxth-gallery-lightbox-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:54px;
  height:54px;
  border:0;
  border-radius:999px;
  background:#fff;
  color:#0f172a;
  font-size:42px;
  line-height:1;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 12px 32px rgba(0,0,0,.25);
}

.pxth-gallery-lightbox-arrow.prev{
  left:18px;
}

.pxth-gallery-lightbox-arrow.next{
  right:18px;
}

.pxth-gallery-lightbox-arrow:hover,
.pxth-gallery-lightbox-close:hover{
  background:#0b7be8;
  color:#fff;
}

@media(max-width:760px){
  .block-gallery-grid{
    grid-template-columns:repeat(var(--gallery-mobile-cols), minmax(0, 1fr)) !important;
  }

  .pxth-gallery-lightbox{
    padding:20px 48px;
  }

  .pxth-gallery-lightbox-arrow{
    width:40px;
    height:40px;
    font-size:32px;
  }

  .pxth-gallery-lightbox-arrow.prev{left:6px;}
  .pxth-gallery-lightbox-arrow.next{right:6px;}

  .pxth-gallery-lightbox-close{
    top:10px;
    right:10px;
    width:36px;
    height:36px;
    font-size:22px;
  }

  .pxth-gallery-lightbox img{
    max-height:calc(100vh - 92px);
    border-radius:10px;
  }
}


/* =========================================================
   Contact Info Inline Accordion Editor
   ========================================================= */
.block-contact-editor{
  width:100%;
}

.block-contact-head{
  margin:0 0 18px;
}

.block-contact-kicker{
  display:block;
  margin:0 0 6px;
  font-size:14px;
  font-weight:900;
  color:#64748b;
}

.block-contact-head h2{
  margin:0 0 10px;
  font-size:clamp(30px, 5vw, 54px);
  line-height:1.05;
  font-weight:1000;
  letter-spacing:-.04em;
}

.block-contact-company{
  font-size:16px;
  color:#64748b;
}

.contact-repeater{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:520px;
}

.contact-item{
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 8px 20px rgba(15,23,42,.05);
}

.contact-item-summary{
  appearance:none;
  width:100%;
  display:grid;
  grid-template-columns:42px minmax(0,1fr) 24px;
  gap:12px;
  align-items:center;
  border:0;
  background:#fff;
  color:#111827;
  text-align:left;
  padding:10px 12px;
  cursor:pointer;
  text-decoration:none;
}

.contact-item-summary:hover{
  background:#f8fafc;
}

.contact-icon{
  width:42px;
  height:42px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb, var(--contact-color) 16%, #fff);
  color:var(--contact-color);
  font-size:20px;
  font-weight:900;
}

.contact-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.contact-copy b{
  display:block;
  font-size:15px;
  font-weight:1000;
  color:#111827;
}

.contact-copy small{
  display:block;
  margin-top:3px;
  font-size:13px;
  font-weight:700;
  color:#64748b;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.contact-chevron{
  color:#94a3b8;
  font-size:18px;
  font-weight:900;
  transition:transform .18s ease;
}

.contact-item.open .contact-chevron{
  transform:rotate(180deg);
}

.contact-item-panel{
  display:none;
  border-top:1px solid #e5e7eb;
  background:#f8fafc;
  padding:12px;
}

.contact-item.open .contact-item-panel{
  display:block;
}

.contact-form-grid{
  display:grid;
  grid-template-columns:80px 1fr;
  gap:10px;
}

.contact-form-grid label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#334155;
}

.contact-form-grid input[type="text"],
.contact-form-grid input:not([type]){
  display:block;
  width:100%;
  height:34px;
  margin-top:5px;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 8px;
  background:#fff;
  color:#111827;
  font-size:13px;
}

.contact-form-grid label:nth-child(3),
.contact-form-grid label:nth-child(4),
.contact-form-grid label:nth-child(5){
  grid-column:1 / -1;
}

.contact-color-line{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:8px;
  align-items:center;
  margin-top:5px;
}

.contact-color-line input[type="color"]{
  width:42px;
  height:34px;
  padding:0;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
}

.contact-color-line input[readonly]{
  color:#64748b;
  background:#f1f5f9;
}

.contact-item-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.contact-item-actions button,
.contact-add-item{
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#111827;
  padding:8px 12px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.contact-item-actions button:hover,
.contact-add-item:hover{
  background:#f1f5f9;
}

.contact-item-actions [data-contact-remove]{
  background:#fee2e2;
  border-color:#fecaca;
  color:#b91c1c;
}

.contact-add-item{
  margin-top:12px;
  background:#f8fafc;
}

@media(max-width:760px){
  .contact-repeater{
    max-width:none;
  }

  .contact-form-grid{
    grid-template-columns:1fr;
  }

  .contact-form-grid label{
    grid-column:auto !important;
  }
}


/* =========================================================
   Contact Info Compact Icon + Inline Text
   ========================================================= */
.contact-item-summary{
  grid-template-columns:32px minmax(0,1fr) 18px !important;
  gap:10px !important;
  padding:9px 12px !important;
}

.contact-icon{
  width:32px !important;
  height:32px !important;
  min-width:32px !important;
  font-size:15px !important;
}

.contact-copy{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:8px !important;
  min-width:0 !important;
}

.contact-copy b{
  font-size:15px !important;
  line-height:1.2 !important;
  white-space:nowrap !important;
}

.contact-copy small{
  margin-top:0 !important;
  font-size:13px !important;
  line-height:1.2 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* หน้าเว็บจริงที่ไม่ได้อยู่โหมด edit ไม่ต้องแสดงลูกศร */
html:not([data-edit="1"]) .contact-chevron{
  display:none !important;
}

html:not([data-edit="1"]) .contact-item-summary{
  grid-template-columns:32px minmax(0,1fr) !important;
}

.contact-form-grid input[list]{
  padding-right:6px !important;
}

@media(max-width:520px){
  .contact-copy{
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:2px !important;
  }

  .contact-copy b,
  .contact-copy small{
    max-width:100% !important;
  }
}


/* =========================================================
   Contact Design Mode + Optional Link
   ========================================================= */
.contact-design-simple .contact-repeater{
  gap:4px !important;
}

.contact-design-simple .contact-item{
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  overflow:visible !important;
}

.contact-design-simple .contact-item-summary{
  background:transparent !important;
  padding:5px 0 !important;
  border-radius:0 !important;
}

.contact-design-simple .contact-item-summary:hover{
  background:transparent !important;
}

.contact-design-simple .contact-icon{
  background:transparent !important;
  width:24px !important;
  height:24px !important;
  min-width:24px !important;
  font-size:14px !important;
}

.contact-design-simple .contact-item-panel{
  border-top:0 !important;
  background:#f8fafc !important;
  border-radius:12px !important;
  margin:6px 0 8px 34px !important;
  border:1px solid #e5e7eb !important;
}

.contact-link-enable{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  margin-top:19px !important;
}

.contact-link-enable span{
  font-size:12px !important;
  font-weight:900 !important;
  color:#334155 !important;
}

.contact-link-enable input[type="checkbox"]{
  width:18px !important;
  height:18px !important;
}

.contact-form-grid input:disabled{
  background:#e5e7eb !important;
  color:#94a3b8 !important;
  cursor:not-allowed !important;
}

.contact-no-link{
  cursor:default !important;
}

html:not([data-edit="1"]) .contact-no-link:hover{
  background:#fff !important;
}

html:not([data-edit="1"]) .contact-design-simple .contact-no-link:hover{
  background:transparent !important;
}



/* =========================================================
   Facebook Page URL Fix
   ========================================================= */
.block-facebook{
  position:relative;
  min-height:220px;
}

.block-facebook iframe{
  width:100% !important;
  max-width:100% !important;
  display:block !important;
  border-radius:10px !important;
  background:#fff !important;
}

.block-facebook [data-edit-custom-facebook]{
  margin-top:12px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#111827;
  padding:9px 14px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-facebook [data-edit-custom-facebook]:hover{
  background:#f1f5f9;
}



/* =========================================================
   Facebook Page Settings UI
   ========================================================= */
.pxth-fb-settings-panel{
  max-width:520px !important;
}

.pxth-fb-url-input{
  width:100%;
  height:38px;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 10px;
  font-size:13px;
  font-weight:700;
  background:#fff;
  color:#111827;
}

.pxth-fb-setting-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 54px;
  gap:12px;
  align-items:center;
  padding:9px 0;
  font-size:13px;
  font-weight:800;
  color:#475569;
}

.pxth-fb-setting-row input{
  display:none;
}

.pxth-fb-setting-row i{
  position:relative;
  width:54px;
  height:28px;
  border-radius:999px;
  background:#e5e7eb;
  cursor:pointer;
  transition:.18s;
}

.pxth-fb-setting-row i::before{
  content:"NO";
  position:absolute;
  left:22px;
  top:50%;
  transform:translateY(-50%);
  font-size:8px;
  font-weight:900;
  color:#94a3b8;
}

.pxth-fb-setting-row i::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  transition:.18s;
}

.pxth-fb-setting-row input:checked + i{
  background:#67c7e8;
}

.pxth-fb-setting-row input:checked + i::before{
  content:"YES";
  left:8px;
  color:#fff;
}

.pxth-fb-setting-row input:checked + i::after{
  left:29px;
}

.pxth-fb-height-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 78px;
  gap:14px;
  align-items:center;
}

.pxth-fb-height-row input[type="range"]{
  width:100%;
}

.pxth-fb-height-row input[type="number"]{
  width:78px;
  height:36px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 9px;
  box-sizing:border-box;
  font-weight:800;
}


/* =========================================================
   Multi Video Block Grid/List/Carousel
   ========================================================= */
.block-videos{
  width:100%;
}

.block-video-items{
  display:grid;
  gap:22px;
}

.block-videos.is-grid .block-video-items{
  grid-template-columns:repeat(2, minmax(0,1fr));
}

.block-videos.is-list .block-video-items{
  grid-template-columns:1fr;
}

.block-video-item{
  position:relative;
  min-width:0;
}

.block-video-frame{
  width:100%;
  aspect-ratio:16/9;
  background:#eee;
  border-radius:14px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.block-video-frame iframe,
.block-video-frame video{
  width:100%;
  height:100%;
  display:block;
  border:0;
}

.block-video-empty{
  color:#64748b;
  font-weight:900;
}

.block-video-meta{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:10px;
}

.block-video-meta input{
  width:100%;
  height:36px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 10px;
  box-sizing:border-box;
  font-weight:800;
}

.block-video-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
  flex-wrap:wrap;
}

.block-video-actions button,
.block-video-add{
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#111827;
  padding:8px 12px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-video-actions [data-video-remove]{
  background:#fee2e2;
  border-color:#fecaca;
  color:#b91c1c;
}

.block-video-add{
  display:inline-flex;
  margin-top:14px;
  background:#f8fafc;
}

.block-video-dots{
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  margin-top:16px;
}

.block-video-dots button{
  width:34px;
  height:34px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#0f172a;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-video-dots button.active{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}

.block-videos.is-carousel{
  overflow:hidden;
}

.block-videos.is-carousel .block-video-items{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:430px;
  gap:0;
}

.block-videos.is-carousel .block-video-item{
  position:absolute;
  left:50%;
  width:min(760px, 72%);
  opacity:0;
  transform:translateX(-50%) scale(.72);
  transition:transform .28s ease, opacity .28s ease, filter .28s ease;
  pointer-events:none;
  z-index:1;
  filter:grayscale(.08);
}

.block-videos.is-carousel .block-video-item.active{
  opacity:1;
  transform:translateX(-50%) scale(1);
  pointer-events:auto;
  z-index:3;
  filter:none;
}

.block-videos.is-carousel .block-video-item.prev{
  opacity:.55;
  transform:translateX(-118%) scale(.68);
  z-index:2;
  pointer-events:auto;
  cursor:pointer;
}

.block-videos.is-carousel .block-video-item.next{
  opacity:.55;
  transform:translateX(18%) scale(.68);
  z-index:2;
  pointer-events:auto;
  cursor:pointer;
}

.block-videos.is-carousel .block-video-item:not(.active) .block-video-meta,
.block-videos.is-carousel .block-video-item:not(.active) .block-video-actions{
  display:none;
}

.block-video-title{
  margin-top:10px;
  font-weight:900;
  color:#111827;
}

@media(max-width:900px){
  .block-videos.is-grid .block-video-items{
    grid-template-columns:1fr;
  }

  .block-videos.is-carousel .block-video-items{
    min-height:340px;
  }

  .block-videos.is-carousel .block-video-item{
    width:80%;
  }

  .block-videos.is-carousel .block-video-item.prev{
    transform:translateX(-112%) scale(.62);
  }

  .block-videos.is-carousel .block-video-item.next{
    transform:translateX(12%) scale(.62);
  }
}

@media(max-width:760px){
  .block-videos.is-carousel .block-video-items{
    min-height:auto;
    display:block;
  }

  .block-videos.is-carousel .block-video-item{
    position:relative;
    left:auto;
    width:100%;
    opacity:0;
    transform:none;
    display:none;
  }

  .block-videos.is-carousel .block-video-item.active{
    display:block;
    opacity:1;
    transform:none;
  }

  .block-videos.is-carousel .block-video-item.prev,
  .block-videos.is-carousel .block-video-item.next{
    display:none;
  }
}


/* =========================================================
   Video Carousel Clip Fix
   แก้ iframe ขอบบนโดนตัดใน carousel
   ========================================================= */
.block-videos.is-carousel{
  overflow:visible !important;
  padding-top:30px !important;
  padding-bottom:10px !important;
}

.block-videos.is-carousel .block-video-items{
  overflow:visible !important;
  min-height:540px !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
}

.block-videos.is-carousel .block-video-item{
  top:50% !important;
  transform-origin:center center !important;
}

.block-videos.is-carousel .block-video-item{
  transform:translate(-50%, -50%) scale(.72) !important;
}

.block-videos.is-carousel .block-video-item.active{
  transform:translate(-50%, -50%) scale(1) !important;
}

.block-videos.is-carousel .block-video-item.prev{
  transform:translate(-118%, -50%) scale(.68) !important;
}

.block-videos.is-carousel .block-video-item.next{
  transform:translate(18%, -50%) scale(.68) !important;
}

.block-videos.is-carousel .block-video-frame{
  overflow:hidden !important;
  border-radius:14px !important;
  box-shadow:0 14px 38px rgba(15,23,42,.16) !important;
}

.block-videos.is-carousel .block-video-dots{
  position:relative !important;
  z-index:5 !important;
  margin-top:8px !important;
}

@media(max-width:900px){
  .block-videos.is-carousel .block-video-items{
    min-height:430px !important;
  }

  .block-videos.is-carousel .block-video-item.prev{
    transform:translate(-112%, -50%) scale(.62) !important;
  }

  .block-videos.is-carousel .block-video-item.next{
    transform:translate(12%, -50%) scale(.62) !important;
  }
}

@media(max-width:760px){
  .block-videos.is-carousel{
    padding-top:0 !important;
    padding-bottom:0 !important;
    overflow:visible !important;
  }

  .block-videos.is-carousel .block-video-items{
    min-height:auto !important;
    overflow:visible !important;
  }

  .block-videos.is-carousel .block-video-item,
  .block-videos.is-carousel .block-video-item.active{
    top:auto !important;
    transform:none !important;
  }
}


/* =========================================================
   Video Grid 1-6 Columns + List Left/Right Layout
   ========================================================= */
.block-videos{
  --video-cols:3;
}

.block-videos.is-grid .block-video-items{
  grid-template-columns:repeat(var(--video-cols), minmax(0,1fr)) !important;
}

.block-videos.is-list .block-video-items{
  grid-template-columns:1fr !important;
  gap:18px !important;
}

.block-videos.is-list .block-video-item{
  display:grid !important;
  grid-template-columns:minmax(240px, 42%) minmax(0,1fr) !important;
  column-gap:18px !important;
  align-items:start !important;
  padding:14px !important;
  border:1px solid #e5e7eb !important;
  border-radius:14px !important;
  background:#fff !important;
  box-shadow:0 8px 22px rgba(15,23,42,.06) !important;
}

.block-videos.is-list .block-video-frame{
  grid-column:1 !important;
  grid-row:1 / span 3 !important;
  margin:0 !important;
}

.block-videos.is-list .block-video-title,
.block-videos.is-list .block-video-meta,
.block-videos.is-list .block-video-actions{
  grid-column:2 !important;
}

.block-videos.is-list .block-video-title{
  margin:0 0 8px !important;
  font-size:20px !important;
  line-height:1.25 !important;
  font-weight:1000 !important;
}

.block-videos.is-list .block-video-meta{
  margin-top:0 !important;
}

.block-videos.is-list .block-video-actions{
  margin-top:12px !important;
}

@media(max-width:1100px){
  .block-videos.is-grid .block-video-items{
    grid-template-columns:repeat(min(var(--video-cols), 3), minmax(0,1fr)) !important;
  }
}

@media(max-width:900px){
  .block-videos.is-grid .block-video-items{
    grid-template-columns:repeat(min(var(--video-cols), 2), minmax(0,1fr)) !important;
  }

  .block-videos.is-list .block-video-item{
    grid-template-columns:220px minmax(0,1fr) !important;
  }
}

@media(max-width:760px){
  .block-videos.is-grid .block-video-items{
    grid-template-columns:1fr !important;
  }

  .block-videos.is-list .block-video-item{
    display:block !important;
  }

  .block-videos.is-list .block-video-frame{
    margin-bottom:12px !important;
  }
}


/* =========================================================
   Video Dots Carousel Only
   ========================================================= */
.block-videos:not(.is-carousel) .block-video-dots{
  display:none !important;
}

.block-videos.is-carousel .block-video-dots{
  display:flex !important;
}


/* =========================================================
   Multi News Block Grid/List/Carousel + Popup
   ========================================================= */
.block-news-list{
  --news-cols:3;
  width:100%;
}

.block-news-items{
  display:grid;
  gap:22px;
}

.block-news-list.is-grid .block-news-items{
  grid-template-columns:repeat(var(--news-cols), minmax(0,1fr));
}

.block-news-card{
  position:relative;
  min-width:0;
  border:1px solid #e5e7eb;
  border-radius:14px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 8px 22px rgba(15,23,42,.06);
  cursor:pointer;
}

.block-news-card:hover{
  box-shadow:0 12px 30px rgba(15,23,42,.12);
}

.block-news-card .block-news-image{
  width:100%;
  aspect-ratio:16/9;
  border-radius:0;
  margin:0;
  background:#eee center/cover no-repeat;
}

.block-news-body{
  padding:14px;
}

.block-news-body h3{
  margin:0 0 8px;
  font-size:20px;
  line-height:1.25;
  font-weight:1000;
}

.block-news-desc{
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font-size:14px;
  line-height:1.55;
  color:#475569;
}

.block-news-item-actions{
  padding:0 14px 14px;
}

.block-news-item-actions button,
.block-news-add{
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#111827;
  padding:8px 12px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-news-item-actions [data-news-remove]{
  background:#fee2e2;
  border-color:#fecaca;
  color:#b91c1c;
}

.block-news-add{
  display:inline-flex;
  margin-top:14px;
  background:#f8fafc;
}

.block-news-dots{
  display:none;
  gap:10px;
  justify-content:center;
  align-items:center;
  margin-top:16px;
}

.block-news-list.is-carousel .block-news-dots{
  display:flex;
}

.block-news-dots button{
  width:34px;
  height:34px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#0f172a;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.block-news-dots button.active{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}

/* News List: image left, text right */
.block-news-list.is-list .block-news-items{
  grid-template-columns:1fr;
}

.block-news-list.is-list .block-news-card{
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
  align-items:stretch;
}

.block-news-list.is-list .block-news-card .block-news-image{
  height:100%;
  min-height:180px;
  aspect-ratio:auto;
  grid-column:1;
  grid-row:1 / span 2;
}

.block-news-list.is-list .block-news-body{
  grid-column:2;
}

.block-news-list.is-list .block-news-item-actions{
  grid-column:2;
}

/* News carousel: center large, side cards smaller */
.block-news-list.is-carousel{
  overflow:visible;
}

.block-news-list.is-carousel .block-news-items{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:430px;
  overflow:visible;
}

.block-news-list.is-carousel .block-news-card{
  position:absolute;
  left:50%;
  width:min(620px, 70%);
  opacity:0;
  transform:translate(-50%, 0) scale(.72);
  transition:transform .28s ease, opacity .28s ease, filter .28s ease;
  pointer-events:none;
  z-index:1;
  filter:grayscale(.08);
}

.block-news-list.is-carousel .block-news-card.active{
  opacity:1;
  transform:translate(-50%, 0) scale(1);
  pointer-events:auto;
  z-index:3;
  filter:none;
}

.block-news-list.is-carousel .block-news-card.prev{
  opacity:.55;
  transform:translate(-118%, 0) scale(.68);
  z-index:2;
  pointer-events:auto;
}

.block-news-list.is-carousel .block-news-card.next{
  opacity:.55;
  transform:translate(18%, 0) scale(.68);
  z-index:2;
  pointer-events:auto;
}

/* Popup */
.pxth-news-popup{
  position:fixed;
  inset:0;
  z-index:2147483800;
  background:rgba(15,23,42,.72);
  padding:34px 16px;
  box-sizing:border-box;
  overflow:auto;
}

.pxth-news-popup-panel{
  position:relative;
  width:min(880px, calc(100vw - 32px));
  margin:0 auto;
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.35);
}

.pxth-news-popup-close{
  position:absolute;
  top:12px;
  right:12px;
  z-index:2;
  width:38px;
  height:38px;
  border:0;
  border-radius:999px;
  background:#fff;
  color:#0f172a;
  font-size:24px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 8px 22px rgba(0,0,0,.18);
}

.pxth-news-popup-img{
  display:block;
  width:100%;
  max-height:520px;
  object-fit:cover;
  background:#eee;
}

.pxth-news-popup-content{
  padding:22px;
}

.pxth-news-popup-content h2{
  margin:0 0 14px;
  font-size:clamp(26px, 4vw, 44px);
  line-height:1.12;
  font-weight:1000;
}

.pxth-news-popup-text{
  font-size:16px;
  line-height:1.75;
  color:#334155;
}

@media(max-width:1100px){
  .block-news-list.is-grid .block-news-items{
    grid-template-columns:repeat(min(var(--news-cols), 3), minmax(0,1fr));
  }
}

@media(max-width:900px){
  .block-news-list.is-grid .block-news-items{
    grid-template-columns:repeat(min(var(--news-cols), 2), minmax(0,1fr));
  }

  .block-news-list.is-list .block-news-card{
    grid-template-columns:220px minmax(0,1fr);
  }

  .block-news-list.is-carousel .block-news-items{
    min-height:380px;
  }

  .block-news-list.is-carousel .block-news-card{
    width:78%;
  }

  .block-news-list.is-carousel .block-news-card.prev{
    transform:translate(-112%, 0) scale(.62);
  }

  .block-news-list.is-carousel .block-news-card.next{
    transform:translate(12%, 0) scale(.62);
  }
}

@media(max-width:760px){
  .block-news-list.is-grid .block-news-items{
    grid-template-columns:1fr;
  }

  .block-news-list.is-list .block-news-card{
    display:block;
  }

  .block-news-list.is-list .block-news-card .block-news-image{
    height:auto;
    min-height:0;
    aspect-ratio:16/9;
  }

  .block-news-list.is-carousel .block-news-items{
    min-height:auto;
    display:block;
  }

  .block-news-list.is-carousel .block-news-card{
    position:relative;
    left:auto;
    width:100%;
    opacity:0;
    transform:none;
    display:none;
  }

  .block-news-list.is-carousel .block-news-card.active{
    display:block;
    opacity:1;
    transform:none;
  }

  .block-news-list.is-carousel .block-news-card.prev,
  .block-news-list.is-carousel .block-news-card.next{
    display:none;
  }
}


/* =========================================================
   News Carousel Product Style / No Bullets
   ========================================================= */
.block-news-dots{
  display:none !important;
}

.block-news-carousel-nav{
  display:none;
  justify-content:flex-end;
  gap:8px;
  margin:0 0 12px;
}

.block-news-list.is-carousel .block-news-carousel-nav{
  display:flex;
}

.block-news-carousel-nav button{
  width:38px;
  height:38px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
  font-size:26px;
  line-height:1;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(15,23,42,.08);
}

.block-news-carousel-nav button:hover{
  background:#64748b;
  color:#fff;
  border-color:#64748b;
}

/* Override old video-style news carousel */
.block-news-list.is-carousel{
  overflow:visible !important;
}

.block-news-list.is-carousel .block-news-items{
  position:static !important;
  display:flex !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  gap:18px !important;
  min-height:0 !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:x mandatory !important;
  scroll-behavior:smooth !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
  padding-bottom:0 !important;
}

.block-news-list.is-carousel .block-news-items::-webkit-scrollbar{
  display:none !important;
  width:0 !important;
  height:0 !important;
}

.block-news-list.is-carousel .block-news-card{
  position:relative !important;
  left:auto !important;
  width:auto !important;
  flex:0 0 calc((100% - (18px * (var(--news-cols) - 1))) / var(--news-cols)) !important;
  max-width:calc((100% - (18px * (var(--news-cols) - 1))) / var(--news-cols)) !important;
  opacity:1 !important;
  transform:none !important;
  transition:box-shadow .18s ease, transform .18s ease !important;
  pointer-events:auto !important;
  z-index:auto !important;
  filter:none !important;
  scroll-snap-align:start !important;
}

.block-news-list.is-carousel .block-news-card:hover{
  transform:translateY(-2px) !important;
}

@media(max-width:900px){
  .block-news-list.is-carousel .block-news-card{
    flex-basis:calc((100% - 18px) / 2) !important;
    max-width:calc((100% - 18px) / 2) !important;
  }
}

@media(max-width:760px){
  .block-news-list.is-carousel .block-news-card{
    display:block !important;
    flex-basis:88vw !important;
    max-width:88vw !important;
    opacity:1 !important;
    transform:none !important;
  }

  .block-news-carousel-nav{
    justify-content:center;
  }
}


/* =========================================================
   Map Settings Full Width / Height / Zoom
   ========================================================= */
.block-map{
  --map-height:420px;
  width:100%;
}

.block-map iframe{
  width:100% !important;
  height:var(--map-height) !important;
  min-height:220px !important;
  display:block !important;
  border:0 !important;
  border-radius:10px !important;
}

.block-map.map-full-width{
  width:100vw !important;
  margin-left:calc(50% - 50vw) !important;
  margin-right:calc(50% - 50vw) !important;
}

.block-map.map-full-width iframe,
.block-map.map-full-width .block-map-empty{
  border-radius:0 !important;
}

.block-map-empty{
  height:var(--map-height) !important;
}

.block-map [data-edit-custom-map]{
  margin-top:12px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#111827;
  padding:9px 14px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.pxth-map-settings-panel{
  max-width:680px !important;
}

.pxth-map-html-input{
  width:100%;
  min-height:120px;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:10px;
  padding:10px;
  background:#fff;
  color:#111827;
  font-size:13px;
  line-height:1.5;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pxth-map-switch-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 54px;
  gap:12px;
  align-items:center;
  font-size:13px;
  font-weight:900;
  color:#334155;
}

.pxth-map-switch-row input{
  display:none;
}

.pxth-map-switch-row i{
  position:relative;
  width:54px;
  height:28px;
  border-radius:999px;
  background:#e5e7eb;
  cursor:pointer;
  transition:.18s;
}

.pxth-map-switch-row i::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  transition:.18s;
}

.pxth-map-switch-row input:checked + i{
  background:#67c7e8;
}

.pxth-map-switch-row input:checked + i::after{
  left:29px;
}

.pxth-map-range-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 86px;
  gap:14px;
  align-items:center;
}

.pxth-map-range-row input[type="range"]{
  width:100%;
}

.pxth-map-range-row input[type="number"]{
  width:86px;
  height:36px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 9px;
  box-sizing:border-box;
  font-weight:800;
}

.pxth-map-note{
  display:block;
  margin-top:8px;
  color:#64748b;
  font-size:12px;
  line-height:1.45;
}


/* =========================================================
   Quick Load Buttons: Map / Fanpage / Video
   ========================================================= */
.pxth-load-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
  align-items:center;
}

.pxth-load-actions .btn,
.pxth-load-actions button{
  border:1px solid #cbd5e1 !important;
  border-radius:999px !important;
  background:#fff !important;
  color:#111827 !important;
  padding:9px 14px !important;
  font-size:13px !important;
  font-weight:900 !important;
  cursor:pointer !important;
  line-height:1 !important;
  box-shadow:none !important;
}

.pxth-load-actions [data-load-map],
.pxth-load-actions [data-load-facebook],
.pxth-load-actions [data-load-video]{
  background:#0b7be8 !important;
  border-color:#0b7be8 !important;
  color:#fff !important;
}

.pxth-load-actions button:hover{
  filter:brightness(.96);
}


/* =========================================================
   Lazy Load iframe placeholders for PageSpeed
   ========================================================= */
.pxth-lazy-box{
  min-height:220px;
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#f1f5f9;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 18px 50px rgba(15,23,42,.06);
  box-sizing:border-box;
}

.pxth-lazy-map,
.pxth-lazy-facebook{
  min-height:var(--map-height, 420px);
}

.pxth-lazy-facebook{
  min-height:420px;
}

.pxth-lazy-video{
  min-height:100%;
  aspect-ratio:16/9;
  border-radius:14px;
}

.pxth-lazy-load-btn{
  border:0;
  border-radius:999px;
  background:#111;
  color:#fff;
  padding:12px 18px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 14px 28px rgba(0,0,0,.18);
}

.pxth-lazy-load-btn:hover{
  background:#0b7be8;
}

.map-full-width .pxth-lazy-box{
  border-radius:0;
}

.block-video-frame .pxth-lazy-box{
  height:100%;
  min-height:100%;
  border:0;
  box-shadow:none;
}


/* =========================================================
   Hide Lazy Load Buttons in Backend/Edit Mode
   ========================================================= */
html[data-edit="1"] [data-lazy-load],
html[data-edit="1"] [data-load-map],
html[data-edit="1"] [data-load-facebook],
html[data-edit="1"] [data-load-video]{
  display:none !important;
}

/* หน้าเว็บจริงยังให้ปุ่ม lazy load แสดงได้ตามปกติ */
html:not([data-edit="1"]) .pxth-lazy-load-btn{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
}


/* =========================================================
   Safe Section Settings
   ========================================================= */
/* default เดิมต้องยังอยู่: .custom-block margin 0 0 18px */
.custom-section.no-block-margin .custom-block{
  margin-bottom:0 !important;
}

.pxth-section-settings-panel{
  max-width:760px !important;
}

.pxth-section-settings-group{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:14px;
  margin:0 0 14px;
  background:#f8fafc;
}

.pxth-section-settings-title{
  font-size:14px;
  font-weight:1000;
  color:#111827;
  margin:0 0 10px;
}

.pxth-section-settings-row4{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:10px;
}

.pxth-section-settings-row2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}

.pxth-section-settings-row4 label,
.pxth-section-settings-row2 label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#334155;
}

.pxth-section-settings-row4 input,
.pxth-section-settings-row2 input,
.pxth-section-settings-row2 select{
  width:100%;
  height:34px;
  margin-top:5px;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 8px;
  background:#fff;
  color:#111827;
  font-size:13px;
  font-weight:800;
}

.pxth-section-settings-row2 input[type="color"]{
  padding:2px;
}

.pxth-section-same,
.pxth-section-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
  font-size:13px;
  font-weight:800;
  color:#334155;
}

.pxth-section-toggle input,
.pxth-section-same input{
  width:17px;
  height:17px;
}

.pxth-section-settings-group small{
  display:block;
  margin-top:8px;
  color:#64748b;
  font-size:12px;
  line-height:1.45;
}

@media(max-width:760px){
  .pxth-section-settings-row4,
  .pxth-section-settings-row2{
    grid-template-columns:1fr 1fr;
  }
}


/* =========================================================
   Section BG Color Fix
   ========================================================= */
.custom-section[data-sec-bg]:not([data-sec-bg=""]){
  background-color:var(--sec-bg) !important;
}

.custom-section[data-sec-color]:not([data-sec-color=""]){
  color:inherit;
}

.custom-section[data-sec-bg]:not([data-sec-bg=""]) .wrap{
  position:relative;
  z-index:1;
}


/* =========================================================
   Section Font Color Deep Fix
   ========================================================= */
.custom-section[data-sec-color]:not([data-sec-color=""]){
  color:var(--sec-color) !important;
}

.custom-section[data-sec-color]:not([data-sec-color=""]) :where(
  h1,h2,h3,h4,h5,h6,
  p,span,strong,b,em,i,small,
  li,dt,dd,
  .block-contact-kicker,
  .block-contact-company,
  .block-news-body h3,
  .block-news-desc,
  .block-product-price,
  .block-video-title,
  [data-custom-html]
){
  color:var(--sec-color) !important;
}

/* link ให้ตามสี section ด้วย แต่ยังคง underline/interaction เดิม */
.custom-section[data-sec-color]:not([data-sec-color=""]) a:not(.btn):not(.button){
  color:var(--sec-color) !important;
}

/* ปุ่มที่เป็นปุ่มจริงไม่บังคับสีทั้งหมด เพื่อไม่ทำให้ปุ่มหายจากแบรนด์ */
.custom-section[data-sec-color]:not([data-sec-color=""]) .btn:not(.pxth-lazy-load-btn),
.custom-section[data-sec-color]:not([data-sec-color=""]) button:not(.pxth-lazy-load-btn):not([data-section-act]):not([data-block-act]){
  color:inherit;
}


/* =========================================================
   Section Settings Compact UI + BG Upload
   ========================================================= */
.pxth-section-settings-panel{
  max-width:820px !important;
}

.pxth-spacing-line{
  display:grid;
  grid-template-columns:72px minmax(0, 1fr) 92px;
  gap:10px;
  align-items:end;
  margin-top:10px;
}

.pxth-spacing-label{
  height:34px;
  display:flex;
  align-items:center;
  font-size:13px;
  font-weight:1000;
  color:#111827;
}

.pxth-section-settings-row4.compact{
  display:grid;
  grid-template-columns:repeat(4, 78px);
  gap:8px;
  justify-content:start;
}

.pxth-section-settings-row4.compact input{
  width:78px !important;
  min-width:0 !important;
}

.pxth-section-settings-row3{
  display:grid;
  grid-template-columns:180px 180px 140px;
  gap:12px;
  align-items:end;
}

.pxth-section-settings-row3 label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#334155;
}

.pxth-section-settings-row3 input{
  width:100%;
  height:34px;
  margin-top:5px;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 8px;
  background:#fff;
  color:#111827;
  font-size:13px;
  font-weight:800;
}

.pxth-section-settings-row3 input[type="color"]{
  padding:2px;
}

.pxth-bg-image-line label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#334155;
}

.pxth-bg-image-picker{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 90px 70px;
  gap:8px;
  margin-top:5px;
  align-items:center;
}

.pxth-bg-image-picker input{
  width:100%;
  height:36px;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:0 10px;
  background:#fff;
  color:#111827;
  font-size:13px;
  font-weight:800;
}

.pxth-bg-image-picker button{
  height:36px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#111827;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}

.pxth-bg-image-picker [data-pick-section-bg]{
  background:#0b7be8;
  border-color:#0b7be8;
  color:#fff;
}

.pxth-bg-image-picker [data-clear-section-bg]{
  background:#fee2e2;
  border-color:#fecaca;
  color:#b91c1c;
}

.pxth-section-settings-row2.bg-options{
  grid-template-columns:160px 220px;
  justify-content:start;
  margin-top:10px;
}

.pxth-section-same.inline{
  margin-top:0 !important;
  height:34px;
  align-items:center;
  white-space:nowrap;
}

@media(max-width:860px){
  .pxth-spacing-line{
    grid-template-columns:1fr;
    align-items:start;
  }

  .pxth-section-settings-row4.compact{
    grid-template-columns:repeat(4, minmax(0,1fr));
  }

  .pxth-section-settings-row4.compact input{
    width:100% !important;
  }

  .pxth-section-settings-row3{
    grid-template-columns:1fr;
  }

  .pxth-bg-image-picker{
    grid-template-columns:1fr;
  }

  .pxth-section-settings-row2.bg-options{
    grid-template-columns:1fr;
  }
}



/* =========================================================
   Section BG Upload Click Fix
   ========================================================= */
.pxth-bg-image-picker button{
  pointer-events:auto !important;
  position:relative;
  z-index:2;
}



/* =========================================================
   Gallery Delete Album Save Fix
   ========================================================= */
[data-gallery-album][hidden]{
  display:none !important;
}



/* =========================================================
   Gallery Delete Image / Unique Album Fix
   ========================================================= */
[data-gallery-image-remove],
[data-gallery-remove-image],
[data-delete-gallery-image],
.gallery-image-remove,
.block-gallery-image-remove,
.gallery-img-remove,
[data-gallery-delete-album],
[data-gallery-remove-album],
[data-delete-album]{
  pointer-events:auto !important;
  cursor:pointer !important;
  z-index:20 !important;
}


/* =========================================================
   Gallery Hard Delete Fix
   ========================================================= */
.block-gallery-image-item{
  position:relative !important;
}

.block-gallery-image-item [data-gallery-image-remove]{
  position:absolute !important;
  top:8px !important;
  right:8px !important;
  z-index:50 !important;
  pointer-events:auto !important;
  cursor:pointer !important;
}


/* =========================================================
   Gallery Save Replace Real Fix
   ========================================================= */
.block-gallery-image-item[data-gallery-image]{
  position:relative !important;
}

.block-gallery-image-item[data-gallery-image] [data-gallery-image-remove],
.block-gallery-image-item[data-gallery-image] .pxth-gallery-delete-image{
  position:absolute !important;
  top:8px !important;
  right:8px !important;
  z-index:9999 !important;
  width:30px !important;
  height:30px !important;
  border:0 !important;
  border-radius:999px !important;
  background:#ef4444 !important;
  color:#fff !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  line-height:1 !important;
  font-size:18px !important;
  font-weight:900 !important;
  cursor:pointer !important;
  pointer-events:auto !important;
  box-shadow:0 6px 16px rgba(0,0,0,.18) !important;
}


/* =========================================================
   Image Block Natural Ratio Fix
   ========================================================= */
.custom-block[data-block-type="image"] .block-image-box{
  width:100% !important;
  aspect-ratio:auto !important;
  height:auto !important;
  min-height:0 !important;
  margin-bottom:14px;
  border-radius:10px;
  background:#eee !important;
  background-image:none !important;
  background-size:auto !important;
  background-position:center !important;
  background-repeat:no-repeat !important;
  overflow:hidden;
  cursor:pointer;
  display:block;
}

.custom-block[data-block-type="image"] .block-image-box .block-image-real{
  display:block !important;
  width:100% !important;
  height:auto !important;
  max-width:100% !important;
  object-fit:contain !important;
  border-radius:inherit;
}

.custom-block[data-block-type="image"] .block-image-box .block-image-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:220px;
  color:#8a8a8a;
  font-size:48px;
  font-weight:500;
  background:#cfcfcf;
}

.custom-block[data-block-type="image"] .block-image-box[data-src=""]{
  min-height:220px !important;
}


/* =========================================================
   Product Image Natural Ratio Fix
   ========================================================= */
.custom-block[data-block-type="product"] .block-product-image,
.custom-block[data-block-type="product"] .product-image-box,
.custom-block[data-block-type="product"] [data-product-image]{
  width:100% !important;
  aspect-ratio:auto !important;
  height:auto !important;
  min-height:0 !important;
  border-radius:10px;
  background:#eee !important;
  background-image:none !important;
  background-size:auto !important;
  background-position:center !important;
  background-repeat:no-repeat !important;
  overflow:hidden;
  cursor:pointer;
  display:block;
}

.custom-block[data-block-type="product"] .block-product-image .product-image-real,
.custom-block[data-block-type="product"] .product-image-box .product-image-real,
.custom-block[data-block-type="product"] [data-product-image] .product-image-real{
  display:block !important;
  width:100% !important;
  height:auto !important;
  max-width:100% !important;
  object-fit:contain !important;
  border-radius:inherit;
}

.custom-block[data-block-type="product"] .block-product-image .product-image-placeholder,
.custom-block[data-block-type="product"] .product-image-box .product-image-placeholder,
.custom-block[data-block-type="product"] [data-product-image] .product-image-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:130px;
  color:#8a8a8a;
  font-size:34px;
  font-weight:500;
  background:#cfcfcf;
}

.custom-block[data-block-type="product"] .block-product-image[data-src=""],
.custom-block[data-block-type="product"] .product-image-box[data-src=""],
.custom-block[data-block-type="product"] [data-product-image][data-src=""]{
  min-height:130px !important;
}

/* กัน CSS เดิมที่บังคับ img เป็น cover */
.custom-block[data-block-type="product"] .block-product-image img,
.custom-block[data-block-type="product"] .product-image-box img{
  object-fit:contain !important;
  height:auto !important;
}



/* =========================================================
   Remove Old Section Toolbar Buttons
   ========================================================= */
#sectionManagerBtn,
#undoBtn,
#resetPageBtn,
[data-old-section-manager],
[data-action="section-manager"],
[data-action="undo"],
[data-action="reset-page"],
button[title="จัดการ Section"],
button[title="ย้อนกลับ (Undo)"],
button[title="รีเซ็ตหน้านี้"]{
  display:none !important;
}



/* =========================================================
   News Popup Frontend Only Safe
   ========================================================= */
.pxth-editor .block-news-card,
.pxth-editor .news-card,
body.is-editor .block-news-card,
body.is-editor .news-card{
  cursor:default !important;
}

.pxth-editor .block-news-card [data-edit-custom-image],
.pxth-editor .block-news-card [data-custom-html],
.pxth-editor .block-news-card button,
body.is-editor .block-news-card [data-edit-custom-image],
body.is-editor .block-news-card [data-custom-html],
body.is-editor .block-news-card button{
  cursor:pointer !important;
}


/* PXTH FIX: real banner block uses background-image, not img.
   Mobile must crop/show as 1200x700 frame, not 1900x700 full ratio. */
@media (max-width:768px){
  html,
  body{
    max-width:100% !important;
    overflow-x:hidden !important;
  }

  section[data-section="custom"],
  .custom-section,
  .custom-row,
  .custom-col{
    max-width:100% !important;
    overflow:visible !important;
  }

  .custom-block[data-block-type="banner"]{
    width:100vw !important;
    max-width:100vw !important;
    min-width:100vw !important;
    margin-left:50% !important;
    margin-right:0 !important;
    transform:translateX(-50%) !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
    margin-bottom:0 !important;
  }

  .custom-block[data-block-type="banner"] .block-banner,
  .custom-block[data-block-type="banner"] .block-banner-image{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    height:auto !important;
    aspect-ratio:1200 / 700 !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
  }

  .custom-block[data-block-type="banner"] .block-banner-image{
    background-size:cover !important;
    background-position:center center !important;
    background-repeat:no-repeat !important;
  }

  .custom-block[data-block-type="banner"] .block-banner-placeholder{
    width:100% !important;
    height:100% !important;
    min-height:calc(100vw * 700 / 1200) !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
}







/* PXTH ORGANIZED GLOBAL COLORS
   ระบบสีรวมแบบเป็นระเบียบ:
   - สีไตเติ้ล = หัวข้อหลักของ section/block
   - สีปุ่ม = ปุ่มหน้าเว็บจริงเท่านั้น
   - สีตัวอักษรปุ่ม = auto contrast จาก JS/PHP ไม่ให้กลืนกับพื้นปุ่ม
   - ไม่แตะ toolbar/topbar/header/menu/editor/system buttons */
:root{
  --pxth-title-color: var(--global-title-color, var(--theme-title, inherit));
  --pxth-button-bg: var(--global-button-color, var(--theme-button-bg, #0f172a));
  --pxth-button-text: var(--global-button-text-color, #ffffff);
}

/* ===== Title color: เฉพาะหัวข้อหลัก ไม่ใช่ชื่อสินค้า ===== */
section[data-section] h2,
.custom-section h2,
[data-custom-section] h2,
[data-custom-html] h2,
.block-text h2,
.custom-block[data-block-type="contact-info"] [data-field="title"],
.custom-block[data-block-type="contact-info"] .block-contact-head h2,
.custom-block[data-block-type="videos"] h2,
.custom-block[data-block-type="videos"] .block-title,
.custom-block[data-block-type="videos"] .section-title,
.custom-block[data-block-type="news"] h2,
.custom-block[data-block-type="news"] .block-title,
.custom-block[data-block-type="news"] .section-title,
.custom-block[data-block-type="gallery"] h2,
.custom-block[data-block-type="gallery"] .block-title,
.custom-block[data-block-type="gallery"] .section-title,
.custom-block[data-block-type="map"] h2,
.custom-block[data-block-type="facebook-page"] h2{
  color:var(--pxth-title-color) !important;
}

/* ชื่อสินค้า/หัวข้อย่อยสินค้า ไม่ตามสีไตเติ้ลรวม */
.custom-block[data-block-type="product"] h3,
.custom-block[data-block-type="product"] [data-field="title"],
.block-product-card h3,
.block-product-card [data-field="title"]{
  color:inherit !important;
}

/* ===== Button color: เฉพาะปุ่มหน้าเว็บจริงที่ควรเป็น branding ===== */
body:not([data-edit="1"]) .map-placeholder-btn,
body:not([data-edit="1"]) .load-map-btn,
body:not([data-edit="1"]) .load-fanpage-btn,
body:not([data-edit="1"]) .load-video-btn,
body:not([data-edit="1"]) .gallery-load-btn,
body:not([data-edit="1"]) [data-lazy-load],
body:not([data-edit="1"]) .block-gallery button[data-load-gallery],
body:not([data-edit="1"]) .block-videos [data-lazy-load],
body:not([data-edit="1"]) .block-map [data-lazy-load],
body:not([data-edit="1"]) .block-facebook [data-lazy-load],
html[data-edit="1"] .custom-block[data-block-type="gallery"] .gallery-load-btn,
html[data-edit="1"] .custom-block[data-block-type="gallery"] button[data-load-gallery],
html[data-edit="1"] .custom-block[data-block-type="videos"] .load-video-btn,
html[data-edit="1"] .custom-block[data-block-type="videos"] [data-lazy-load],
html[data-edit="1"] .custom-block[data-block-type="map"] .map-placeholder-btn,
html[data-edit="1"] .custom-block[data-block-type="map"] .load-map-btn,
html[data-edit="1"] .custom-block[data-block-type="map"] [data-lazy-load],
html[data-edit="1"] .custom-block[data-block-type="facebook-page"] .load-fanpage-btn,
html[data-edit="1"] .custom-block[data-block-type="facebook-page"] [data-lazy-load]{
  background:var(--pxth-button-bg) !important;
  background-color:var(--pxth-button-bg) !important;
  border-color:var(--pxth-button-bg) !important;
  color:var(--pxth-button-text) !important;
}

body:not([data-edit="1"]) .map-placeholder-btn *,
body:not([data-edit="1"]) .load-map-btn *,
body:not([data-edit="1"]) .load-fanpage-btn *,
body:not([data-edit="1"]) .load-video-btn *,
body:not([data-edit="1"]) .gallery-load-btn *,
body:not([data-edit="1"]) [data-lazy-load] *,
html[data-edit="1"] .custom-block[data-block-type="gallery"] .gallery-load-btn *,
html[data-edit="1"] .custom-block[data-block-type="videos"] .load-video-btn *,
html[data-edit="1"] .custom-block[data-block-type="map"] .load-map-btn *,
html[data-edit="1"] .custom-block[data-block-type="facebook-page"] .load-fanpage-btn *{
  color:var(--pxth-button-text) !important;
}

/* hover เฉพาะปุ่มหน้าเว็บจริง */
body:not([data-edit="1"]) .map-placeholder-btn:hover,
body:not([data-edit="1"]) .load-map-btn:hover,
body:not([data-edit="1"]) .load-fanpage-btn:hover,
body:not([data-edit="1"]) .load-video-btn:hover,
body:not([data-edit="1"]) .gallery-load-btn:hover,
body:not([data-edit="1"]) [data-lazy-load]:hover{
  filter:brightness(.94);
}

/* ===== Explicit exclusions: ปุ่มระบบ/editor/header/topbar ต้องไม่ตามสีปุ่มรวม ===== */
html[data-edit="1"] #pxth-toolbar button,
html[data-edit="1"] #pxth-toolbar a,
html[data-edit="1"] #pxth-toolbar select,
html[data-edit="1"] .topbar a,
html[data-edit="1"] .topbar button,
html[data-edit="1"] header a,
html[data-edit="1"] header button,
html[data-edit="1"] nav a,
html[data-edit="1"] nav button,
html[data-edit="1"] .pxth-custom-controls button,
html[data-edit="1"] .pxth-block-controls button,
html[data-edit="1"] [data-section-act],
html[data-edit="1"] [data-block-act],
html[data-edit="1"] .pxth-add-block,
html[data-edit="1"] .pxth-add-section-float,
html[data-edit="1"] .block-product-toolbar button,
html[data-edit="1"] .block-product-carousel-nav button,
html[data-edit="1"] .block-product-add,
html[data-edit="1"] .block-product-remove,
html[data-edit="1"] .block-gallery-tabs button,
html[data-edit="1"] .block-gallery-actions button,
html[data-edit="1"] [data-gallery-image-remove],
html[data-edit="1"] .block-video-add,
html[data-edit="1"] .block-video-dots button,
html[data-edit="1"] [data-video-slide],
html[data-edit="1"] .block-news-add,
html[data-edit="1"] [data-news-slide],
html[data-edit="1"] [data-edit-custom-map],
html[data-edit="1"] [data-edit-custom-facebook]{
  filter:none !important;
}

/* restore common editor control colors */
html[data-edit="1"] .pxth-custom-controls button,
html[data-edit="1"] .pxth-block-controls button{
  background:#6b7280 !important;
  color:#fff !important;
  border-color:rgba(255,255,255,.18) !important;
}
html[data-edit="1"] .pxth-custom-controls button:last-child,
html[data-edit="1"] .pxth-block-controls button:last-child,
html[data-edit="1"] [data-section-act="delete"],
html[data-edit="1"] [data-block-act="delete"]{
  background:#ef4444 !important;
  color:#fff !important;
  border-color:#ef4444 !important;
}
html[data-edit="1"] .pxth-add-block{
  background:#f8fafc !important;
  color:#111827 !important;
  border-color:#cbd5e1 !important;
}
html[data-edit="1"] .block-product-toolbar button,
html[data-edit="1"] .block-product-carousel-nav button,
html[data-edit="1"] .block-product-add,
html[data-edit="1"] .block-product-remove,
html[data-edit="1"] .block-gallery-tabs button,
html[data-edit="1"] .block-gallery-actions button,
html[data-edit="1"] [data-gallery-image-remove],
html[data-edit="1"] .block-video-add,
html[data-edit="1"] .block-video-dots button,
html[data-edit="1"] [data-video-slide],
html[data-edit="1"] .block-news-add,
html[data-edit="1"] [data-news-slide],
html[data-edit="1"] [data-edit-custom-map],
html[data-edit="1"] [data-edit-custom-facebook]{
  background:#fff !important;
  color:#0f172a !important;
  border-color:#cbd5e1 !important;
}
html[data-edit="1"] .block-gallery-tabs button.active,
html[data-edit="1"] .block-video-dots button.active{
  background:#0f172a !important;
  color:#fff !important;
  border-color:#0f172a !important;
}


/* PXTH GALLERY BUTTON GLOBAL COLOR FIX
   ปุ่มแกลลอรี่เป็นปุ่มหน้าเว็บจริง ต้องตามสีปุ่มรวม ไม่ใช่ปุ่มระบบ */
:root{
  --pxth-button-bg: var(--global-button-color, var(--theme-button-bg, #0f172a));
  --pxth-button-text: var(--global-button-text-color, #ffffff);
}

/* Gallery tabs / album buttons */
body .custom-block[data-block-type="gallery"] .block-gallery-tabs button,
body .custom-block[data-block-type="gallery"] .block-gallery-tabs button.active,
body .block-gallery-tabs button,
body .block-gallery-tabs button.active,
body .block-gallery-albums .block-gallery-tabs button,
body .block-gallery-albums .block-gallery-tabs button.active{
  background:var(--pxth-button-bg) !important;
  background-color:var(--pxth-button-bg) !important;
  border-color:var(--pxth-button-bg) !important;
  color:var(--pxth-button-text) !important;
  filter:none !important;
}

body .custom-block[data-block-type="gallery"] .block-gallery-tabs button *,
body .block-gallery-tabs button *{
  color:var(--pxth-button-text) !important;
}

/* Gallery load buttons also follow global button color */
body .custom-block[data-block-type="gallery"] .gallery-load-btn,
body .custom-block[data-block-type="gallery"] button[data-load-gallery],
body .block-gallery .gallery-load-btn,
body .block-gallery button[data-load-gallery]{
  background:var(--pxth-button-bg) !important;
  background-color:var(--pxth-button-bg) !important;
  border-color:var(--pxth-button-bg) !important;
  color:var(--pxth-button-text) !important;
}

body .custom-block[data-block-type="gallery"] .gallery-load-btn *,
body .custom-block[data-block-type="gallery"] button[data-load-gallery] *{
  color:var(--pxth-button-text) !important;
}

/* ปุ่มระบบของ gallery ที่ไม่ใช่หน้าเว็บจริง ยังไม่ตามสีรวม */
html[data-edit="1"] .custom-block[data-block-type="gallery"] .block-gallery-actions button,
html[data-edit="1"] .custom-block[data-block-type="gallery"] [data-gallery-delete-album],
html[data-edit="1"] .custom-block[data-block-type="gallery"] [data-gallery-image-remove],
html[data-edit="1"] .custom-block[data-block-type="gallery"] .gallery-dropzone{
  background:#fff !important;
  color:#0f172a !important;
  border-color:#cbd5e1 !important;
}


/* PXTH GALLERY ALBUM TEXT CONTRAST FIX
   แก้คำว่า "อัลบั้ม" บนปุ่มแกลลอรี่ที่ยังเป็นสีดำ */
:root{
  --pxth-button-bg: var(--global-button-color, var(--theme-button-bg, #0f172a));
  --pxth-button-text: var(--global-button-text-color, var(--pxth-button-text, #ffffff));
}

body .custom-block[data-block-type="gallery"] .block-gallery-tabs button,
body .custom-block[data-block-type="gallery"] .block-gallery-tabs button.active,
body .block-gallery-tabs button,
body .block-gallery-tabs button.active,
body .block-gallery-albums .block-gallery-tabs button,
body .block-gallery-albums .block-gallery-tabs button.active{
  background:var(--pxth-button-bg) !important;
  background-color:var(--pxth-button-bg) !important;
  border-color:var(--pxth-button-bg) !important;
  color:var(--pxth-button-text) !important;
  -webkit-text-fill-color:var(--pxth-button-text) !important;
  text-shadow:none !important;
}

/* บังคับลูกข้างในทั้งหมด เพราะบางทีคำว่าอัลบั้มอยู่ใน span/strong */
body .custom-block[data-block-type="gallery"] .block-gallery-tabs button *,
body .block-gallery-tabs button *,
body .block-gallery-albums .block-gallery-tabs button *{
  color:var(--pxth-button-text) !important;
  -webkit-text-fill-color:var(--pxth-button-text) !important;
  text-shadow:none !important;
}

/* active/focus/hover ก็ต้องไม่กลับไปดำ */
body .custom-block[data-block-type="gallery"] .block-gallery-tabs button:hover,
body .custom-block[data-block-type="gallery"] .block-gallery-tabs button:focus,
body .custom-block[data-block-type="gallery"] .block-gallery-tabs button.active:hover,
body .block-gallery-tabs button:hover,
body .block-gallery-tabs button:focus,
body .block-gallery-tabs button.active:hover{
  color:var(--pxth-button-text) !important;
  -webkit-text-fill-color:var(--pxth-button-text) !important;
}


/* PXTH VIDEO DOTS ACTIVE GLOBAL COLOR FIX
   ปุ่มเลข 1 2 3 4 ของวิดีโอ: ตัวที่เลือกต้องตามสีปุ่มรวม */
:root{
  --pxth-button-bg: var(--global-button-color, var(--theme-button-bg, #0f172a));
  --pxth-button-text: var(--global-button-text-color, var(--pxth-button-text, #ffffff));
}

/* video carousel dots / number buttons */
body .custom-block[data-block-type="videos"] .block-video-dots button.active,
body .custom-block[data-block-type="videos"] .block-video-dots button.is-active,
body .custom-block[data-block-type="videos"] .block-video-dots button[aria-selected="true"],
body .custom-block[data-block-type="videos"] .block-video-dots button.current,
body .custom-block[data-block-type="videos"] [data-video-dot].active,
body .custom-block[data-block-type="videos"] [data-video-dot].is-active,
body .block-videos .block-video-dots button.active,
body .block-videos .block-video-dots button.is-active,
body .block-videos .block-video-dots button[aria-selected="true"],
body .block-videos [data-video-dot].active,
body .block-videos [data-video-dot].is-active{
  background:var(--pxth-button-bg) !important;
  background-color:var(--pxth-button-bg) !important;
  border-color:var(--pxth-button-bg) !important;
  color:var(--pxth-button-text) !important;
  -webkit-text-fill-color:var(--pxth-button-text) !important;
  box-shadow:none !important;
  filter:none !important;
}

body .custom-block[data-block-type="videos"] .block-video-dots button.active *,
body .custom-block[data-block-type="videos"] .block-video-dots button.is-active *,
body .custom-block[data-block-type="videos"] .block-video-dots button[aria-selected="true"] *,
body .custom-block[data-block-type="videos"] [data-video-dot].active *,
body .block-videos .block-video-dots button.active *,
body .block-videos .block-video-dots button.is-active *,
body .block-videos [data-video-dot].active *{
  color:var(--pxth-button-text) !important;
  -webkit-text-fill-color:var(--pxth-button-text) !important;
}

/* video dots ที่ยังไม่เลือก ให้เป็นสีปกติ ไม่ตามสีปุ่ม */
body .custom-block[data-block-type="videos"] .block-video-dots button:not(.active):not(.is-active):not([aria-selected="true"]),
body .custom-block[data-block-type="videos"] [data-video-dot]:not(.active):not(.is-active):not([aria-selected="true"]),
body .block-videos .block-video-dots button:not(.active):not(.is-active):not([aria-selected="true"]){
  background:#fff !important;
  background-color:#fff !important;
  border-color:#cbd5e1 !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  filter:none !important;
}


/* PXTH GLOBAL TITLE H1 H2 ONLY
   สีไตเติ้ลรวมทั้งเว็บ บังคับเฉพาะ h1 และ h2 เท่านั้น */
:root{
  --pxth-title-color: var(--global-title-color, var(--theme-title, var(--pxth-global-title-color, inherit)));
}

body h1,
body h2,
section[data-section] h1,
section[data-section] h2,
.custom-section h1,
.custom-section h2,
[data-custom-section] h1,
[data-custom-section] h2,
[data-custom-html] h1,
[data-custom-html] h2,
.block-text h1,
.block-text h2{
  color:var(--pxth-title-color) !important;
}

/* ไม่ให้ h3 ชื่อสินค้า / หัวข้อย่อย ตามสีไตเติ้ล */
body h3,
body h4,
body h5,
body h6,
.custom-block[data-block-type="product"] h3,
.custom-block[data-block-type="product"] [data-field="title"],
.block-product-card h3,
.block-product-card [data-field="title"]{
  color:inherit !important;
}

/* ไม่แตะหัวข้อ/ข้อความใน toolbar และ modal ระบบ */
html[data-edit="1"] #pxth-toolbar h1,
html[data-edit="1"] #pxth-toolbar h2,
html[data-edit="1"] #pxth-toolbar h3,
html[data-edit="1"] .pxth-custom-modal h1,
html[data-edit="1"] .pxth-custom-modal h2,
html[data-edit="1"] .pxth-custom-modal h3,
html[data-edit="1"] .pxth-mini-text-modal h1,
html[data-edit="1"] .pxth-mini-text-modal h2,
html[data-edit="1"] .pxth-mini-text-modal h3{
  color:inherit !important;
}


/* PXTH HARD FORCE H1 H2 TITLE COLOR
   แก้กรณี h1/h2 ใน builder ถูก CSS/inline style เดิมทับ */
:root{
  --pxth-title-color: var(--global-title-color, var(--theme-title, var(--pxth-global-title-color, inherit)));
}

/* เฉพาะ h1/h2 เท่านั้น */
body h1,
body h2,
main h1,
main h2,
section h1,
section h2,
section[data-section] h1,
section[data-section] h2,
.custom-section h1,
.custom-section h2,
[data-custom-section] h1,
[data-custom-section] h2,
.custom-block h1,
.custom-block h2,
[data-custom-block] h1,
[data-custom-block] h2,
[data-custom-html] h1,
[data-custom-html] h2,
[contenteditable] h1,
[contenteditable] h2,
.block-text h1,
.block-text h2,
.block-contact-head h1,
.block-contact-head h2,
.block-videos h1,
.block-videos h2,
.block-news-list h1,
.block-news-list h2,
.block-gallery-albums h1,
.block-gallery-albums h2{
  color:var(--pxth-title-color) !important;
  -webkit-text-fill-color:var(--pxth-title-color) !important;
}

/* ถ้า block ใช้ div เป็น title แต่ไม่ใช่สินค้า ให้ตามสี title */
.custom-block:not([data-block-type="product"]) [data-field="title"],
.custom-block:not([data-block-type="product"]) .section-title,
.custom-block:not([data-block-type="product"]) .block-title,
.custom-block:not([data-block-type="product"]) .main-title{
  color:var(--pxth-title-color) !important;
  -webkit-text-fill-color:var(--pxth-title-color) !important;
}

/* ไม่ให้ชื่อสินค้า h3 ตามสีไตเติ้ล */
.custom-block[data-block-type="product"] h3,
.custom-block[data-block-type="product"] [data-field="title"],
.block-product-card h3,
.block-product-card [data-field="title"],
body h3,
body h4,
body h5,
body h6{
  -webkit-text-fill-color:currentColor !important;
}

/* ไม่แตะ editor toolbar/modal */
html[data-edit="1"] #pxth-toolbar h1,
html[data-edit="1"] #pxth-toolbar h2,
html[data-edit="1"] #pxth-toolbar h3,
html[data-edit="1"] .pxth-custom-modal h1,
html[data-edit="1"] .pxth-custom-modal h2,
html[data-edit="1"] .pxth-custom-modal h3,
html[data-edit="1"] .pxth-mini-text-modal h1,
html[data-edit="1"] .pxth-mini-text-modal h2,
html[data-edit="1"] .pxth-mini-text-modal h3{
  color:inherit !important;
  -webkit-text-fill-color:currentColor !important;
}




/* PXTH Product single active column setting UI */
.product-cols-single .pxth-product-cols-line{
  display:grid !important;
  grid-template-columns:120px minmax(180px,1fr) !important;
  gap:12px !important;
  align-items:center !important;
  margin:10px 0 !important;
}
.product-cols-single .pxth-product-cols-line[hidden]{
  display:none !important;
}
.product-cols-single .pxth-product-cols-line span{
  font-weight:800 !important;
  color:#334155 !important;
}
.product-cols-single .pxth-product-cols-line select{
  width:100% !important;
}
.product-cols-single .pxth-help{
  display:block !important;
  margin-top:8px !important;
  color:#64748b !important;
  font-size:12px !important;
}
@media (max-width:768px){
  .product-cols-single .pxth-product-cols-line{
    grid-template-columns:1fr !important;
    gap:6px !important;
  }
}









/* PXTH PRODUCT COLUMNS MINIMAL FIX
   คอลัมน์สินค้าใช้ data-product-view + data-product-cols เท่านั้น */

/* common */
.custom-block[data-block-type="product"] .block-products{
  position:relative !important;
  width:100% !important;
  max-width:100% !important;
}
.custom-block[data-block-type="product"] .block-product-items{
  gap:18px !important;
  width:100% !important;
  max-width:100% !important;
}
.custom-block[data-block-type="product"] .block-product-card{
  box-sizing:border-box !important;
  min-width:0 !important;
}

/* toolbar / arrows */
.custom-block[data-block-type="product"] .block-product-toolbar{
  display:flex !important;
  justify-content:flex-end !important;
  gap:8px !important;
  margin:0 0 18px auto !important;
}
.custom-block[data-block-type="product"] .block-product-toolbar [hidden]{
  display:none !important;
}
.custom-block[data-block-type="product"] .block-product-carousel-nav{
  display:none !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-toolbar{
  display:none !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-carousel-nav{
  display:flex !important;
  position:absolute !important;
  top:-58px !important;
  right:0 !important;
  gap:10px !important;
  z-index:20 !important;
}

/* GRID */
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items{
  display:grid !important;
  overflow:visible !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="4"] .block-product-items{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="5"] .block-product-items{grid-template-columns:repeat(5,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="6"] .block-product-items{grid-template-columns:repeat(6,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-card{
  width:100% !important;
  max-width:100% !important;
  display:block !important;
}

/* LIST */
.custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
  display:grid !important;
  overflow:visible !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-card{
  width:100% !important;
  max-width:100% !important;
  display:grid !important;
  grid-template-columns:150px minmax(0,1fr) !important;
  align-items:center !important;
  gap:18px !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="1"] .block-product-card{
  grid-template-columns:220px minmax(0,1fr) !important;
}

/* CAROUSEL */
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-items{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:x mandatory !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-card{
  flex-grow:0 !important;
  flex-shrink:0 !important;
  width:auto !important;
  min-width:0 !important;
  scroll-snap-align:start !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="1"] .block-product-card{flex-basis:100% !important;max-width:100% !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="2"] .block-product-card{flex-basis:calc((100% - 18px) / 2) !important;max-width:calc((100% - 18px) / 2) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="3"] .block-product-card{flex-basis:calc((100% - 36px) / 3) !important;max-width:calc((100% - 36px) / 3) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="4"] .block-product-card{flex-basis:calc((100% - 54px) / 4) !important;max-width:calc((100% - 54px) / 4) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="5"] .block-product-card{flex-basis:calc((100% - 72px) / 5) !important;max-width:calc((100% - 72px) / 5) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="6"] .block-product-card{flex-basis:calc((100% - 90px) / 6) !important;max-width:calc((100% - 90px) / 6) !important;}

/* images */
.custom-block[data-block-type="product"] .block-product-image{
  width:100% !important;
  max-width:100% !important;
  aspect-ratio:1/1 !important;
  overflow:hidden !important;
}
.custom-block[data-block-type="product"] .block-product-image img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}

/* mobile */
@media (max-width:768px){
  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
    grid-template-columns:1fr !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-card{
    grid-template-columns:110px minmax(0,1fr) !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-card{
    flex-basis:calc((100% - 12px) / 2) !important;
    max-width:calc((100% - 12px) / 2) !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="1"] .block-product-card{
    flex-basis:100% !important;
    max-width:100% !important;
  }
}


/* PXTH PRODUCT GEAR ONLY MODAL CSS */
.product-settings-only .pxth-product-cols-line{
  display:grid !important;
  grid-template-columns:120px minmax(180px,1fr) !important;
  gap:12px !important;
  align-items:center !important;
  margin:10px 0 !important;
}
.product-settings-only .pxth-product-cols-line[hidden]{
  display:none !important;
}
.product-settings-only .pxth-product-cols-line span{
  font-weight:800 !important;
  color:#334155 !important;
}
.product-settings-only .pxth-product-cols-line select{
  width:100% !important;
}
.product-settings-only .pxth-help{
  display:block !important;
  margin-top:8px !important;
  color:#64748b !important;
  font-size:12px !important;
}


/* PXTH PRODUCT GEAR CLICK EXACT FIX CSS
   ให้ปุ่มควบคุมของ Product Block คลิกได้ ไม่โดน overlay/card ทับ */
html[data-edit="1"] .custom-block[data-block-type="product"]{
  position:relative !important;
  overflow:visible !important;
}

html[data-edit="1"] .custom-block[data-block-type="product"] .pxth-block-controls,
html[data-edit="1"] .custom-block[data-block-type="product"] .pxth-custom-controls,
html[data-edit="1"] .custom-block[data-block-type="product"] [data-block-act],
html[data-edit="1"] .custom-block[data-block-type="product"] [data-block-settings],
html[data-edit="1"] .custom-block[data-block-type="product"] .pxth-block-settings,
html[data-edit="1"] .custom-block[data-block-type="product"] .block-settings,
html[data-edit="1"] .custom-block[data-block-type="product"] .custom-block-settings{
  pointer-events:auto !important;
  position:relative !important;
  z-index:99999 !important;
}

html[data-edit="1"] .custom-block[data-block-type="product"] .block-products,
html[data-edit="1"] .custom-block[data-block-type="product"] .block-product-items,
html[data-edit="1"] .custom-block[data-block-type="product"] .block-product-card{
  z-index:auto !important;
}



/* PXTH PRODUCT MODAL SAVE CLEAN REAL FIX */
.product-settings-only{
  z-index:2147483000 !important;
}
.product-settings-only .pxth-custom-panel{
  pointer-events:auto !important;
}
.product-settings-only .pxth-settings-actions{
  pointer-events:auto !important;
  position:relative !important;
  z-index:2147483002 !important;
}
.product-settings-only .product-save-btn,
.product-settings-only .pxth-settings-save{
  pointer-events:auto !important;
  cursor:pointer !important;
  position:relative !important;
  z-index:2147483003 !important;
}
.product-settings-only .pxth-product-responsive-box{
  display:grid !important;
  gap:10px !important;
  padding:12px !important;
  border:1px solid #dbe3ef !important;
  border-radius:12px !important;
  background:#fff !important;
}
.product-settings-only .pxth-product-responsive-box[hidden]{
  display:none !important;
}
.product-settings-only .pxth-product-responsive-box label{
  display:grid !important;
  grid-template-columns:110px minmax(160px,1fr) !important;
  gap:12px !important;
  align-items:center !important;
}
.product-settings-only .pxth-product-responsive-box select{
  width:100% !important;
}


/* PXTH PRODUCT RESPONSIVE COMPLETE FIX */

/* Product modal responsive UI */
.product-settings-only .pxth-product-responsive-box{
  display:grid !important;
  gap:10px !important;
  padding:12px !important;
  border:1px solid #dbe3ef !important;
  border-radius:12px !important;
  background:#fff !important;
}
.product-settings-only .pxth-product-responsive-box[hidden]{
  display:none !important;
}
.product-settings-only .pxth-product-responsive-box strong{
  font-weight:900 !important;
  color:#1f2937 !important;
}
.product-settings-only .pxth-product-responsive-box label{
  display:grid !important;
  grid-template-columns:110px minmax(160px,1fr) !important;
  gap:12px !important;
  align-items:center !important;
}
.product-settings-only .pxth-product-responsive-box label span{
  font-weight:800 !important;
  color:#475569 !important;
}
.product-settings-only .pxth-product-responsive-box select{
  width:100% !important;
}

/* Base product layout */
.custom-block[data-block-type="product"] .block-products{
  width:100% !important;
  max-width:100% !important;
  position:relative !important;
}
.custom-block[data-block-type="product"] .block-product-items{
  gap:18px !important;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}
.custom-block[data-block-type="product"] .block-product-card{
  min-width:0 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}
.custom-block[data-block-type="product"] .block-product-card h3,
.custom-block[data-block-type="product"] .block-product-card .block-product-price,
.custom-block[data-block-type="product"] .block-product-card [data-field="text"]{
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}

/* desktop grid/list */
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items,
.custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
  display:grid !important;
  grid-template-columns:repeat(var(--product-cols,4), minmax(0,1fr)) !important;
  overflow:visible !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-card{
  display:grid !important;
  grid-template-columns:150px minmax(0,1fr) !important;
  gap:18px !important;
  align-items:center !important;
  width:100% !important;
  max-width:100% !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="1"] .block-product-card{
  grid-template-columns:220px minmax(0,1fr) !important;
}

/* desktop carousel */
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-items{
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:18px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:x mandatory !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-card{
  flex:0 0 calc((100% - (18px * (var(--product-cols,4) - 1))) / var(--product-cols,4)) !important;
  max-width:calc((100% - (18px * (var(--product-cols,4) - 1))) / var(--product-cols,4)) !important;
  scroll-snap-align:start !important;
}

/* tablet */
@media (max-width:1024px){
  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items,
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
    grid-template-columns:repeat(var(--product-tablet-cols,2), minmax(0,1fr)) !important;
  }

  .custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-card{
    flex-basis:calc((100% - (18px * (var(--product-tablet-cols,2) - 1))) / var(--product-tablet-cols,2)) !important;
    max-width:calc((100% - (18px * (var(--product-tablet-cols,2) - 1))) / var(--product-tablet-cols,2)) !important;
  }

  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-card{
    grid-template-columns:130px minmax(0,1fr) !important;
  }
}

/* mobile: use saved mobile columns, default 1 to avoid squeezed text */
@media (max-width:768px){
  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items,
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
    grid-template-columns:repeat(var(--product-mobile-cols,1), minmax(0,1fr)) !important;
    gap:14px !important;
  }

  .custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-items{
    gap:12px !important;
  }

  .custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-card{
    flex-basis:calc((100% - (12px * (var(--product-mobile-cols,1) - 1))) / var(--product-mobile-cols,1)) !important;
    max-width:calc((100% - (12px * (var(--product-mobile-cols,1) - 1))) / var(--product-mobile-cols,1)) !important;
  }

  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-card{
    grid-template-columns:110px minmax(0,1fr) !important;
    gap:12px !important;
  }

  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-mobile-cols="1"] .block-product-card,
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-mobile-cols="1"] .block-product-card{
    width:100% !important;
    max-width:100% !important;
  }
}


/* PXTH PRODUCT RESPONSIVE HARD OVERRIDE
   ชุดนี้ต้องอยู่ท้ายไฟล์สุด เพื่อทับ CSS เก่าทั้งหมด */

/* base */
.custom-block[data-block-type="product"] .block-products{
  width:100% !important;
  max-width:100% !important;
  position:relative !important;
}
.custom-block[data-block-type="product"] .block-product-items{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  gap:18px !important;
}
.custom-block[data-block-type="product"] .block-product-card{
  box-sizing:border-box !important;
  min-width:0 !important;
  overflow:hidden !important;
}
.custom-block[data-block-type="product"] .block-product-card h3,
.custom-block[data-block-type="product"] .block-product-price,
.custom-block[data-block-type="product"] [data-field="text"]{
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}

/* grid/list desktop */
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items,
.custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
  display:grid !important;
  overflow:visible !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-card{
  display:grid !important;
  grid-template-columns:150px minmax(0,1fr) !important;
  gap:18px !important;
  align-items:center !important;
  width:100% !important;
  max-width:100% !important;
}

/* carousel desktop */
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-items{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  gap:18px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:x mandatory !important;
}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-card{
  flex-grow:0 !important;
  flex-shrink:0 !important;
  min-width:0 !important;
  scroll-snap-align:start !important;
}

.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="4"] .block-product-items{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="5"] .block-product-items{grid-template-columns:repeat(5,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-cols="6"] .block-product-items{grid-template-columns:repeat(6,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="1"] .block-product-card{flex:0 0 100% !important;flex-basis:100% !important;max-width:100% !important;width:100% !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="2"] .block-product-card{flex:0 0 calc((100% - 18px) / 2) !important;flex-basis:calc((100% - 18px) / 2) !important;max-width:calc((100% - 18px) / 2) !important;width:calc((100% - 18px) / 2) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="3"] .block-product-card{flex:0 0 calc((100% - 36px) / 3) !important;flex-basis:calc((100% - 36px) / 3) !important;max-width:calc((100% - 36px) / 3) !important;width:calc((100% - 36px) / 3) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="4"] .block-product-card{flex:0 0 calc((100% - 54px) / 4) !important;flex-basis:calc((100% - 54px) / 4) !important;max-width:calc((100% - 54px) / 4) !important;width:calc((100% - 54px) / 4) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="5"] .block-product-card{flex:0 0 calc((100% - 72px) / 5) !important;flex-basis:calc((100% - 72px) / 5) !important;max-width:calc((100% - 72px) / 5) !important;width:calc((100% - 72px) / 5) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-cols="6"] .block-product-card{flex:0 0 calc((100% - 90px) / 6) !important;flex-basis:calc((100% - 90px) / 6) !important;max-width:calc((100% - 90px) / 6) !important;width:calc((100% - 90px) / 6) !important;}

/* tablet exact override */
@media (max-width:1024px){
  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items,
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
    display:grid !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-items{
    display:flex !important;
    gap:18px !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-tablet-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-tablet-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-tablet-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-tablet-cols="4"] .block-product-items{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-tablet-cols="5"] .block-product-items{grid-template-columns:repeat(5,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-tablet-cols="6"] .block-product-items{grid-template-columns:repeat(6,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-tablet-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-tablet-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-tablet-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-tablet-cols="1"] .block-product-card{flex:0 0 100% !important;flex-basis:100% !important;max-width:100% !important;width:100% !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-tablet-cols="2"] .block-product-card{flex:0 0 calc((100% - 18px) / 2) !important;flex-basis:calc((100% - 18px) / 2) !important;max-width:calc((100% - 18px) / 2) !important;width:calc((100% - 18px) / 2) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-tablet-cols="3"] .block-product-card{flex:0 0 calc((100% - 36px) / 3) !important;flex-basis:calc((100% - 36px) / 3) !important;max-width:calc((100% - 36px) / 3) !important;width:calc((100% - 36px) / 3) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-tablet-cols="4"] .block-product-card{flex:0 0 calc((100% - 54px) / 4) !important;flex-basis:calc((100% - 54px) / 4) !important;max-width:calc((100% - 54px) / 4) !important;width:calc((100% - 54px) / 4) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-tablet-cols="5"] .block-product-card{flex:0 0 calc((100% - 72px) / 5) !important;flex-basis:calc((100% - 72px) / 5) !important;max-width:calc((100% - 72px) / 5) !important;width:calc((100% - 72px) / 5) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-tablet-cols="6"] .block-product-card{flex:0 0 calc((100% - 90px) / 6) !important;flex-basis:calc((100% - 90px) / 6) !important;max-width:calc((100% - 90px) / 6) !important;width:calc((100% - 90px) / 6) !important;}
}

/* mobile exact override */
@media (max-width:768px){
  .custom-block[data-block-type="product"] .block-product-items{
    gap:14px !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"] .block-product-items,
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-items{
    display:grid !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="list"] .block-product-card{
    grid-template-columns:110px minmax(0,1fr) !important;
    gap:12px !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="carousel"] .block-product-items{
    display:flex !important;
    gap:12px !important;
  }
  .custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-mobile-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-mobile-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-mobile-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-mobile-cols="4"] .block-product-items{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-mobile-cols="5"] .block-product-items{grid-template-columns:repeat(5,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="grid"][data-product-mobile-cols="6"] .block-product-items{grid-template-columns:repeat(6,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-mobile-cols="1"] .block-product-items{grid-template-columns:repeat(1,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-mobile-cols="2"] .block-product-items{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="list"][data-product-mobile-cols="3"] .block-product-items{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-mobile-cols="1"] .block-product-card{flex:0 0 100% !important;flex-basis:100% !important;max-width:100% !important;width:100% !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-mobile-cols="2"] .block-product-card{flex:0 0 calc((100% - 12px) / 2) !important;flex-basis:calc((100% - 12px) / 2) !important;max-width:calc((100% - 12px) / 2) !important;width:calc((100% - 12px) / 2) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-mobile-cols="3"] .block-product-card{flex:0 0 calc((100% - 24px) / 3) !important;flex-basis:calc((100% - 24px) / 3) !important;max-width:calc((100% - 24px) / 3) !important;width:calc((100% - 24px) / 3) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-mobile-cols="4"] .block-product-card{flex:0 0 calc((100% - 36px) / 4) !important;flex-basis:calc((100% - 36px) / 4) !important;max-width:calc((100% - 36px) / 4) !important;width:calc((100% - 36px) / 4) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-mobile-cols="5"] .block-product-card{flex:0 0 calc((100% - 48px) / 5) !important;flex-basis:calc((100% - 48px) / 5) !important;max-width:calc((100% - 48px) / 5) !important;width:calc((100% - 48px) / 5) !important;}
.custom-block[data-block-type="product"] .block-products[data-product-view="carousel"][data-product-mobile-cols="6"] .block-product-card{flex:0 0 calc((100% - 60px) / 6) !important;flex-basis:calc((100% - 60px) / 6) !important;max-width:calc((100% - 60px) / 6) !important;width:calc((100% - 60px) / 6) !important;}
}


/* PXTH News Responsive Columns */
.block-news-list{
  --news-cols:3;
  --news-mobile-cols:2;
}

@media(max-width:760px){
  .block-news-list.is-grid .block-news-items{
    grid-template-columns:repeat(var(--news-mobile-cols, 2), minmax(0,1fr)) !important;
  }
  .block-news-list.is-list .block-news-items{
    grid-template-columns:repeat(var(--news-mobile-cols, 2), minmax(0,1fr)) !important;
  }
  .block-news-list.is-list .block-news-card{
    display:block !important;
  }
  .block-news-list.is-list .block-news-card .block-news-image{
    height:auto !important;
    min-height:0 !important;
    aspect-ratio:16/9 !important;
  }
  .block-news-list.is-carousel .block-news-card{
    flex:0 0 calc((100% - (18px * (var(--news-mobile-cols, 2) - 1))) / var(--news-mobile-cols, 2)) !important;
    max-width:calc((100% - (18px * (var(--news-mobile-cols, 2) - 1))) / var(--news-mobile-cols, 2)) !important;
  }
}


/* PXTH News Container Responsive Fix
   ใช้ความกว้างจริงของ News block ไม่ใช่ความกว้าง browser */
.block-news-list{
  container-type:inline-size;
  --news-mobile-cols:2;
}

.block-news-list.is-responsive-mobile.is-grid .block-news-items,
.block-news-list.is-responsive-mobile.is-list .block-news-items{
  grid-template-columns:repeat(var(--news-mobile-cols, 2), minmax(0,1fr)) !important;
}

.block-news-list.is-responsive-mobile.is-list .block-news-card{
  display:block !important;
}

.block-news-list.is-responsive-mobile.is-list .block-news-card .block-news-image{
  height:auto !important;
  min-height:0 !important;
  aspect-ratio:16/9 !important;
}

.block-news-list.is-responsive-mobile.is-carousel .block-news-card{
  flex:0 0 calc((100% - (18px * (var(--news-mobile-cols, 2) - 1))) / var(--news-mobile-cols, 2)) !important;
  max-width:calc((100% - (18px * (var(--news-mobile-cols, 2) - 1))) / var(--news-mobile-cols, 2)) !important;
}

/* Browser container query fallback/extra override */
@container (max-width:760px){
  .block-news-list.is-grid .block-news-items,
  .block-news-list.is-list .block-news-items{
    grid-template-columns:repeat(var(--news-mobile-cols, 2), minmax(0,1fr)) !important;
  }

  .block-news-list.is-list .block-news-card{
    display:block !important;
  }

  .block-news-list.is-list .block-news-card .block-news-image{
    height:auto !important;
    min-height:0 !important;
    aspect-ratio:16/9 !important;
  }

  .block-news-list.is-carousel .block-news-card{
    flex:0 0 calc((100% - (18px * (var(--news-mobile-cols, 2) - 1))) / var(--news-mobile-cols, 2)) !important;
    max-width:calc((100% - (18px * (var(--news-mobile-cols, 2) - 1))) / var(--news-mobile-cols, 2)) !important;
  }
}

/* Exact selector for selected 1/2 columns */
.block-news-list.is-responsive-mobile[data-news-mobile-cols="1"].is-grid .block-news-items,
.block-news-list.is-responsive-mobile[data-news-mobile-cols="1"].is-list .block-news-items{
  grid-template-columns:repeat(1,minmax(0,1fr)) !important;
}

.block-news-list.is-responsive-mobile[data-news-mobile-cols="2"].is-grid .block-news-items,
.block-news-list.is-responsive-mobile[data-news-mobile-cols="2"].is-list .block-news-items{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

.block-news-list.is-responsive-mobile[data-news-mobile-cols="1"].is-carousel .block-news-card{
  flex-basis:100% !important;
  max-width:100% !important;
}

.block-news-list.is-responsive-mobile[data-news-mobile-cols="2"].is-carousel .block-news-card{
  flex-basis:calc((100% - 18px) / 2) !important;
  max-width:calc((100% - 18px) / 2) !important;
}

/* Make 2 columns readable in narrow editor */
.block-news-list.is-responsive-mobile[data-news-mobile-cols="2"] .block-news-body{
  padding:12px !important;
}

.block-news-list.is-responsive-mobile[data-news-mobile-cols="2"] .block-news-body h3{
  font-size:18px !important;
  line-height:1.25 !important;
}

.block-news-list.is-responsive-mobile[data-news-mobile-cols="2"] .block-news-desc{
  font-size:13px !important;
  line-height:1.45 !important;
}


/* PXTH auto contrast button fallback */
.block-video-dots button,
.block-news-dots button,
.block-product-dots button,
.block-video-carousel-nav button,
.block-news-carousel-nav button,
.block-product-carousel-nav button,
.block-product-toolbar button,
[data-product-view-btn],
[data-news-slide],
[data-product-slide],
[data-video-slide]{
  transition:background-color .15s ease, color .15s ease, -webkit-text-fill-color .15s ease !important;
}

.block-video-dots button *,
.block-news-dots button *,
.block-product-dots button *,
.block-video-carousel-nav button *,
.block-news-carousel-nav button *,
.block-product-carousel-nav button *,
.block-product-toolbar button *,
[data-product-view-btn] *,
[data-news-slide] *,
[data-product-slide] *,
[data-video-slide] *{
  color:inherit !important;
  -webkit-text-fill-color:inherit !important;
}


/* PXTH Clear Cache Button */
.pxth-clear-cache-btn{
  border:0 !important;
  border-radius:10px !important;
  padding:10px 13px !important;
  background:#0f172a !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  font-weight:900 !important;
  cursor:pointer !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.pxth-clear-cache-btn:hover{
  background:#1d4ed8 !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

.pxth-clear-cache-floating{
  position:fixed !important;
  right:18px !important;
  bottom:18px !important;
  z-index:2147482999 !important;
  box-shadow:0 10px 30px rgba(15,23,42,.22) !important;
}

.pxth-clear-cache-btn.is-loading{
  opacity:.75 !important;
  cursor:wait !important;
}

/* PXTH Clear Cache Notification */
.pxth-cache-toast{
  position:fixed !important;
  right:18px !important;
  top:18px !important;
  z-index:2147483000 !important;
  min-width:240px !important;
  max-width:min(420px, calc(100vw - 36px)) !important;
  padding:14px 16px !important;
  border-radius:14px !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  font-weight:900 !important;
  font-size:14px !important;
  line-height:1.4 !important;
  box-shadow:0 18px 50px rgba(15,23,42,.28) !important;
  opacity:0 !important;
  transform:translateY(-12px) !important;
  pointer-events:none !important;
  transition:opacity .18s ease, transform .18s ease !important;
}

.pxth-cache-toast.show{
  opacity:1 !important;
  transform:translateY(0) !important;
}

.pxth-cache-toast.ok{
  background:#16a34a !important;
}

.pxth-cache-toast.error{
  background:#dc2626 !important;
}


/* PXTH Clear Cache Text Color Fix
   แก้ปุ่ม Clear Cache ฟ้อนต์สีขาวกลืนกับพื้นหลังขาวบน toolbar */

/* ปุ่ม Clear Cache ที่อยู่บน toolbar */
#pxthClearCache:not(.pxth-clear-cache-floating),
[data-clear-cache]:not(.pxth-clear-cache-floating){
  background:#ffffff !important;
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:none !important;
}

/* hover บน toolbar */
#pxthClearCache:not(.pxth-clear-cache-floating):hover,
[data-clear-cache]:not(.pxth-clear-cache-floating):hover{
  background:#f1f5f9 !important;
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
}

/* ปุ่ม Clear Cache แบบลอย */
#pxthClearCache.pxth-clear-cache-floating,
[data-clear-cache].pxth-clear-cache-floating{
  background:#0f172a !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border:0 !important;
}

/* loading/done ให้ยังอ่านออก */
#pxthClearCache.is-loading,
[data-clear-cache].is-loading{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  background:#1d4ed8 !important;
}

/* กัน auto contrast ไป override ปุ่ม clear cache ผิด */
#pxthClearCache *,
[data-clear-cache] *{
  color:inherit !important;
  -webkit-text-fill-color:inherit !important;
}


/* PXTH gallery tabs position persistent fix */
.block-gallery-albums[data-gallery-tabs="top"],
.block-gallery-albums[data-gallery-tab-position="top"],
.block-gallery-albums.tabs-top{
  display:block !important;
}

.block-gallery-albums[data-gallery-tabs="left"],
.block-gallery-albums[data-gallery-tab-position="left"],
.block-gallery-albums.tabs-left{
  display:grid !important;
  grid-template-columns:180px minmax(0,1fr) !important;
  align-items:start !important;
  gap:18px !important;
}

.block-gallery-albums[data-gallery-tabs="right"],
.block-gallery-albums[data-gallery-tab-position="right"],
.block-gallery-albums.tabs-right{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 180px !important;
  align-items:start !important;
  gap:18px !important;
}

.block-gallery-albums[data-gallery-tabs="left"] .block-gallery-tabs,
.block-gallery-albums[data-gallery-tab-position="left"] .block-gallery-tabs,
.block-gallery-albums.tabs-left .block-gallery-tabs,
.block-gallery-albums[data-gallery-tabs="right"] .block-gallery-tabs,
.block-gallery-albums[data-gallery-tab-position="right"] .block-gallery-tabs,
.block-gallery-albums.tabs-right .block-gallery-tabs{
  display:flex !important;
  flex-direction:column !important;
  gap:8px !important;
  width:100% !important;
  margin:0 !important;
}

.block-gallery-albums[data-gallery-tabs="right"] .block-gallery-tabs,
.block-gallery-albums[data-gallery-tab-position="right"] .block-gallery-tabs,
.block-gallery-albums.tabs-right .block-gallery-tabs{
  grid-column:2 !important;
  grid-row:1 !important;
}

.block-gallery-albums[data-gallery-tabs="right"] .block-gallery-main,
.block-gallery-albums[data-gallery-tab-position="right"] .block-gallery-main,
.block-gallery-albums.tabs-right .block-gallery-main{
  grid-column:1 !important;
  grid-row:1 !important;
}

.block-gallery-albums[data-gallery-tabs="left"] .block-gallery-main,
.block-gallery-albums[data-gallery-tab-position="left"] .block-gallery-main,
.block-gallery-albums.tabs-left .block-gallery-main{
  grid-column:2 !important;
}

.block-gallery-albums[data-gallery-tabs="left"] .block-gallery-tabs button,
.block-gallery-albums[data-gallery-tab-position="left"] .block-gallery-tabs button,
.block-gallery-albums.tabs-left .block-gallery-tabs button,
.block-gallery-albums[data-gallery-tabs="right"] .block-gallery-tabs button,
.block-gallery-albums[data-gallery-tab-position="right"] .block-gallery-tabs button,
.block-gallery-albums.tabs-right .block-gallery-tabs button{
  width:100% !important;
  text-align:center !important;
}

@media(max-width:768px){
  .block-gallery-albums[data-gallery-tabs="left"],
  .block-gallery-albums[data-gallery-tab-position="left"],
  .block-gallery-albums.tabs-left,
  .block-gallery-albums[data-gallery-tabs="right"],
  .block-gallery-albums[data-gallery-tab-position="right"],
  .block-gallery-albums.tabs-right{
    display:block !important;
  }

  .block-gallery-albums[data-gallery-tabs="left"] .block-gallery-tabs,
  .block-gallery-albums[data-gallery-tab-position="left"] .block-gallery-tabs,
  .block-gallery-albums.tabs-left .block-gallery-tabs,
  .block-gallery-albums[data-gallery-tabs="right"] .block-gallery-tabs,
  .block-gallery-albums[data-gallery-tab-position="right"] .block-gallery-tabs,
  .block-gallery-albums.tabs-right .block-gallery-tabs{
    flex-direction:row !important;
    flex-wrap:wrap !important;
    margin-bottom:14px !important;
  }
}
