/* ===== Just Hook It — design tokens =====
   ส้ม JHI (ไม่ใช่ส้ม Shopee เป๊ะ) + น้ำเงินทะเลลึก + ทรายอ่อน */
:root {
  /* ===== ชุดสีแบรนด์จากโลโก้ Just Hook It ===== */
  --navy:      #163A5C;   /* กรมท่า — สีหลักแบรนด์ */
  --navy-dark: #0E2A44;
  --navy-mid:  #1D4A73;
  --sky:       #7FB5DC;   /* ฟ้าน้ำทะเล */
  --sea:       #2E7DB0;   /* ฟ้าเข้ม อ่านง่าย ใช้กับลิงก์ */
  --ice:       #EAF3FA;   /* ฟ้าอ่อน พื้นหลัง/ป้าย */
  --gold:      #F2A93B;   /* เหลืองทอง — ปุ่ม action */
  --gold-dark: #DD9425;
  --price:     #E8552D;   /* แดงส้ม — ราคา/ส่วนลดเท่านั้น */
  /* alias เดิม — จุดที่ไม่ได้ระบุบทบาทจะกลายเป็นกรมท่าอัตโนมัติ */
  --jhi:      var(--navy);
  --jhi-dark: var(--navy-dark);
  --deep:     #222222;
  --sand:     #F5F5F5;
  --line:     #E8E8E8;
  --ink:      #22303C;
  --ok:       #2E7D32;
  --danger:   #C62828;
  --r: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font-family: 'Sarabun', system-ui, sans-serif; font-size: 15px; line-height: 1.55;
}
h1,h2,h3, .logo, .btn, .card-price, .pagetitle { font-family: 'Kanit', 'Sarabun', sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.inline { display: inline; }
.linklike { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.danger { color: var(--danger); }

/* ===== Top strip + header ===== */
.topstrip { background: var(--navy-dark); color: rgba(255,255,255,.9); font-size: 12.5px; }
.topstrip a { color: #fff; }
.topstrip-in { display: flex; justify-content: space-between; padding: 6px 16px; flex-wrap: wrap; gap: 8px; }
.topstrip-right { display: flex; gap: 14px; align-items: center; }

.mainbar { background: linear-gradient(-180deg, var(--navy-mid), var(--navy)); color: #fff; }
.mainbar-in { display: flex; align-items: center; gap: 34px; padding: 18px 16px 12px; }
.logo { font-size: 26px; font-weight: 700; letter-spacing: -.5px; color: #fff; white-space: nowrap; }
.logo span { color: var(--gold); }
.logo.sm { font-size: 20px; }
.searchcol { flex: 1; min-width: 0; }
.search { display: flex; background: #fff; border-radius: 4px; padding: 4px; }
.search input { flex: 1; border: 0; padding: 10px 14px; font: inherit; font-size: 15px; outline: none; min-width: 0; background: transparent; }
.search button { border: 0; background: var(--navy); color: #fff; width: 74px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.search button:hover { background: var(--navy-mid); }
.search button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.search-tags { display: flex; gap: 18px; margin-top: 8px; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; -ms-overflow-style: none; }
.search-tags::-webkit-scrollbar { display: none; }
.search-tags a { color: rgba(255,255,255,.92); font-size: 13px; flex-shrink: 0; }
.search-tags a:hover { color: var(--gold); }
.cartbtn { position: relative; display: inline-flex; padding: 4px 10px 10px; }
.cartbtn svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: -4px; right: -6px; background: #fff; color: var(--navy);
  border: 2px solid var(--navy); border-radius: 99px; font-size: 12px; padding: 0 6px; font-weight: 700; line-height: 17px; }

.catnav { background: #fff; border-bottom: 1px solid var(--line); }
.catnav-in { display: flex; gap: 4px; overflow-x: auto; }
.catnav a { padding: 11px 14px; white-space: nowrap; font-family: 'Kanit'; font-size: 14px; color: #5a6570; border-bottom: 2.5px solid transparent; }
.catnav a.on, .catnav a:hover { color: var(--navy); border-color: var(--gold); }

/* ===== Flash ===== */
.flash { margin: 12px 0; padding: 10px 14px; border-radius: var(--r); font-weight: 500; }
.flash.ok  { background: #E8F5E9; color: var(--ok); }
.flash.err { background: #FDECEA; color: var(--danger); }

/* ===== Hero ===== */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin: 18px 0; }
.hero-main { border-radius: var(--r); padding: 40px 36px; color: #fff; min-height: 220px; display: flex; align-items: center;
  background:
    radial-gradient(ellipse 120% 90% at 85% 110%, rgba(242,169,59,.4), transparent 60%),
    linear-gradient(120deg, var(--navy-dark) 10%, var(--navy) 60%, var(--navy-mid)); }
.hero-txt h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.15; }
.hero .btn { background:#fff; color:var(--navy); font-weight:600; }
.hero-txt p { margin: 0 0 18px; color: #FFE3D6; }
.hero-side { display: grid; gap: 14px; }
.hero-tile { border-radius: var(--r); padding: 20px; background: #fff; border: 1px solid var(--line); font-size: 14px; color: #5a6570; }
.hero-tile b { color: var(--deep); font-family: 'Kanit'; font-size: 17px; }
.hero-tile.alt { background: linear-gradient(120deg, #EAF3FA, #C9E2F5); border: 0; }
.hero-tile.alt b { color: var(--sea); }

/* ===== Buttons ===== */
.btn { display: inline-block; background: var(--gold); color: var(--navy); border: 0; border-radius: 6px;
  padding: 9px 22px; font-size: 15px; cursor: pointer; }
.btn:hover { background: var(--gold-dark); }
.btn.big { padding: 12px 30px; font-size: 16.5px; }
.btn.full { width: 100%; text-align: center; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.ghost.danger { color: var(--danger); border-color: var(--danger); }

/* ===== Sections & product grid ===== */
.sec { margin: 26px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 20px; color: var(--jhi); }
.sec-head a { color: var(--sea); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.grid-list { grid-template-columns: repeat(4, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(13,43,69,.10); border-color: var(--sky); }
.card-img { position: relative; aspect-ratio: 1; background: #EEF1F4; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.disc { position: absolute; top: 0; right: 0; background: var(--price); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 0 0 0 8px; }
.card-body { padding: 9px 10px 11px; }
.card-name { font-size: 13.5px; height: 2.9em; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-price { color: var(--price); font-size: 16px; margin-top: 5px; }
.card-price s { color: #9AA3AB; font-size: 12.5px; font-weight: 400; margin-left: 5px; }
.card-meta { font-size: 12px; color: #8A939B; margin-top: 3px; }

/* ===== Listing page ===== */
.listing { display: grid; grid-template-columns: 210px 1fr; gap: 18px; margin: 18px 0; }
.side { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; align-self: start; }
.side h3 { margin: 0 0 8px; font-size: 15px; color: var(--deep); }
.cattree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.cattree ul { list-style: none; padding-left: 14px; }
.cattree a { display: block; padding: 4.5px 6px; border-radius: 5px; color: #4C5660; }
.cattree a:hover { background: var(--sand); }
.cattree a.on { color: var(--navy); font-weight: 600; }
.sortbar { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 14px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }
.sortbar a { padding: 4px 12px; border-radius: 5px; color: #5a6570; }
.sortbar a.on { background: var(--jhi); color: #fff; }
.sortbar-count { margin-left: auto; color: #8A939B; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 20px 0; }
.pager a { padding: 6px 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.pager a.on { background: var(--jhi); color: #fff; border-color: var(--jhi); }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--r);
  padding: 44px; text-align: center; color: #6a7580; margin: 24px 0; }
.empty a { color: var(--jhi-dark); font-weight: 600; }

/* ===== Product detail ===== */
.pd { display: grid; grid-template-columns: 1fr 1.15fr; gap: 26px; margin: 22px 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.pd-img > img { border-radius: 8px; width: 100%; aspect-ratio: 1; object-fit: cover; background: #EEF1F4; }
.crumb { font-size: 13px; color: #8A939B; }
.pd-info h1 { font-size: 22px; margin: 6px 0; line-height: 1.3; }
.pd-meta { color: #8A939B; font-size: 13.5px; }
.pd-price { margin: 14px 0; font-family: 'Kanit'; }
.pd-price span { font-size: 30px; color: var(--price); }
.pd-price s { color: #9AA3AB; margin-left: 10px; }
.pd-form label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 14px; }
.variants { display: flex; flex-wrap: wrap; gap: 8px; }
.vopt input { display: none; }
.vopt span { display: inline-block; border: 1.5px solid var(--line); border-radius: 6px;
  padding: 7px 14px; cursor: pointer; font-size: 14px; background: #fff; }
.vopt input:checked + span { border-color: var(--navy); color: var(--navy); background: var(--ice); font-weight: 600; }
.vopt.oos span { opacity: .45; cursor: not-allowed; }
.vopt em { font-style: normal; font-size: 12px; color: var(--danger); }
.qty { width: 84px; padding: 8px; border: 1.5px solid var(--line); border-radius: 6px; font: inherit; }
.pd-form .btn { margin-top: 16px; }
.pd-ship { margin-top: 16px; background: var(--sand); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; }
.pd-desc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }

/* ===== Cart / summary ===== */
.pagetitle { font-size: 24px; color: var(--deep); margin: 20px 0 14px; }
.cartwrap, .orderwrap { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.carttable, .panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.cartrow { display: grid; grid-template-columns: 64px 1fr 90px 122px 90px 40px; gap: 12px;
  align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cartrow img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.cartrow-name small { display: block; color: #8A939B; }
.cartrow-sum { font-weight: 700; color: var(--price); }
.cart-actions { padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.keepshop { display: inline-flex; align-items: center; gap: 7px; }
.keepshop-link { display: block; text-align: center; margin-top: 10px; font-size: 14px; color: var(--sea); }
.keepshop-link:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .cart-actions { flex-direction: column-reverse; align-items: stretch; }
  .cart-actions .btn { width: 100%; justify-content: center; }
}
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: sticky; top: 14px; }
.summary h3 { margin: 0 0 10px; color: var(--deep); }
.sumrow { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.sumrow.total { border-top: 2px solid var(--jhi); margin-top: 8px; padding-top: 10px; font-size: 17px; font-family: 'Kanit'; }
.sumrow.total b { color: var(--price); }
.freeship-hint { background: var(--ice); color: var(--sea); border-radius: 6px; padding: 7px 10px; font-size: 13px; margin: 6px 0; }
.paynote { font-size: 13px; color: #6a7580; }

/* ===== Checkout / forms ===== */
.checkout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; margin-bottom: 30px; }
.panel h3 { margin: 4px 0 12px; color: var(--deep); }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formgrid label, .authbox label, .adminactions label { display: block; font-size: 13.5px; font-weight: 600; color: #4C5660; }
.formgrid input, .formgrid select, .formgrid textarea, .authbox input, .adminactions input {
  width: 100%; margin-top: 4px; padding: 9px 11px; border: 1.5px solid var(--line);
  border-radius: 6px; font: inherit; }
.formgrid input:focus, .authbox input:focus { border-color: var(--jhi); outline: none; }
/* ===== หน้าเข้าสู่ระบบผู้ขาย (seller.justhookit.shop) ===== */
.sellerlogin { background: linear-gradient(160deg, var(--navy-mid), var(--navy)); min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.slbox { background: #fff; border-radius: 14px; padding: 30px 28px 22px; width: 100%; max-width: 380px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28); text-align: center; }
.sl-logo { width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 12px; }
.slbox h1 { font-size: 21px; margin: 0; }
.sl-sub { color: #8A939B; font-size: 13.5px; margin: 4px 0 18px; }
.slbox form { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.slbox label { display: block; font-size: 13.5px; font-weight: 600; color: #4C5660; }
.slbox input { width: 100%; margin-top: 5px; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 7px; font: inherit; }
.slbox input:focus { border-color: var(--jhi); outline: none; }
.slbox .btn { margin-top: 4px; }
.sl-foot { margin: 16px 0 0; font-size: 13px; }
.sl-foot a { color: var(--sea); }
.slbox .flash { margin-bottom: 14px; text-align: left; }

.formgrid .span2 { grid-column: span 2; }
.formgrid .checks { display: flex; gap: 18px; align-items: center; font-weight: 400; }

/* ===== Order page ===== */
.orderstatus { display: inline-block; border-radius: 99px; padding: 4px 14px; font-size: 13.5px; font-weight: 600; }
.st-pending_payment { background: #FFF3E0; color: #E65100; }
.st-paid      { background: #E3F2FD; color: #1565C0; }
.st-shipped   { background: #E8F5E9; color: var(--ok); }
.st-completed { background: #ECEFF1; color: #455A64; }
.st-cancelled { background: #FDECEA; color: var(--danger); }
.qrbox { text-align: center; padding: 18px; background: var(--sand); border-radius: var(--r); margin-bottom: 14px; }
.qrbox #qrcode { display: inline-block; background: #fff; padding: 14px; border-radius: 8px; }
.qramount { font-family: 'Kanit'; font-size: 18px; margin-top: 10px; }
.slipform { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ordertable .orderrow { display: grid; grid-template-columns: 140px 1fr 100px 160px 90px; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  margin-bottom: 8px; align-items: center; }
.ordertable .orderrow:hover { border-color: var(--sky); }

/* ===== Auth ===== */
.authbox { max-width: 400px; margin: 40px auto; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px; }
.authbox h1 { margin: 0 0 16px; color: var(--deep); }
.authbox label { margin-bottom: 12px; }
.authbox .btn { margin-top: 6px; }

/* ===== Admin ===== */
.adminbody { background: #F0F2F5; }
.adminbar { background: var(--navy-dark); color: #fff; }
.adminbar-in { display: flex; align-items: center; gap: 24px; padding: 12px 16px; }
.adminbar nav { display: flex; gap: 16px; flex: 1; font-family: 'Kanit'; font-size: 14.5px; }
.adminbar a { color: #C9D8E6; } .adminbar a:hover { color: #fff; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: var(--r); padding: 16px; border: 1px solid var(--line); }
.stat small { color: #8A939B; } .stat b { display: block; font-size: 26px; font-family: 'Kanit'; color: var(--deep); }
.stat.hot b { color: var(--price); }
.admincols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.admincols .orderrow { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.admintable { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; font-size: 14px; }
.admintable th { background: var(--navy); color: #fff; text-align: left; padding: 9px 12px; font-family: 'Kanit'; font-weight: 500; }
.admintable td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.admintable input { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.tag { background: var(--ice); color: var(--navy); border-radius: 4px; font-size: 11.5px; padding: 2px 6px; margin-left: 6px; }
.adminactions { margin-top: 14px; display: grid; gap: 10px; }
.slipimg { max-width: 260px; border-radius: 8px; border: 1px solid var(--line); }

/* ===== Footer ===== */
.foot { background: var(--navy-dark); color: #C9D8E6; margin-top: 40px; font-size: 13.5px; }
.foot-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 26px 16px; }
.foot b { color: #fff; font-family: 'Kanit'; }
.foot a { color: #C9D8E6; text-decoration: underline; }
.foot-tag { text-align: center; padding: 12px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid-list { grid-template-columns: repeat(3, 1fr); }
  .hero, .pd, .cartwrap, .orderwrap, .checkout, .admincols { grid-template-columns: 1fr; }
  .listing { grid-template-columns: 1fr; }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  .cartrow { grid-template-columns: 52px 1fr 112px 70px; }
  .cartrow-price { display: none; }
  .cartrow .stepper button { display: inline-block; }
  .cartrow > .linklike.danger { display: inline-block; grid-column: 2 / 5; justify-self: end; padding: 2px 0 6px; }
}
@media (max-width: 560px) {
  .grid, .grid-list { grid-template-columns: repeat(2, 1fr); }
}


/* ===== Stepper จำนวนสินค้า ===== */
.stepper { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.stepper button { width: 38px; border: 0; background: #fff; font-size: 19px; cursor: pointer; color: #555; line-height: 1; }
.stepper button:hover { background: var(--ice); color: var(--navy); }
.stepper .qty { width: 52px; border: 0; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line);
  border-radius: 0; text-align: center; -moz-appearance: textfield; }
.stepper .qty::-webkit-outer-spin-button, .stepper .qty::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ===== แกลเลอรีสินค้า ===== */
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs .thumb { width: 76px; height: 76px; flex: 0 0 76px; object-fit: cover;
  border: 2px solid var(--line); border-radius: 4px; cursor: pointer; background: #EEF1F4; padding: 0; }
.thumbs .thumb.on, .thumbs .thumb:hover { border-color: var(--price); }
.vthumb { display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
  background-size: cover; background-position: center; text-shadow: 0 0 6px rgba(0,0,0,.8); }
#videobox iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; }

/* ===== หน้า account แบบ Shopee ===== */
.acc-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 18px; margin: 20px 0 30px; align-items: start; }
.acc-side { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.acc-user { display: flex; gap: 10px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.acc-user a { color: #888; font-size: 12.5px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #D6E7F4; }
.avatar.big { width: 84px; height: 84px; }
.avatar.mini { width: 22px; height: 22px; vertical-align: -6px; border: 1.5px solid rgba(255,255,255,.7); }
.topuser { display: inline-flex; gap: 6px; align-items: center; }
.acc-nav { display: flex; flex-direction: column; margin-top: 8px; }
.acc-nav a { padding: 9px 8px; border-radius: 6px; font-size: 14.5px; color: #444; }
.acc-nav a:hover { background: var(--sand); }
.acc-nav a.on { color: var(--jhi); font-weight: 600; }

/* ===== หน้าแรกบัญชี (Account Hub) แบบ Shopee ===== */
.acc-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hub-user { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px; }
.hub-user .avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: none; }
.hub-user-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hub-user-txt b { font-size: 16px; }
.hub-user-txt small { color: #8A939B; font-size: 12.5px; }
.hub-edit { color: var(--sea); font-size: 13px; white-space: nowrap; }

.hub-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hub-head b { font-size: 15px; }
.hub-head a { color: #8A939B; font-size: 13px; }
.hub-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding-top: 14px; }
.hub-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  font-size: 12.5px; color: #555; }
.hub-tile:hover { color: var(--jhi); }
.hub-ico { position: relative; display: inline-flex; }
.hub-ico svg { width: 30px; height: 30px; }
.hub-badge { position: absolute; top: -6px; right: -10px; background: var(--price); color: #fff;
  font-style: normal; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px; }

.hub-links { padding: 4px 16px; }
.hub-links a { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; font-size: 14.5px; color: #333; border-bottom: 1px solid var(--line); }
.hub-links a:last-child { border-bottom: 0; }
.hub-links i { font-style: normal; color: #C3CAD1; }

.hub-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 2px 2px; }
.hub-sec h3 { margin: 0; font-size: 16px; }
.hub-sec a { color: var(--sea); font-size: 13.5px; }
.acc-main .grid { grid-template-columns: repeat(4, 1fr); }
.acc-logout { margin-top: 2px; }
.acc-logout button { width: 100%; text-align: left; padding: 9px 8px; border: 0; background: none;
  border-radius: 6px; font: inherit; font-size: 14.5px; color: #D64045; cursor: pointer; }
.acc-logout button:hover { background: #FDF1F1; }
@media (max-width: 760px) {
  .acc-logout { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
  .acc-logout button { text-align: center; background: #FDF6F6; border: 1px solid #F0C2C4; font-weight: 600; }
}
.acc-profile label, .acc-pass label { display: block; font-size: 13.5px; font-weight: 600; color: #4C5660; margin-bottom: 12px; max-width: 420px; }
.acc-profile input:not([type=file]), .acc-pass input { width: 100%; margin-top: 4px; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 6px; font: inherit; }
.acc-profile input:disabled { background: var(--sand); color: #888; }
.acc-avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acc-avatar-edit .btn.ghost { cursor: pointer; }

/* ===== รูปสินค้าใน admin ===== */
.imggrid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.imgcell { border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-align: center; font-size: 12.5px; background:#fff; }
.imgcell img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; }

@media (max-width: 900px) {
  .acc-wrap { grid-template-columns: 1fr; }
  .acc-nav { flex-direction: row; overflow-x: auto; }
  .acc-nav a { white-space: nowrap; }
}

/* stepper ในตะกร้า: กะทัดรัดพอดีช่อง */
.cartrow .stepper button { width: 30px; font-size: 17px; }
.cartrow .stepper .qty { width: 42px; }

/* รูปพรีวิวในตัวเลือกสินค้า */
.vopt .vimg { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; vertical-align: -7px; margin-right: 6px; }
/* รูปในรายละเอียดสินค้าแบบ Shopee */
.detailimg { width: 100%; max-width: 860px; margin: 10px auto 0; display: block; border-radius: 8px; }
/* ส่วนลดค่าส่ง */
.sumrow.discount { color: #26AA99; }
.sumrow.discount b { color: #26AA99; }
/* ช่องรูปตัวเลือกใน admin */
.vimgcell img { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; display: block; margin-bottom: 4px; }
.vimgcell input[type=file] { font-size: 11.5px; border: 0; padding: 0; }

/* โลโก้จริง */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logoimg { width: 46px; height: 46px; border-radius: 50%; background: #fff; padding: 1px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }

/* ===== Timeline สถานะแบบ Shopee ===== */
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: 18px 0 0; flex-wrap: wrap; }
.order-back { color: #555; }
.order-head-right { font-size: 14px; color: #333; }
.order-head-right .sep { color: var(--line); margin: 0 8px; }
.order-head-status { color: var(--sea); font-weight: 600; }
.timeline { display: flex; align-items: flex-start; background: #fff; border: 1px solid var(--line);
  border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 26px 18px 20px; margin-bottom: 16px; overflow-x: auto; }
.tl-step { flex: 0 0 auto; width: 118px; text-align: center; }
.tl-icon { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 24px; border: 3px solid #CFCFCF; background: #fff; filter: grayscale(1); opacity: .55; }
.tl-step.done .tl-icon { border-color: #26AA99; filter: none; opacity: 1; }
.tl-label { font-size: 13px; line-height: 1.35; color: #666; }
.tl-step.done .tl-label { color: #222; font-weight: 500; }
.tl-date { font-size: 11.5px; color: #999; margin-top: 3px; }
.tl-line { flex: 1 1 40px; min-width: 24px; height: 3px; background: #CFCFCF; margin-top: 27px; }
.tl-line.done { background: #26AA99; }

/* ===== ตารางสรุปคำสั่งซื้อแบบ Shopee ===== */
.ordersum { margin-top: 12px; border-top: 1px solid var(--line); }
.osrow { display: flex; justify-content: space-between; align-items: center; padding: 10px 0;
  border-bottom: 1px dashed var(--line); font-size: 14px; }
.osrow span { color: #757575; }
.osrow.discount b { color: #26AA99; }
.osrow.grand b { color: var(--price); font-size: 22px; font-family: 'Kanit'; }
@media (max-width: 560px) {
  .tl-step { width: 96px; }
  .logoimg { width: 38px; height: 38px; }
}

/* ===== ตะกร้าแบบ Shopee ===== */
.cart-thead { display: grid; grid-template-columns: 1fr 110px 150px 110px 60px; gap: 12px;
  padding: 4px 0 12px; border-bottom: 2px solid var(--line); font-size: 13.5px; color: #888; }
.cart-thead span:not(:first-child) { text-align: center; }
.shoptable .cartrow { grid-template-columns: 1fr 110px 150px 110px 60px; }
.cartrow-prod { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cartrow-prod img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.cartrow-price, .cartrow-sum { text-align: center; }
.cartrow-qty { text-align: center; }
.stockleft { display: block; color: var(--price); font-size: 11.5px; margin-top: 4px; }
.shoptable .cartrow button.linklike { justify-self: center; }

/* กล่องโค้ดส่วนลด */
.couponbox { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-top: 12px; }
.coupon-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.coupon-form span { color: var(--sea); font-weight: 600; }
.coupon-form input { padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 6px; font: inherit; width: 180px; }
.coupon-applied { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: #26AA99; }

@media (max-width: 900px) {
  .cart-thead { display: none; }
  .shoptable .cartrow { grid-template-columns: 1fr 130px 60px; }
  .cartrow-price { display: none; }
  .cartrow-sum { text-align: right; }
}

/* ===== การซื้อของฉัน แบบ Shopee ===== */
.ordertabs { display: flex; background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  overflow-x: auto; margin-bottom: 12px; }
.ordertabs a { flex: 1 0 auto; text-align: center; padding: 12px 16px; font-size: 14.5px; color: #555;
  border-bottom: 2.5px solid transparent; white-space: nowrap; }
.ordertabs a.on { color: var(--jhi); border-color: var(--jhi); font-weight: 600; }
.ordercard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.ordercard-head { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line); }
.ordercard-items { display: block; }
.ocitem { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px dashed var(--line); }
.ocitem img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: 0 0 auto; }
.ocitem-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ocitem-name small { color: #999; font-size: 12.5px; }
.ocitem-price { color: var(--price); font-weight: 600; }
.ordercard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 16px 0; color: #999; font-size: 12.5px; }
.ordercard-total { font-size: 14px; color: #333; }
.ordercard-total b { color: var(--price); font-size: 19px; font-family: 'Kanit'; }
.ordercard-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 16px 14px; flex-wrap: wrap; }

/* หน้าออเดอร์มีเมนูข้าง */
.orderpage { margin-top: 0; }
.orderpage-main { min-width: 0; }
.orderpage .order-head { margin-top: 20px; }
.order-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 14px; flex-wrap: wrap; }

/* รูปสินค้าในตาราง admin */
.pthumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* จัดการหมวดหมู่ */
.catrow { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.catrow input, .catrow select { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.catrow-name { flex: 1; min-width: 140px; }
.catrow-name.sub { margin-left: 22px; }
.catrow-sort { width: 62px; }
.catrow-count { color: #999; font-size: 12.5px; white-space: nowrap; }
.btn.sm { padding: 5px 13px; font-size: 13.5px; }

/* ข้อมูลของฉัน แบบ Shopee */
.profile2 { display: grid; grid-template-columns: 1fr 220px; gap: 26px; }
.profile2-fields { border-right: 1px solid var(--line); padding-right: 26px; }
.prow { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; margin-bottom: 15px; }
.prow > span { text-align: right; color: #757575; font-size: 14px; }
.prow input:not([type=radio]) { width: 100%; max-width: 340px; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 6px; font: inherit; }
.pgender { display: flex; gap: 18px; }
.pgender label { display: flex; gap: 6px; align-items: center; }
.profile2-avatar { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 8px; }
.profile2-avatar small { color: #999; font-size: 12.5px; }
.profile2-avatar .btn.ghost { cursor: pointer; }

/* สมุดที่อยู่ */
.addrrow { display: flex; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.addr-phone { color: #999; font-size: 13.5px; }
.addr-text { color: #555; font-size: 14px; margin: 4px 0 6px; }
.addrrow-actions { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.addrrow-actions a { color: var(--sea); font-size: 14px; }

/* Dropdown มุมขวาบน */
.usermenu { position: relative; display: inline-block; }
.usermenu-drop { display: none; position: absolute; right: 0; top: 100%; z-index: 60; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.14); min-width: 168px; padding: 6px 0; }
.usermenu:hover .usermenu-drop, .usermenu:focus-within .usermenu-drop { display: block; }
.usermenu-drop a, .usermenu-drop button { display: block; width: 100%; text-align: left; padding: 9px 16px;
  color: #333 !important; font-size: 14px; text-decoration: none; }
.usermenu-drop a:hover, .usermenu-drop button:hover { background: var(--sand); color: var(--jhi) !important; }
.usermenu-drop form { margin: 0; }

@media (max-width: 900px) {
  .profile2 { grid-template-columns: 1fr; }
  .profile2-fields { border-right: 0; padding-right: 0; }
  .prow { grid-template-columns: 1fr; gap: 4px; }
  .prow > span { text-align: left; }
}

/* ตัวเลขในแท็บ */
.tabnum { color: var(--jhi); font-weight: 600; }

/* ฟอร์มยกเลิกพร้อมเหตุผล */
.cancelbox summary { list-style: none; cursor: pointer; display: inline-block; }
.cancelbox summary::-webkit-details-marker { display: none; }
.cancelform { background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin-top: 10px; display: grid; gap: 9px; max-width: 440px; text-align: left; }
.cancelform label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.cancelform input[name=cancel_reason_other] { padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 6px; font: inherit; }
.cancel-reason { color: var(--danger); font-size: 14px; background: #FDECEA; border-radius: 6px; padding: 8px 12px; display: inline-block; }

/* แบนเนอร์แบบมีรูปพื้นหลัง */
.hero-main.hasimg { background-size: cover !important; background-position: center; }

/* Autofill ที่อยู่ */
.addr-suggest { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 70;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.14);
  max-height: 260px; overflow-y: auto; }
.addr-suggest button { display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 13px; font: inherit; font-size: 13.5px; cursor: pointer; }
.addr-suggest button:hover { background: var(--ice); color: var(--navy); }
.formgrid label { position: relative; }

/* ===== v9 ===== */
/* ไอคอน social แถบบน */
.socials { display: inline-flex; gap: 9px; align-items: center; }
.socials a { display: inline-flex; color: #fff; opacity: .9; }
.socials a:hover { opacity: 1; }

/* หน้าออเดอร์: ที่อยู่จัดส่งแบบ Shopee */
.shipaddr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.shipaddr-mode { color: #999; font-size: 13px; }
.shipaddr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.shipaddr-track { border-left: 1px solid var(--line); padding-left: 18px; font-size: 14px; }
.muted { color: #999; }
.editaddr-link { color: var(--sea); margin-left: 8px; }
.addr-updated { color: var(--sea); }
.addrpick { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.addrpick form { display: grid; gap: 8px; }
.addrpick-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border: 1.5px solid var(--line);
  border-radius: 8px; cursor: pointer; font-size: 14px; }
.addrpick-row:has(input:checked) { border-color: var(--navy); background: var(--ice); }
.addrpick-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ตารางสรุปแบบ Shopee (label ขวา) */
.ordersum2 { margin-top: 14px; border-top: 1px solid var(--line); }
.osrow2 { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 12px 0;
  border-bottom: 1px dashed var(--line); font-size: 14px; align-items: center; }
.osrow2 span { text-align: right; color: #757575; }
.osrow2 b { min-width: 110px; text-align: right; }
.osrow2.discount b { color: #26AA99; }
.osrow2.grand b { color: var(--price); font-size: 24px; font-family: 'Kanit'; }

/* Business Insights */
.insights { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.metric { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.metric small { color: #888; display: block; }
.metric b { font-size: 22px; font-family: 'Kanit'; color: var(--deep); display: block; margin: 2px 0; }
.metric .chg { font-size: 12.5px; color: #999; }
.metric .chg.up { color: #26AA99; }
.metric .chg.down { color: var(--danger); }
.chartwrap svg { width: 100%; height: 150px; display: block; }
.chartlabels { display: flex; justify-content: space-between; font-size: 11.5px; color: #999; padding: 0 2px; }

/* Banner carousel */
.carousel { position: relative; border-radius: var(--r); overflow: hidden; min-height: 220px; height: 100%; background: #EEF1F4; }
.carousel-track, .carousel-slide.on { height: 100%; }
.carousel-slide { display: none; }
.carousel-slide.on { display: block; }
.carousel-slide img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block; }
.carousel-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 7px; }
.carousel-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; }
.carousel-dots button.on { background: var(--gold); }

/* แถวแบนเนอร์ใน admin */
.bannerrow { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.bannerrow img { width: 150px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: 0 0 auto; }
.bannerrow-fields { flex: 1; display: grid; gap: 7px; }
.bannerrow-fields input[name=link_url] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.bannerrow-ctl { display: flex; gap: 12px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.bannerrow-ctl input[type=number] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; }

/* หมวดหมู่แบบ Shopee */
.cattable td { vertical-align: middle; }
.cattable-name { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.cattable-name.sub { padding-left: 34px; }
.cattable-name input[name=name] { min-width: 150px; }
.catimg { position: relative; cursor: pointer; }
.catimg img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.catimg .imgdot { position: absolute; top: -6px; right: -6px; color: var(--jhi); }
.cattable-act { white-space: nowrap; }
.cattable-act button { margin-right: 10px; }

/* สวิตช์เปิด/ปิดแบบ Shopee */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #CCC; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: #26AA99; }
.switch input:checked + span::after { left: 21px; }

@media (max-width: 900px) {
  .insights { grid-template-columns: repeat(2, 1fr); }
  .shipaddr-cols { grid-template-columns: 1fr; }
  .shipaddr-track { border-left: 0; padding-left: 0; border-top: 1px dashed var(--line); padding-top: 10px; }
}

/* โลโก้ขาวแบบ Shopee: ไม่มีพื้นวงกลม วางบนส้มตรงๆ */
.logoimg.white { background: transparent; padding: 0; box-shadow: none; border-radius: 0; width: 52px; height: 52px; }

/* ===== v10 ===== */
/* โลโก้ใหญ่ ไม่มีตัวหนังสือ */
.logoimg.white.big { width: 82px; height: 82px; }
@media (max-width: 560px) { .logoimg.white.big { width: 54px; height: 54px; } }

/* Admin sidebar ซ้ายแบบ Seller Centre */
.adminshell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }
.adminside { background: #fff; border-right: 1px solid var(--line); padding: 14px 0 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.adminbrand { display: flex; gap: 9px; align-items: center; font-family: 'Kanit'; font-size: 17px;
  color: var(--jhi); padding: 4px 18px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.adminbrand img { width: 34px; height: 34px; border-radius: 50%; }
.adminnav { display: flex; flex-direction: column; }
.adminnav b { padding: 12px 18px 5px; font-size: 12.5px; color: #999; font-weight: 600; }
.adminnav .navitem { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 14px;
  color: #333; text-align: left; text-decoration: none; width: 100%; background: none; border: 0;
  font-family: inherit; cursor: pointer; border-right: 3px solid transparent; }
.adminnav .navico { width: 18px; height: 18px; flex: none; color: #8A97A6; }
.adminnav .navitem > span:first-of-type { flex: 1; min-width: 0; }
.adminnav .navitem:hover { color: var(--jhi); background: #F7F9FB; }
.adminnav .navitem:hover .navico { color: var(--jhi); }
.adminnav .navitem.on { color: var(--jhi); font-weight: 600; background: var(--ice); border-right-color: var(--navy); }
.adminnav .navitem.on .navico { color: var(--jhi); }
.adminnav .navext { color: #A9B4C0; font-size: 12px; }
.navlogout { margin-top: 4px; }
.adminnav .navout { color: #D64045; }
.adminnav .navout .navico { color: #D64045; }
.adminnav .navout:hover { color: #B02A2F; background: #FDF1F1; }
.adminnav .navout:hover .navico { color: #B02A2F; }
.adminmain { padding: 20px 26px 40px; min-width: 0; }
.adminbody { background: var(--sand); }
@media (max-width: 900px) {
  .adminshell { grid-template-columns: 1fr; }
  .adminside { position: static; height: auto; padding: 10px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .adminnav { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 4px; padding: 0 8px; }
  .adminnav b { display: none; }
  .adminnav .navitem { width: auto; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .adminnav .navitem.on { border-color: var(--navy); }
  .adminnav .navext { display: none; }
  .navlogout { margin: 0; }
  .adminnav .navout { border-color: #F0C2C4; background: #FDF6F6; font-weight: 600; }
  .adminmain { padding: 14px; }
}

/* กรอบ crop แบนเนอร์ (สัดส่วน 3:1 = 1200x400) */
.cropbox { width: 100%; max-width: 560px; aspect-ratio: 1200 / 516; overflow: hidden; position: relative;
  border: 2px dashed var(--jhi); border-radius: 8px; background: #EEF1F4; cursor: grab; touch-action: none; margin-top: 12px; }
.cropbox:active { cursor: grabbing; }
.cropbox img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; pointer-events: none; }
.cropctl { display: flex; gap: 14px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cropctl input[type=range] { width: 180px; vertical-align: middle; }
.cropctl small { color: #999; }

/* กล่องเล็กแบบรูป */
.hero-tile.imgtile { padding: 0; overflow: hidden; border: 0; }
.hero-tile.imgtile img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 100px; aspect-ratio: 800 / 330; }
/* กรอบ crop กล่องเล็ก 800x330 */
.cropbox.tile { aspect-ratio: 800 / 330; max-width: 420px; }
.tileblock { border-top: 1px dashed var(--line); padding: 12px 0; }
.tileblock > b { display: block; margin-bottom: 4px; }

/* ===== PWA: ป้ายชวนติดตั้งแอป ===== */
.pwabar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 200; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; max-width: 480px; margin: 0 auto;
  animation: pwaup .3s ease; }
@keyframes pwaup { from { transform: translateY(80px); opacity: 0; } to { transform: none; opacity: 1; } }
.pwabar img { width: 46px; height: 46px; border-radius: 11px; flex: 0 0 auto; }
.pwabar-txt { flex: 1; font-size: 13.5px; color: #555; line-height: 1.4; }
.pwabar-txt b { color: var(--deep); font-size: 14.5px; }
.pwabar-btn { background: var(--gold); color: var(--navy); border: 0; border-radius: 8px; padding: 9px 18px;
  font: inherit; font-weight: 600; cursor: pointer; }
.pwabar-x { background: none; border: 0; color: #999; font-size: 15px; cursor: pointer; padding: 4px; align-self: flex-start; }

/* ===== Mobile App Mode: หน้าตาแบบแอปจริง ===== */
.bottomnav { display: none; }

@media (max-width: 760px) {
  /* --- header กะทัดรัด: โลโก้+ค้นหา แถวเดียว --- */
  .topstrip { display: none; }                       /* ซ่อนแถบบนสุด ประหยัดพื้นที่ */
  .mainbar-in { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 9px 0; }
  .logoimg.white.big { width: 42px; height: 42px; }
  .searchcol { margin: 0; }
  .search input { padding: 10px 13px; font-size: 14.5px; }
  .search button { width: 50px; }
  .cartbtn { display: none; }                        /* ตะกร้าย้ายไปแถบล่าง */
  .catnav-in { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .catnav a { white-space: nowrap; }

  /* --- แถบเมนูล่างแบบแอป Shopee --- */
  .bottomnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 150; background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 7px; font-size: 11.5px; color: #7a7a7a; position: relative; text-decoration: none; }
  .bottomnav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round; }
  .bottomnav a.on { color: var(--jhi); font-weight: 600; }
  .bn-badge { position: absolute; top: 3px; left: calc(50% + 7px); background: var(--price); color: #fff;
    font-size: 10.5px; min-width: 17px; height: 17px; border-radius: 99px; display: flex;
    align-items: center; justify-content: center; padding: 0 4px; font-weight: 600; }
  body { padding-bottom: 64px; }                     /* กันเนื้อหาโดนแถบล่างบัง */
  .pwabar { bottom: 72px; }                          /* ป้ายติดตั้งลอยเหนือแถบล่าง */
  .foot { padding-bottom: 20px; }
}

/* ===== Mobile Portrait Polish: ทุกอย่างพอดีจอ ไม่ต้องปัดดูข้อมูลล้น ===== */
@media (max-width: 760px) {
  html { font-size: 15px; }
  html, body { overflow-x: hidden; max-width: 100vw; }   /* กันทั้งหน้าเลื่อนซ้าย-ขวา */
  .wrap { padding: 0 10px; }

  /* แถบเลื่อนแนวนอน: เลื่อนได้แต่ซ่อน scrollbar ให้เนียนแบบแอป */
  .catnav-in, .ordertabs, .acc-nav, .timeline, .bannerrow-ctl {
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .catnav-in::-webkit-scrollbar, .ordertabs::-webkit-scrollbar,
  .acc-nav::-webkit-scrollbar, .timeline::-webkit-scrollbar { display: none; }

  /* เมนูหมวดกะทัดรัด */
  .catnav a { padding: 10px 11px; font-size: 13.5px; }

  /* หัวข้อ/การ์ดสินค้า */
  .pagetitle { font-size: 19px; margin: 14px 0 10px; }
  .sec-head h2 { font-size: 17px; }
  .card-name { font-size: 13px; }
  .card-price { font-size: 15.5px; }

  /* แท็บการซื้อของฉัน: เล็กลง เลื่อนลื่นๆ */
  .ordertabs { justify-content: flex-start; }
  .ordertabs a { padding: 10px 12px; font-size: 13px; flex: 0 0 auto; }

  /* ชื่อสินค้าในการ์ดออเดอร์: ตัด 2 บรรทัด ไม่ดันจอ */
  .ocitem { padding: 10px 12px; gap: 10px; }
  .ocitem img { width: 54px; height: 54px; }
  .ocitem-name { overflow: hidden; }
  .ocitem-name > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 13.5px; line-height: 1.35; }
  .ocitem-name small { font-size: 11.5px; }
  .ocitem-price { font-size: 13.5px; white-space: nowrap; }
  .ordercard-head { padding: 9px 12px; font-size: 13.5px; flex-wrap: wrap; }
  .ordercard-foot, .ordercard-actions { padding-left: 12px; padding-right: 12px; }
  .ordercard-total b { font-size: 17px; }
  .ordercard-actions .btn { padding: 8px 14px; font-size: 13.5px; }
  .orderstatus { font-size: 12px; padding: 3px 9px; }

  /* เมนูบัญชี (แถวแนวนอนบนมือถือ) */
  .acc-nav a { padding: 8px 10px; font-size: 13px; }
  /* หน้ารายละเอียดคำสั่งซื้อ: การ์ดโปรไฟล์เป็นของเดสก์ท็อป บนมือถือกินที่เปล่า ๆ */
  .orderpage .acc-side { display: none; }
  /* โซนบัญชี: เมนูย้ายไปอยู่ในไอคอนเฟืองและไทล์บนหน้าแล้ว */
  .accpage .acc-side { display: none; }
  .accpage .acc-wrap { gap: 0; margin-top: 12px; }
  .hub-user { padding: 12px 14px; }
  .hub-card { padding: 12px 14px; }
  .hub-links { padding: 2px 14px; }
  .hub-tiles { gap: 2px; }
  .hub-tile { font-size: 11.5px; }
  .hub-ico svg { width: 27px; height: 27px; }
  .hub-sec { margin-top: 14px; }
  .acc-user { gap: 8px; }
  .avatar { width: 42px; height: 42px; }

  /* timeline สถานะ: ย่อวงให้ 3 ขั้นพอดีจอ ไม่ต้องเลื่อน */
  .timeline { padding: 18px 8px 14px; }
  .tl-step { width: 30vw; max-width: 108px; }
  .tl-icon { width: 46px; height: 46px; font-size: 19px; border-width: 2.5px; margin-bottom: 6px; }
  .tl-label { font-size: 11.5px; }
  .tl-date { font-size: 10.5px; }
  .tl-line { margin-top: 22px; min-width: 12px; }

  /* หน้าออเดอร์/สรุป */
  .order-head { padding: 10px 12px; font-size: 13px; }
  .order-head-right { font-size: 12.5px; }
  .osrow2 { padding: 10px 0; font-size: 13.5px; gap: 12px; }
  .osrow2.grand b { font-size: 20px; }
  .osrow2 b { min-width: 84px; }
  .shipaddr-cols { gap: 10px; }
  .panel { padding: 14px 12px; }

  /* ตะกร้า */
  .cartrow-name a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; }
  .stepper button { width: 34px; }
  .stepper .qty { width: 40px; }
  .summary { position: static; }
  .sumrow { font-size: 13.5px; }
  .coupon-form input { width: 130px; }

  /* ฟอร์ม/ปุ่มทั่วไป */
  .formgrid { grid-template-columns: 1fr; }
  .btn.big { padding: 12px 18px; font-size: 15px; }
  .flash { font-size: 13.5px; padding: 10px 12px; }

  /* หน้าแรก: แบนเนอร์+กล่องเรียงลงพอดีจอ */
  .hero { grid-template-columns: 1fr; }
  .carousel { height: auto; }
  .carousel-slide img { min-height: 0; height: auto; aspect-ratio: 1200 / 516; }
  .hero-tile.imgtile img { aspect-ratio: 800 / 330; height: auto; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ===== Fix: กล่องขยายเกินจอทำข้อมูลโดนตัด (grid/flex min-width) ===== */
.acc-wrap > *, .orderpage-main, .cartwrap > *, .panel, .ordercard, .summary { min-width: 0; }

@media (max-width: 760px) {
  /* คอลัมน์เนื้อหาห้ามกว้างเกินจอ → แถบข้างในกลับมาปัดได้ตามปกติ */
  .acc-wrap, .acc-wrap > div, .ordercard, .ordercard-items, .panel { max-width: 100%; }
  .ordertabs, .acc-nav, .catnav-in { max-width: 100%; overflow-x: auto; }

  /* หัวข้อ+ปุ่ม (เช่น "ที่อยู่ของฉัน | + เพิ่มที่อยู่ใหม่") ตกบรรทัดแทนการหลุดจอ */
  .sec-head { flex-wrap: wrap; gap: 8px; }
  .sec-head .btn { padding: 8px 14px; font-size: 13.5px; }

  /* แถวสรุปการ์ดออเดอร์: ตกบรรทัดได้ ราคารวม+ปุ่มไม่หลุดขวา */
  .ordercard-foot { flex-wrap: wrap; }
  .ordercard-total { margin-left: auto; }

  /* แถวออเดอร์เก่า/แถวที่อยู่: ห่อบรรทัด */
  .orderrow { flex-wrap: wrap; }
  .addrrow-actions { width: 100%; justify-content: flex-start; }

  /* เผื่อเนื้อหากว้างจริงๆ (ตาราง admin ฯลฯ): ให้เลื่อนในกล่องตัวเอง ไม่ดันทั้งหน้า */
  .admintable { display: block; overflow-x: auto; scrollbar-width: none; }
  .admintable::-webkit-scrollbar { display: none; }
}

/* มือถือ: กล่องเล็กเรียงคู่ ครึ่งความกว้างของแบนเนอร์หลัก */
@media (max-width: 760px) {
  .hero-side { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-tile { padding: 12px; font-size: 12px; }
  .hero-tile b { font-size: 13.5px; }
}

/* ===== หัวแอปแบบ Shopee: แถวเดียว ค้นหาแคปซูล + ตะกร้า + แชท ===== */
.mobicons { display: none; }

/* หน้าโซนบัญชีบนมือถือ: ตัดช่องค้นหา/แถบหมวดออก แล้วใช้ไอคอนเฟืองแทน (สไตล์หน้า "ฉัน") */
.gearmenu { display: none; }
@media (max-width: 760px) {
  .mainbar.accbar .searchcol { display: none; }
  .mainbar.accbar .catnav { display: none; }
  .mainbar.accbar .logo { display: flex; align-items: center; }
  .mainbar.accbar .logoimg.white.big { width: 38px; height: 38px; }
  .mainbar.accbar .mainbar-in { grid-template-columns: auto 1fr; }
  .mainbar.accbar .mobicons { justify-content: flex-end; margin-left: auto; }

  .gearmenu { display: inline-flex; position: relative; }
  .gearbtn { background: none; border: 0; padding: 0; color: #fff; display: inline-flex; cursor: pointer; }
  .gearbtn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9;
    stroke-linecap: round; stroke-linejoin: round; }
  .gear-drop { position: absolute; top: calc(100% + 12px); right: -4px; z-index: 200;
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    width: max-content; min-width: 190px; max-width: calc(100vw - 24px);
    box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 6px; }
  .gear-drop::before { content: ""; position: absolute; top: -6px; right: 10px; width: 11px; height: 11px;
    background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
  .gearmenu .gear-drop a, .gearmenu .gear-drop .gear-out {
    display: block; width: 100%; text-align: left; padding: 11px 12px;
    font-family: inherit; font-size: 14.5px; font-weight: 400; line-height: 1.5;
    color: #333; text-decoration: none; border: 0; background: none;
    border-radius: 7px; cursor: pointer; }
  .gearmenu .gear-drop a:active, .gearmenu .gear-drop .gear-out:active { background: var(--sand); }
  .gearmenu .gear-drop form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
  .gearmenu .gear-drop .gear-out { color: #D64045; font-weight: 600; }
}

@media (max-width: 760px) {
  .mainbar-in { grid-template-columns: 1fr auto; gap: 12px; padding: 8px 0; }
  .logo { display: none; }                              /* โลโก้ไปเด่นที่ไอคอนแอปแทน */
  .hcart { display: none; }                             /* cart preview เป็นของเดสก์ท็อป */

  /* ช่องค้นหาทรงแคปซูล มีแว่นขยายในตัว (พิมพ์แล้วกด Enter/ปุ่มค้นหาบนคีย์บอร์ด) */
  .search { border-radius: 99px; overflow: hidden; }
  .search input { border-radius: 99px; padding: 10px 14px 10px 40px; font-size: 14px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 18px; }
  .search button { display: none; }

  /* ไอคอนขวา: ตะกร้า + แชท เส้นขาวแบบ Shopee */
  .mobicons { display: flex; gap: 18px; align-items: center; padding-right: 2px; }
  .mobicons a { position: relative; display: inline-flex; color: #fff; }
  .mobicons svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9;
    stroke-linecap: round; stroke-linejoin: round; }
  .mob-badge { position: absolute; top: -7px; right: -9px; background: #fff; color: var(--jhi);
    border: 1.5px solid var(--jhi); font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px;
    border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
}

/* fix หัวแอป: บังคับลำดับ ค้นหาซ้าย-ไอคอนขวา + ย่อช่องค้นหาให้บาง */
@media (max-width: 760px) {
  .mainbar-in { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
  .search { order: 1; flex: 1; min-width: 0; margin: 0; }
  .mobicons { order: 2; flex: 0 0 auto; }
  .search input { padding: 8px 12px 8px 36px; font-size: 13.5px; background-position: 12px center; background-size: 16px; }
  .mobicons svg { width: 24px; height: 24px; }
  .mob-badge { min-width: 16px; height: 16px; font-size: 10px; top: -6px; right: -8px; }
}

/* ช่องค้นหาแบบ Shopee: สี่เหลี่ยมมนเล็ก เตี้ยลง + กัน badge ตกขอบจอ */
@media (max-width: 760px) {
  .search, .search input { border-radius: 9px; }
  .search input { padding: 7px 10px 7px 33px; font-size: 13px; background-position: 10px center; background-size: 16px; line-height: 1.3; }
  .mainbar-in { gap: 14px; }
  .mobicons { padding-right: 8px; }
  .mob-badge { right: -7px; }
}

/* ===== ระบบแชท ===== */
.chatpage { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 380px; margin: 10px 0; }
.chathead { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 12px 12px 0 0; padding: 10px 14px; }
.chathead img, .chathead .avatar { width: 40px; height: 40px; border-radius: 50%; }
.chathead small { color: #26AA99; }
.chathead.admin { margin-bottom: 0; border-radius: 12px 12px 0 0; }
.chathead.admin a { font-size: 22px; color: #555; padding: 0 6px; }
.chatbody { flex: 1; overflow-y: auto; background: #EFF5FA; border: 1px solid var(--line); border-top: 0;
  padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.chatbody.admin { height: 52vh; }
.chat-hint { text-align: center; color: #999; font-size: 12.5px; background: #fff; border-radius: 99px;
  padding: 7px 14px; align-self: center; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  word-break: break-word; position: relative; }
.bubble small { display: block; font-size: 10px; opacity: .6; margin-top: 3px; text-align: right; }
.bubble.me small { opacity: 1; color: rgba(255,255,255,.62); display: flex; align-items: center;
  justify-content: flex-end; gap: 4px; }

/* ติ๊กสถานะข้อความ: ติ๊กเดียว = ส่งแล้ว / ติ๊กคู่สว่าง + "อ่านแล้ว" = อีกฝั่งอ่านแล้ว */
.mstat { display: inline-flex; align-items: center; gap: 4px; }
.mstat .tick { width: 15px; height: 9px; display: block; }
.mstat .tick .t1 { transform: translateX(4.6px); }   /* ยังไม่อ่าน: ติ๊กเดียว จัดให้อยู่กลาง */
.mstat .tick .t2 { opacity: 0; }
.mstat .readlab { display: none; font-style: normal; font-size: 9.5px; }
.bubble.me.read small { color: #8FE9FF; }
.bubble.me.read .tick .t2 { opacity: 1; }
.bubble.me.read .tick .t1 { transform: none; }
.bubble.me.lastread .readlab { display: inline; }
.bubble.me { align-self: flex-end; background: var(--jhi); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: #fff; color: #333; border-bottom-left-radius: 4px;
  border: 1px solid var(--line); }
.chatbar { display: flex; gap: 8px; background: #fff; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 12px 12px; padding: 9px 10px; }
.chatbar input { flex: 1; border: 1.5px solid var(--line); border-radius: 99px; padding: 9px 14px; font: inherit; min-width: 0; }
.chatbar .btn { border-radius: 99px; padding: 9px 20px; }

/* แถวห้องแชทฝั่งแอดมิน */
.chatrow { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chatrow:hover { background: var(--sand); }
.chatrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chatrow-main small { color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chatrow-meta small { color: #999; font-size: 11.5px; }
.chat-unread { background: var(--price); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px;
  height: 18px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

@media (max-width: 760px) {
  .chatpage { height: calc(100dvh - 205px); }

  /* ปุ่ม +/- ให้เด่นชัดแน่นอน */
  .stepper { border-width: 1px; }
  .stepper button { width: 36px !important; min-width: 36px; font-size: 20px !important;
    font-weight: 600; color: var(--navy); background: var(--ice); display: inline-flex;
    align-items: center; justify-content: center; }
  .stepper .qty { width: 42px !important; font-size: 14.5px; }
}

/* ===== Dashboard: Business Insights แบบละเอียด ===== */
.insight-hero { margin-bottom: 14px; text-align: center; background: linear-gradient(-180deg, var(--navy-mid), var(--navy)); color: #fff; }
.insight-hero small { opacity: .8; }
.insight-hero .hero-amount { font-family: 'Kanit'; font-size: 44px; font-weight: 700; line-height: 1.2; }
.insight-hero .chg { font-size: 13px; }
.insight-hero .chg.up { color: #8FE3B0; } .insight-hero .chg.down { color: #FFB3A0; }
.insights.six { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 900px) { .insights.six { grid-template-columns: repeat(6, 1fr); } }
.chartlegend { display: flex; gap: 16px; align-items: center; font-size: 12.5px; color: #555; margin-bottom: 4px; }
.chartlegend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.chartlabels.hours { display: flex; justify-content: space-between; font-size: 10.5px; color: #999; }
.toprow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.toprow:last-child { border-bottom: 0; }
.toprow .rank { width: 24px; height: 24px; border-radius: 50%; background: var(--ice); color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.toprow img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--ice); flex-shrink: 0; }
.toprow .tinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toprow .tinfo span { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toprow .tinfo small { color: #999; font-size: 11.5px; }
.toprow .trev { color: var(--price); font-size: 14.5px; white-space: nowrap; }

/* ===== แชท: toolbar + popup เลือกสินค้า/ออเดอร์ + bubble ชนิดใหม่ ===== */
.chattools { display: flex; gap: 4px; padding: 4px 10px 8px; background: #fff; border-top: 1px solid #EEE; }
.chattools button { background: none; border: none; font-size: 21px; line-height: 1; padding: 5px 7px; cursor: pointer; border-radius: 6px; }
.chattools button:hover, .chattools button.on { background: var(--ice); }
.chatbar { border-top: 0 !important; }

.cpanel { position: absolute; left: 8px; right: 8px; bottom: 100%; margin-bottom: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -4px 24px rgba(13,43,69,.14);
  max-height: 300px; display: flex; flex-direction: column; overflow: hidden; z-index: 30; }
.cpanel[hidden] { display: none; }
.cpanel .cpanel-head { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.cpanel .cpanel-head b { font-size: 13.5px; color: var(--navy); }
.cpanel .cpanel-head input { flex: 1; border: 1px solid #DDD; border-radius: 7px; padding: 6px 10px; font-size: 13px; font-family: inherit; outline: none; }
.cpanel .cpanel-head input:focus { border-color: var(--navy); }
.cpanel .cpanel-x { margin-left: auto; background: none; border: 0; font-size: 17px; cursor: pointer; color: #999; }
.cpanel-list { overflow-y: auto; padding: 4px 0; }
.cpanel-list .empty2 { text-align: center; color: #999; font-size: 13px; padding: 18px 0; }
.crow { display: flex; align-items: center; gap: 9px; padding: 7px 12px; }
.crow img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; background: var(--ice); flex-shrink: 0; }
.crow .cinfo { flex: 1; min-width: 0; }
.crow .cinfo span { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .cinfo small { color: var(--price); font-size: 12px; font-weight: 600; }
.crow .cinfo small.st { color: var(--sea); font-weight: 400; }
.crow .btn { padding: 5px 14px; font-size: 12.5px; }

.emopanel { display: flex; flex-wrap: wrap; gap: 2px; padding: 10px; }
.emopanel button { font-size: 22px; background: none; border: 0; padding: 5px; cursor: pointer; border-radius: 6px; }
.emopanel button:hover { background: var(--ice); }

.bubble .cimg, .cw-msg .cimg { display: block; max-width: 200px; max-height: 240px; border-radius: 10px; }
.bubble.me .cimg { margin-left: auto; }
.msg-card { display: flex; gap: 9px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; max-width: 250px; text-decoration: none; color: var(--ink); }
.msg-card img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--ice); flex-shrink: 0; }
.msg-card .mc-info { min-width: 0; }
.msg-card .mc-info span { display: block; font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-card .mc-info b { color: var(--price); font-size: 14px; }
.msg-card .mc-info small { color: var(--sea); font-size: 11.5px; display: block; }

/* กราฟ dashboard แบบกระชับ */
.chartwrap.compact svg { display: block; width: 100%; max-width: 820px; margin: 0 auto; }
.chartwrap.compact .chartlegend { max-width: 820px; margin: 0 auto 4px; }

/* ===== Dashboard แบบ Shopee Seller Center ===== */
.sp-hero { background: linear-gradient(-180deg, var(--navy-mid), var(--navy)); border-radius: var(--r);
  text-align: center; padding: 22px 16px 30px; margin-bottom: 14px; position: relative; overflow: hidden; }
.sp-hero::after { content: '🎣'; position: absolute; right: -10px; top: -14px; font-size: 110px; opacity: .08; }
.sp-hero h2 { color: #fff; font-family: 'Kanit'; font-size: 24px; margin: 0 0 8px; }
.sp-time { display: inline-block; background: rgba(0,0,0,.28); color: #fff; font-size: 13px;
  padding: 4px 14px; border-radius: 6px; margin-bottom: 14px; }
.sp-amount { background: #fff; color: var(--navy); font-family: 'Kanit'; font-size: 52px; font-weight: 700;
  border-radius: 12px; max-width: 560px; margin: 0 auto; padding: 14px 20px; line-height: 1.15;
  box-shadow: 0 6px 24px rgba(13,43,69,.18); }
.sp-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
@media (min-width: 1100px) { .sp-grid { grid-template-columns: 260px 1fr 330px; } }
.sp-grid .panel h3 { margin-top: 0; }
.sp-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sp-kpi-cell { padding: 16px 10px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sp-kpi-cell:nth-child(2n) { border-right: 0; }
.sp-kpi-cell:nth-last-child(-n+2) { border-bottom: 0; }
.sp-kpi-cell small { display: block; color: var(--sea); font-size: 12.5px; margin-bottom: 8px; }
.sp-kpi-cell b { font-size: 19px; font-family: 'Kanit'; }
.sp-legend { display: flex; gap: 16px; align-items: center; font-size: 13px; color: #555; margin: 4px 0 2px; }
.sp-legend .ln { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.sp-chart svg { display: block; width: 100%; }
.sp-top .toprow .tinfo span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ===== กระดิ่งแจ้งเตือน ===== */
.notifbtn { position: relative; background: none; border: 0; cursor: pointer; padding: 6px; color: #fff; display: none; }
.notifbtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notifbtn.desk { display: inline-flex; align-items: center; }
@media (max-width: 860px) { .notifbtn.desk { display: none; } .mobicons .notifbtn { display: inline-flex; } }
.notif-drop { position: fixed; top: 118px; right: 24px; width: 360px; max-width: calc(100vw - 16px); z-index: 9990;
  background: #fff; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 36px rgba(13,43,69,.18); overflow: hidden; }
@media (max-width: 860px) { .notif-drop { top: 108px; right: 8px; } }
.notif-head { padding: 10px 14px; font-size: 13px; color: #888; border-bottom: 1px solid var(--line); background: #FBFBFB; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-empty { text-align: center; color: #999; font-size: 13px; padding: 22px 0; }
.notif-row { display: block; padding: 11px 14px; border-bottom: 1px solid #F1F1F1; text-decoration: none; color: var(--ink); }
.notif-row:hover { background: #FAFCFE; }
.notif-row.unread { background: var(--ice); }
.notif-row b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.notif-row span { display: block; font-size: 12.5px; color: #555; line-height: 1.45; }
.notif-row small { color: #999; font-size: 11px; }

/* ===== ตัวชี้วัดหลัก 7 วัน (แบบ Shopee) ===== */
.sp-range { display: flex; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: #555;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; background: #FBFCFD; }
.sp-range b { color: var(--ink); }
.sp-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 900px) { .sp-cards { grid-template-columns: repeat(4, 1fr); } }
.sp-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; cursor: pointer; font-family: inherit; border-top: 3px solid transparent; transition: box-shadow .15s; }
.sp-card:hover { box-shadow: 0 3px 12px rgba(13,43,69,.08); }
.sp-card.on { border-top-color: var(--navy); border-color: var(--navy); box-shadow: 0 3px 12px rgba(13,43,69,.10); }
.sp-card .lb { display: block; color: #666; font-size: 12.5px; margin-bottom: 4px; }
.sp-card b { font-size: 20px; font-family: 'Kanit'; display: block; margin-bottom: 4px; }
.sp-card .cmp { display: block; font-size: 11.5px; color: #999; }
.sp-card .chg.up { color: #26AA99; } .sp-card .chg.down { color: var(--price); }
.sp-legend2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.sp-legend2 b { font-size: 15px; }
#trendSvg { display: block; width: 100%; }

/* ===== topstrip: กระดิ่ง + ภาษา ===== */
.ts-notif { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: #fff;
  font-family: inherit; font-size: 12.5px; cursor: pointer; padding: 0; position: relative; }
.ts-notif svg, .ts-globe { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.ts-badge { background: var(--price); color: #fff; min-width: 16px; height: 16px; border-radius: 8px;
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.langmenu { position: relative; }
.langmenu > a { display: inline-flex; align-items: center; gap: 5px; }
.langmenu-drop { display: none; position: absolute; top: 100%; right: 0; z-index: 9991; background: #fff;
  min-width: 150px; border-radius: 8px; box-shadow: 0 6px 24px rgba(13,43,69,.18); padding: 6px 0; }
.langmenu:hover .langmenu-drop { display: block; }
.langmenu-drop a, .langmenu-drop span { display: block; padding: 8px 14px; font-size: 13px; color: #444 !important; }
.langmenu-drop a.on { color: var(--navy) !important; font-weight: 600; }
.langmenu-drop span { color: #AAA !important; cursor: default; }
.notif-drop { top: 34px; }
@media (max-width: 860px) { .notif-drop { top: 108px; } }

/* ===== Footer ขาวแบบ Shopee ===== */
.sitefoot { background: #fff; border-top: 1px solid var(--line); color: #555; font-size: 13px; margin-top: 28px; }
.sitefoot-in { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 20px; padding: 34px 16px 26px; }
@media (min-width: 900px) { .sitefoot-in { grid-template-columns: repeat(6, 1fr); } }
.sf-col { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.sf-col b { color: var(--ink); font-size: 13.5px; margin-bottom: 2px; }
.sf-col a { color: #666; }
.sf-col a:hover { color: var(--navy); }
.sf-col span { color: #888; line-height: 1.55; }
.sf-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-tile { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px;
  font-size: 11px; font-weight: 600; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.sf-qr { border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.sf-tag { text-align: center; color: #999; font-size: 12.5px; border-top: 1px solid var(--line); padding: 14px 10px; }

/* ===== กราฟ 7 วัน: ขนาดพอดี + tooltip ===== */
.trendwrap { position: relative; max-width: 880px; margin: 0 auto; }
.sp-legend2 { max-width: 880px; margin: 0 auto 4px; }
.trendtip { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 22px rgba(13,43,69,.16); padding: 10px 14px; min-width: 190px; pointer-events: none; }
.trendtip .tt-date { font-weight: 600; font-size: 13px; border-bottom: 1px solid #F0F0F0; padding-bottom: 6px; margin-bottom: 7px; }
.trendtip .tt-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #555; padding: 3px 0; }
.trendtip .tt-row i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.trendtip .tt-row b { margin-left: auto; color: var(--ink); }

/* โลโก้ขนส่ง/ชำระเงินใน footer */
.sf-tile.img { padding: 3px 6px; display: inline-flex; align-items: center; }
.sf-tile.img img { height: 22px; width: auto; display: block; }

/* ===== Cart dropdown แบบ Shopee (hover ที่ตะกร้า) ===== */
.hcart { position: relative; margin-left: 4px; }
.cart-drop { display: none; position: absolute; top: 100%; right: -8px; padding-top: 12px; z-index: 9992; }
.hcart:hover .cart-drop { display: block; }
.cart-drop::before { content: ''; position: absolute; top: 4px; right: 26px;
  border: 7px solid transparent; border-bottom-color: #fff; }
.cd-head, .cd-list, .cd-foot, .cd-empty { background: #fff; }
.cd-head { width: 380px; max-width: calc(100vw - 24px); border-radius: 10px 10px 0 0;
  padding: 11px 14px 6px; color: #999; font-size: 13px; box-shadow: 0 8px 30px rgba(13,43,69,.16); }
.cd-list { width: 380px; max-width: calc(100vw - 24px); box-shadow: 0 8px 30px rgba(13,43,69,.16); }
.cd-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; text-decoration: none; }
.cd-row:hover { background: var(--ice); }
.cd-row img { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.cd-name { flex: 1; min-width: 0; color: var(--ink); font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-price { color: var(--price); font-size: 13.5px; white-space: nowrap; }
.cd-foot { width: 380px; max-width: calc(100vw - 24px); border-radius: 0 0 10px 10px;
  display: flex; align-items: center; padding: 11px 14px; box-shadow: 0 8px 30px rgba(13,43,69,.16); }
.cd-foot small { color: #777; font-size: 12.5px; }
.cd-btn { margin-left: auto; padding: 8px 16px !important; font-size: 13.5px !important; }
.cd-empty { width: 300px; border-radius: 10px; text-align: center; color: #999; font-size: 13.5px;
  padding: 34px 20px; line-height: 2; box-shadow: 0 8px 30px rgba(13,43,69,.16); }
@media (max-width: 860px) { .cart-drop { display: none !important; } } /* มือถือแตะแล้วเข้าหน้าตะกร้าเลย */

/* สินค้าหมดสต๊อก */
.oosCard .card-img img, .imgoos { filter: grayscale(1); opacity: .75; }
.oos-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(40,40,40,.78); color: #fff; font-size: 13.5px; padding: 7px 18px; border-radius: 99px; }
.card-img { position: relative; }
.btn.big.ghost { width: 100%; }

/* ราคาแบบ Shopee: ขีดทับ + ป้ายเปอร์เซ็นต์ */
.pd-price s { color: #9AA3AB; font-size: 17px; margin-left: 10px; font-weight: 400; }
.pd-disc { background: #FDEEE7; color: var(--price); font-size: 12.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px; margin-left: 10px; vertical-align: 3px; }

/* แถบค้นหาในหน้าจัดการสินค้า */
.adminsearch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.adminsearch input[type=search] { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 13px; font: inherit; outline: none; background: #fff; }
.adminsearch input[type=search]:focus { border-color: var(--navy); }
.adminsearch select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font: inherit; background: #fff; }

/* ตัวเลือกสินค้า 2 ชั้นแบบ Shopee + breadcrumb + แชร์ */
.vtier { margin-bottom: 4px; }
.vopt2 { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 16px;
  font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.vopt2:hover { border-color: var(--sea); }
.vopt2.on { border-color: var(--price); color: var(--price); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--price); }
.vopt2.oos2 { color: #B9BEC3; background: #F7F8F9; text-decoration: line-through; }
/* ปุ่มตัวเลือกชั้นแรกที่มีรูปประจำสี (แบบ Shopee) */
.vopt2.hasimg { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; }
.vopt2 .vimg2 { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; flex: none; }
.vopt2.oos2 .vimg2 { opacity: .45; }
.crumb2 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: #888; margin-bottom: 6px; }
.crumb2 a { color: var(--sea); }
.crumb2 b { color: #666; font-weight: 400; }
.sharebar { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; color: #666; }
.sharebar .fb { display: inline-flex; align-items: center; gap: 6px; background: #1877F2; color: #fff;
  border-radius: 6px; padding: 6px 13px; font-size: 13px; text-decoration: none; }
.sharebar .fb svg { width: 16px; height: 16px; fill: currentColor; }

/* ปุ่ม Favorite ข้างปุ่มแชร์ */
.favbtn { display: inline-flex; align-items: center; gap: 6px; background: #fff; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 13px; font: inherit; font-size: 13px;
  color: #666; transition: color .15s, border-color .15s, background .15s; }
.favbtn svg { width: 16px; height: 16px; fill: none; }
.favbtn:hover { border-color: #E5484D; color: #E5484D; }
.favbtn.on { color: #E5484D; border-color: #F3C3C5; background: #FEF6F6; font-weight: 600; }
.favbtn.on svg { fill: #E5484D; stroke: #E5484D; }
.favbtn:active { transform: scale(.96); }

/* ซ่อน radio ชุดเดิมเมื่อแสดงตัวเลือกแบบ 2 ชั้น (hidden แพ้ display:flex ต้องย้ำ) */
.variants[hidden] { display: none !important; }

/* จำนวนคงเหลือข้างช่องจำนวน */
.qtywrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stockinfo { color: #888; font-size: 13px; }
.stockinfo b { color: var(--ink); font-weight: 600; }

/* ตัวช่วยสร้างตัวเลือก 2 ชั้นในฟอร์มสินค้า */
.tierbuild { margin: 12px 0; border: 1px dashed var(--sea); border-radius: 10px; background: var(--ice); }
.tierbuild summary { cursor: pointer; padding: 11px 14px; font-size: 14px; color: var(--navy); font-weight: 600; }
.tierbuild-in { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.tierbuild-in label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #555; }
.tierbuild-in input { border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; font: inherit; background: #fff; }
.tierbuild-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tierbuild-row label { flex: 0 0 140px; }

/* แผงตัวเลือกสินค้าแบบ Shopee ในฟอร์ม admin */
.optpanel { background: #F7F8FA; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.optpanel-head { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.optpanel-head small { font-weight: 400; color: #999; }
.optpanel-head .opt-x { margin-left: auto; background: none; border: 0; font-size: 15px; cursor: pointer; color: #999; }
.optvals { display: flex; flex-wrap: wrap; gap: 8px; }
.optval { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.optval input { border: 0; padding: 8px 10px; font: inherit; font-size: 13.5px; width: 130px; outline: none; }
.optval button { border: 0; background: none; cursor: pointer; padding: 0 8px; color: #C0392B; font-size: 13px; }
.bulkbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 10px; }
.bulkbar b { font-size: 14.5px; margin-right: 6px; }
.bulkbar input { border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; font: inherit; width: 120px; background: #fff; }
.vdel { background: none; border: 0; cursor: pointer; font-size: 15px; opacity: .65; }
.vdel:hover { opacity: 1; }

/* แผง/ตาราง matrix แบบ Shopee */
.optname { border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; font: inherit;
  width: 100%; max-width: 340px; background: #fff; margin-bottom: 10px; display: block; }
.optpanel-sub { font-size: 13px; color: #555; margin-bottom: 7px; }
.optpanel-sub::before { content: '● '; color: var(--price); font-size: 9px; vertical-align: 2px; }
#vtable .t1cell { background: #FBFCFD; text-align: center; vertical-align: middle; min-width: 110px; }
#vtable .t2cell { background: #FDFDFE; min-width: 90px; }

/* รูปประจำสีในตาราง matrix */
.gimgwrap { margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gimg { width: 54px; height: 54px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); background: #fff; }
.gimgbtn { font-size: 11.5px; color: var(--sea); cursor: pointer; border: 1px dashed var(--sea);
  border-radius: 6px; padding: 3px 9px; background: #fff; }
.gimgbtn:hover { background: var(--ice); }

/* แกลเลอรีในฟอร์ม: ✕ มุมขวาบน + ลากเรียง */
.imghint { color: #888; font-size: 12.5px; margin: 2px 0 8px; }
.imgcell { position: relative; cursor: grab; }
.imgcell.dragging { opacity: .45; }
.imgx { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 99px;
  border: 0; background: #E8552D; color: #fff; font-size: 12px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.imgx:hover { background: #C63E1B; }
.imgtag { position: absolute; left: 4px; bottom: 4px; background: rgba(22,58,92,.85); color: #fff;
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px; }
.imgtag.cover { background: var(--gold); color: var(--navy-dark); font-weight: 700; }
