:root{--wcg-blue:#0B63CE;--wcg-blue-2:#1EA7FF;--wcg-radius:20px;--wcgcp-bg:none;--wcgcp-hero-pad:13px;--wcgcp-hero-pad-m:10px}

.wcgcp-backdrop{position:fixed;inset:0;display:none;align-items:center;justify-content:center;padding:12px;z-index:999999;background:rgba(15,23,42,.55);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.wcgcp-backdrop.is-open{display:flex}

/* Lock background scroll when modal is open */
html.wcgcp-lock,body.wcgcp-lock{overflow:hidden!important}

/* Premium modal shell (auto height by content, capped by viewport) */
.wcgcp-modal{position:relative;width:min(92vw,760px);max-height:min(92vh,860px);border-radius:var(--wcg-radius);overflow:hidden;background:linear-gradient(180deg,rgba(11,99,206,.06),rgba(255,255,255,0) 38%),#fff;border:1px solid rgba(15,23,42,.10);box-shadow:0 28px 80px rgba(0,0,0,.34);opacity:0;transform:translateY(10px) scale(.99);transition:opacity .18s ease,transform .18s ease;font-family:Kanit,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#0f172a;display:flex;flex-direction:column}
.wcgcp-modal.is-open{opacity:1;transform:none}
.wcgcp-modal.wcgcp-hasbg{background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(255,255,255,.92)),var(--wcgcp-bg);background-size:cover;background-position:center}

.wcgcp-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;background:rgba(255,255,255,.88);border-bottom:1px solid rgba(15,23,42,.08);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.wcgcp-header .wcgcp-brandrow{justify-content:flex-start}
.wcgcp-close{width:36px;height:36px;border-radius:999px;border:1px solid rgba(15,23,42,.10);background:rgba(255,255,255,.70);cursor:pointer;font-size:22px;line-height:1;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.wcgcp-close:hover{background:rgba(15,23,42,.06)}
.wcgcp-close:focus{outline:none;box-shadow:0 0 0 3px rgba(30,167,255,.28)}

.wcgcp-layout{display:flex;flex-direction:column;min-height:0;height:auto;flex:1 1 auto}
/* Give the image more visual weight (modern split layout) */
.wcgcp-modal.wcgcp-split .wcgcp-layout{grid-template-columns:.9fr 1.1fr}
/* Hero mode: keep it premium but DO NOT force tall height (auto by content) */
.wcgcp-modal.wcgcp-fullimage{max-height:min(92vh,860px)}

/* Full-image mode: allow a wider canvas so the square poster looks "เต็ม" on desktop */
@media (min-width:1024px){
  .wcgcp-modal.wcgcp-fullimage{
    width:min(96vw,920px);
    max-height:min(94vh,900px);
  }
}
/* ✅ Square Hero 1:1 (NO CROP): designed for 1040x1040 only
   Goal:
   - Hero stays 1:1 (square) on every screen.
   - Never shrink into a horizontal banner when content below is long.
   - Never crop any part of the image.
*/
.wcgcp-modal.wcgcp-fullimage .wcgcp-layout{overflow:auto}

/*
  Full-image (Hero 1:1) requirements:
  - รูปต้องแสดงเต็ม 1:1 ทั้ง PC/MB
  - ห้ามตัด/ห้ามครอป (ภาพเป็นอินโฟกราฟิก ต้องเห็นครบ)
  - ถ้าหน้าจอเตี้ย ให้เลื่อนดูส่วนรายละเอียดได้ โดยไม่บีบรูปจนกลายเป็นแบนเนอร์
*/
.wcgcp-modal.wcgcp-fullimage .wcgcp-media{
  width:100%;
  aspect-ratio:1/1;
  padding:0;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  flex-shrink:0;
  overflow:hidden;
}
.wcgcp-modal.wcgcp-fullimage .wcgcp-media--full{height:auto}
.wcgcp-modal.wcgcp-fullimage .wcgcp-media:before,
.wcgcp-modal.wcgcp-fullimage .wcgcp-media:after{display:none}
.wcgcp-modal.wcgcp-fullimage .wcgcp-hero{
  /* แสดงเต็มภาพ 100% แบบไม่ตัด/ไม่ครอป */
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
}
.wcgcp-modal.wcgcp-fullimage .wcgcp-content{background:transparent;padding:0;min-height:0}
.wcgcp-content--bar{flex:0 0 auto;padding:13px 13px 12px;background:linear-gradient(180deg,rgba(15,23,42,.04),rgba(255,255,255,.92));border-top:1px solid rgba(15,23,42,.10)}
.wcgcp-modal.wcgcp-fullimage .wcgcp-title{font-size:22px}
.wcgcp-modal.wcgcp-fullimage .wcgcp-body{max-height:none}

/* Fullimage: รายละเอียดต้องไม่ถูกตัดด้วย line-clamp */
.wcgcp-modal.wcgcp-fullimage .wcgcp-body{
  display:block;
  -webkit-line-clamp:unset;
  -webkit-box-orient:unset;
  overflow:visible;
}

/* Refine the bottom content area (match the reference: airy spacing + clear blocks) */
.wcgcp-modal.wcgcp-fullimage .wcgcp-content--bar{padding:13px}
.wcgcp-modal.wcgcp-fullimage .wcgcp-sub{margin-top:8px}
.wcgcp-modal.wcgcp-fullimage .wcgcp-body{
  margin-top:10px;
  padding:14px 14px;
  border-radius:16px;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 10px 28px rgba(2,6,23,.06);
}

/* In hero mode, footer shouldn't be sticky/overlaid */
.wcgcp-modal.wcgcp-fullimage .wcgcp-footer{
  position:static;
  padding:0;
  background:transparent;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  margin-top:12px;
}

/* Coupon row: slightly softer, with consistent height */
.wcgcp-modal.wcgcp-fullimage .wcgcp-codewrap{border-radius:16px;box-shadow:0 12px 30px rgba(2,6,23,.10)}
.wcgcp-modal.wcgcp-fullimage .wcgcp-code{padding:13px 14px}
.wcgcp-modal.wcgcp-fullimage .wcgcp-copy{padding:13px 16px}
.wcgcp-modal.wcgcp-fullimage .wcgcp-note{margin-top:6px}

@media (max-width:520px){
  /* Mobile: keep square hero full (no padding) */
  .wcgcp-modal.wcgcp-fullimage .wcgcp-media{padding:0}
  .wcgcp-codewrap{flex-direction:column}
  .wcgcp-copy{width:100%}
}

@media(max-width:860px){.wcgcp-modal{width:min(94vw,640px);max-height:92vh}}
.wcgcp-content{padding:18px;display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0;overflow:auto;background:linear-gradient(180deg,rgba(11,99,206,.07),rgba(255,255,255,0) 52%)}
.wcgcp-brandrow{display:flex;align-items:center;justify-content:flex-end;gap:10px}
.wcgcp-logo{height:26px;width:auto;object-fit:contain}
.wcgcp-badge{font-size:12px;font-weight:700;padding:6px 10px;border-radius:999px;background:rgba(11,99,206,.10);color:var(--wcg-blue);border:1px solid rgba(11,99,206,.18)}
.wcgcp-title{font-size:26px;font-weight:800;margin:0;letter-spacing:-.25px;line-height:1.12}
.wcgcp-title,.wcgcp-sub,.wcgcp-body{overflow-wrap:anywhere;word-break:break-word}
.wcgcp-title:after{content:"";display:block;width:52px;height:4px;border-radius:999px;background:linear-gradient(90deg,var(--wcg-blue),var(--wcg-blue-2));margin-top:10px;opacity:.95}
.wcgcp-sub{font-size:13px;font-weight:800;color:rgba(15,23,42,.78);display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(11,99,206,.10);border:1px solid rgba(11,99,206,.16);width:fit-content}
.wcgcp-sub:before{content:"✦";font-size:12px;color:var(--wcg-blue)}
.wcgcp-body{font-size:14px;color:rgba(15,23,42,.80);margin:0;line-height:1.6;padding:12px 14px;border-radius:14px;background:rgba(248,250,252,.94);border:1px solid rgba(15,23,42,.08);overflow:hidden;display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical}

/* Expand/collapse for long details */
.wcgcp-body.is-expanded{display:block;-webkit-line-clamp:unset;-webkit-box-orient:unset;overflow:visible}
.wcgcp-more{align-self:flex-start;border:1px solid rgba(15,23,42,.10);background:rgba(255,255,255,.72);color:rgba(15,23,42,.78);font-weight:800;font-size:12px;padding:8px 10px;border-radius:999px;cursor:pointer;display:none;gap:8px;align-items:center}
.wcgcp-more:hover{background:rgba(15,23,42,.04)}
.wcgcp-more:focus{outline:none;box-shadow:0 0 0 3px rgba(30,167,255,.22)}
.wcgcp-more .wcgcp-more-ic{font-size:12px;line-height:1}

/* Sticky footer (premium) */
.wcgcp-footer{margin-top:auto;display:flex;flex-direction:column;gap:8px;padding:12px 13px 14px;position:sticky;bottom:0;background:linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.92) 22%,rgba(255,255,255,.98));backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}

/* Input-like coupon row (match reference mock) */
.wcgcp-codewrap{display:flex;align-items:stretch;gap:0;border-radius:14px;overflow:hidden;border:1px solid rgba(15,23,42,.12);background:#fff;box-shadow:0 10px 26px rgba(2,6,23,.08)}
.wcgcp-code{flex:1 1 auto;font-weight:900;font-size:14px;letter-spacing:.6px;padding:12px 14px;color:#0f172a;background:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wcgcp-copy{border:none;cursor:pointer;font-weight:600;font-size:14px;padding:12px 16px;color:#fff;background:linear-gradient(135deg,var(--wcg-blue),var(--wcg-blue-2));box-shadow:none;white-space:nowrap;transition:transform .12s ease,filter .12s ease}
.wcgcp-copy:hover{filter:brightness(.98);transform:translateY(-1px)}
.wcgcp-copy:active{transform:translateY(0)}
.wcgcp-copy:focus{outline:none;box-shadow:0 0 0 3px rgba(30,167,255,.28),0 12px 28px rgba(11,99,206,.22)}
.wcgcp-note,.wcgcp-toast{font-size:12px;color:rgba(15,23,42,.60);min-height:16px}
/* Media (image) column */
.wcgcp-media{position:relative;background:#0b1220;display:flex;align-items:center;justify-content:center;padding:0;overflow:hidden}

/* "Looks full" without cropping: use a blurred hero background behind a contained image */
.wcgcp-media:before{content:"";position:absolute;inset:-16px;background-image:var(--wcgcp-hero-bg);background-size:cover;background-position:center;filter:blur(22px);transform:scale(1.08);opacity:.35}
.wcgcp-media:after{content:"";position:absolute;inset:0;background:radial-gradient(80% 80% at 50% 40%,rgba(255,255,255,.08),rgba(0,0,0,0) 60%)}
.wcgcp-media{overscroll-behavior:contain}
.wcgcp-modal.wcgcp-split .wcgcp-content{background:rgba(255,255,255,.90);border-right:1px solid rgba(15,23,42,.08)}

/* Keep the poster readable: always "contain" on top of a blurred background */
.wcgcp-hero{position:relative;z-index:2;display:block;object-fit:contain;border-radius:0;background:transparent;box-shadow:none;max-width:100%;max-height:100%;width:100%;height:100%}

/* Smart-fit helpers (applied by JS):
   - fit-width: make poster full-width (preferred for portrait posters), scroll vertically if needed
   - fit-height: make banner full-height
*/
/* Smart-fit classes intentionally disabled for premium modal (no internal scroll). */
.wcgcp-fit-width .wcgcp-media,.wcgcp-fit-height .wcgcp-media{overflow:hidden}
.wcgcp-fit-width .wcgcp-hero,.wcgcp-fit-height .wcgcp-hero{width:100%;height:100%;object-fit:contain}

/* In full-image mode, brand row lives in header (avoid duplicates) */
.wcgcp-modal.wcgcp-fullimage .wcgcp-content .wcgcp-brandrow{display:none}

/* Keep long notes readable */
.wcgcp-note{overflow-wrap:anywhere;word-break:break-word}

@media (prefers-reduced-motion:reduce){
  .wcgcp-modal{transition:none}
  .wcgcp-copy{transition:none}
}

/* ============================
   Confirm-before-copy overlay
   ============================ */

.wcgcp-confirm{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:30;
}

.wcgcp-confirm.is-open{display:flex}

.wcgcp-confirm:before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.55);
  backdrop-filter: blur(6px);
}

.wcgcp-confirm-card{
  position:relative;
  width:min(520px,100%);
  border-radius:18px;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 20px 60px rgba(0,0,0,.20);
  padding:22px 20px;
  animation: wcgcpConfirmIn .22s ease-out;
}

.wcgcp-confirm-title{
  font-weight:700;
  font-size:19px;
  line-height:1.45;
  color:rgba(15,23,42,.92);
  text-align:center;
}

.wcgcp-confirm-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}

.wcgcp-confirm-yes,
.wcgcp-confirm-no{
  width:100%;
  border-radius:14px;
  padding:10px 14px;
  font-weight:600;
  font-size:15px;
  line-height:1.45;
  border:1px solid rgba(15,23,42,.12);
  cursor:pointer;
}

.wcgcp-confirm-yes{
  background:linear-gradient(135deg,var(--wcg-blue),var(--wcg-blue-2));
  color:#fff;
  border-color:rgba(0,0,0,0);
}

.wcgcp-confirm-no{
  background:#fff;
  color:rgba(15,23,42,.88);
}

.wcgcp-confirm-yes:hover{filter:brightness(.98)}
.wcgcp-confirm-no:hover{background:rgba(15,23,42,.04)}

@keyframes wcgcpConfirmIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

@media (max-width:480px){
  .wcgcp-confirm-title{font-size:17px}
  .wcgcp-confirm-yes,.wcgcp-confirm-no{font-size:14px}
}

/* ============================
   Success notification overlay
   ============================ */

.wcgcp-success{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:35;
}

.wcgcp-success.is-open{display:flex}

.wcgcp-success:before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.55);
  backdrop-filter: blur(6px);
}

.wcgcp-success-card{
  position:relative;
  width:min(520px,100%);
  border-radius:18px;
  background:rgba(255,255,255,.97);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 20px 60px rgba(0,0,0,.20);
  padding:22px 20px;
  animation: wcgcpConfirmIn .22s ease-out;
}

.wcgcp-success-title{
  font-weight:700;
  font-size:19px;
  line-height:1.45;
  color:rgba(15,23,42,.92);
  text-align:center;
}

.wcgcp-success-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}

.wcgcp-success-shop,
.wcgcp-success-close{
  width:100%;
  border-radius:14px;
  padding:10px 14px;
  font-weight:600;
  font-size:15px;
  line-height:1.45;
  border:1px solid rgba(15,23,42,.12);
  cursor:pointer;
  text-align:center;
}

.wcgcp-success-shop{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  background:linear-gradient(135deg,var(--wcg-blue),var(--wcg-blue-2));
  color:#fff;
  border-color:rgba(0,0,0,0);
}

.wcgcp-success-close{
  background:#fff;
  color:rgba(15,23,42,.88);
}

.wcgcp-success-shop:hover{filter:brightness(.98)}
.wcgcp-success-close:hover{background:rgba(15,23,42,.04)}

@media (max-width:480px){
  .wcgcp-success-title{font-size:17px}
  .wcgcp-success-shop,.wcgcp-success-close{font-size:14px}
}

.wcgcp-success-shop:hover{filter:brightness(.98)}
.wcgcp-success-close:hover{background:rgba(15,23,42,.04)}

@media (max-width:480px){
  .wcgcp-success-title{font-size:18px}
  .wcgcp-success-shop,.wcgcp-success-close{font-size:15px}
}

/* ============================
   Button thickness modifiers
   ============================ */

/* Thin */
.wcgcp-btn-thin .wcgcp-copy{padding:9px 12px;font-weight:500;font-size:14px}
.wcgcp-btn-thin .wcgcp-confirm-yes,
.wcgcp-btn-thin .wcgcp-confirm-no,
.wcgcp-btn-thin .wcgcp-success-shop,
.wcgcp-btn-thin .wcgcp-success-close{padding:9px 12px;font-weight:500;font-size:14px}

/* Normal */
.wcgcp-btn-normal .wcgcp-copy{padding:12px 16px;font-weight:600;font-size:14px}
.wcgcp-btn-normal .wcgcp-confirm-yes,
.wcgcp-btn-normal .wcgcp-confirm-no,
.wcgcp-btn-normal .wcgcp-success-shop,
.wcgcp-btn-normal .wcgcp-success-close{padding:10px 14px;font-weight:600;font-size:15px}

/* Thick */
.wcgcp-btn-thick .wcgcp-copy{padding:14px 16px;font-weight:700;font-size:15px}
.wcgcp-btn-thick .wcgcp-code{padding:14px 14px}
.wcgcp-btn-thick .wcgcp-confirm-yes,
.wcgcp-btn-thick .wcgcp-confirm-no,
.wcgcp-btn-thick .wcgcp-success-shop,
.wcgcp-btn-thick .wcgcp-success-close{padding:14px 16px;font-weight:700;font-size:16px}

@media (max-width:480px){
  .wcgcp-btn-thick .wcgcp-confirm-yes,
  .wcgcp-btn-thick .wcgcp-confirm-no,
  .wcgcp-btn-thick .wcgcp-success-shop,
  .wcgcp-btn-thick .wcgcp-success-close{font-size:15px}
}
