:root{
  --ink:#172033;
  --muted:#667085;
  --navy:#15345a;
  --navy-2:#0b2342;
  --gold:#d9a441;
  --gold-soft:#fff7e7;
  --bg:#f5f7fa;
  --surface:#ffffff;
  --line:#e6eaf0;
  --success:#177245;
  --danger:#b42318;
  --shadow-sm:0 8px 24px rgba(15,35,65,.06);
  --shadow-md:0 18px 48px rgba(15,35,65,.10);
  --radius:18px;
  --radius-lg:28px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:"Noto Sans Thai","Leelawadee UI",Tahoma,Arial,sans-serif;
  color:var(--ink);
  background:var(--surface);
  line-height:1.75;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}
body.soft{background:var(--bg)}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto}
button,input,select,textarea{font:inherit}
.wrap{width:min(1180px,calc(100% - 40px));margin-inline:auto}

/* Header */
.top{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.92);
  border-bottom:1px solid rgba(230,234,240,.9);
  backdrop-filter:blur(18px) saturate(150%);
  box-shadow:0 1px 0 rgba(15,35,65,.03);
}
.nav{min-height:76px;display:flex;align-items:center;gap:26px}
.brand{font-size:17px;font-weight:850;color:var(--navy);white-space:nowrap;letter-spacing:-.2px}
.brand span{
  display:inline-grid;
  place-items:center;
  min-width:44px;
  padding:6px 10px;
  margin-right:7px;
  border-radius:10px;
  color:#fff;
  background:linear-gradient(135deg,var(--gold),#b57b1e);
  box-shadow:0 7px 16px rgba(181,123,30,.22);
}
.nav nav{display:flex;align-items:center;gap:24px;margin-left:auto}
.nav nav a{position:relative;color:#344054;font-size:15px;font-weight:650;transition:.2s ease}
.nav nav a:hover{color:var(--navy)}
.nav nav a:after{content:"";position:absolute;left:0;right:100%;bottom:-9px;height:2px;background:var(--gold);transition:.2s ease}
.nav nav a:hover:after{right:0}
.menu{display:none;margin-left:auto;border:0;background:transparent;font-size:25px;color:var(--navy);cursor:pointer}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  padding:12px 21px;
  border:1px solid transparent;
  border-radius:13px;
  background:linear-gradient(135deg,var(--gold),#c68d2f);
  color:#fff;
  font-weight:800;
  line-height:1.25;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(198,141,47,.18);
  transition:transform .2s ease,box-shadow .2s ease,filter .2s ease;
}
.btn:hover{transform:translateY(-2px);box-shadow:0 14px 28px rgba(198,141,47,.24);filter:saturate(1.05)}
.btn:active{transform:translateY(0)}
.btn.alt{background:linear-gradient(135deg,var(--navy),var(--navy-2));color:#fff;box-shadow:0 10px 24px rgba(11,35,66,.16)}
.btn.ghost{background:rgba(255,255,255,.08);color:#fff;border-color:rgba(255,255,255,.28);box-shadow:none}
.btn.ghost:hover{background:rgba(255,255,255,.15)}
.btn.sm{min-height:40px;padding:9px 15px;border-radius:11px;font-size:14px}

/* Hero */
.hero{
  position:relative;
  overflow:hidden;
  color:#fff;
  background:
    radial-gradient(circle at 85% 15%,rgba(217,164,65,.23),transparent 29%),
    radial-gradient(circle at 15% 92%,rgba(99,146,201,.16),transparent 28%),
    linear-gradient(135deg,#081a31 0%,#12345c 58%,#1c4c7c 100%);
  padding:92px 0 88px;
}
.hero:before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);background-size:34px 34px;mask-image:linear-gradient(to bottom,black,transparent)}
.hero-grid{position:relative;display:grid;grid-template-columns:1.12fr .88fr;gap:58px;align-items:center}
.eyebrow{display:inline-flex;align-items:center;padding:7px 13px;border:1px solid rgba(255,255,255,.2);border-radius:999px;background:rgba(255,255,255,.08);color:#f9e7bd;font-size:14px;font-weight:750;backdrop-filter:blur(8px)}
.hero h1{max-width:760px;margin:18px 0 18px;font-size:clamp(40px,5.3vw,70px);line-height:1.1;letter-spacing:-1.4px}
.hero p{max-width:720px;margin:0;color:#d7e1ee;font-size:clamp(17px,2vw,20px)}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:30px}
.factory-card{padding:22px;border:1px solid rgba(255,255,255,.7);border-radius:var(--radius-lg);background:rgba(255,255,255,.95);color:var(--ink);box-shadow:0 28px 75px rgba(0,0,0,.25);transform:rotate(1deg)}
.factory-card h3{margin:18px 2px 10px;font-size:21px;color:var(--navy)}
.machine{height:290px;border-radius:20px;background:linear-gradient(145deg,#edf1f6,#fff);display:grid;place-items:center;font-size:76px;box-shadow:inset 0 0 0 1px #e8edf3}
.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:13px}
.fact{padding:13px 8px;border-radius:13px;background:var(--bg);text-align:center;color:var(--muted);font-size:13px}
.fact b{display:block;color:var(--navy);font-size:16px}

/* Sections */
.section{padding:82px 0}
.section.soft{background:linear-gradient(180deg,#f7f9fc,#f3f6f9)}
.section h2{max-width:850px;margin:8px 0 12px;color:var(--navy-2);font-size:clamp(29px,4vw,45px);line-height:1.24;letter-spacing:-.5px}
.section h3{color:var(--navy)}
.lead{max-width:760px;margin-top:0;color:var(--muted);font-size:18px}
.tag{display:inline-flex;align-items:center;padding:6px 11px;border:1px solid #efd8a6;border-radius:999px;background:var(--gold-soft);color:#8a5b0c;font-size:13px;font-weight:800}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin-top:34px;align-items:stretch}
.grid>*{min-width:0}
.card{
  min-width:0;
  padding:25px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow-sm);
  transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease;
}
.card:hover{transform:translateY(-4px);border-color:#d6dde7;box-shadow:var(--shadow-md)}
.card p{color:var(--muted)}

/* Product cards */
.product-card{display:flex;flex-direction:column;width:100%;max-width:100%;overflow:hidden;padding:13px 13px 19px}
.product-card img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:14px;background:#eef2f6;box-shadow:inset 0 0 0 1px #e6eaf0}
.product-card h2,.product-card h3,.product-card p{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
.product-card h3{margin:17px 8px 5px;font-size:20px;line-height:1.4}
.product-card p{margin:0 8px 18px;flex:1}
.product-card .btn{width:calc(100% - 16px);max-width:100%;margin:0 8px;white-space:normal;text-align:center}

/* Steps and proof */
.step{position:relative;padding-top:24px}
.step:before{counter-increment:s;content:counter(s);display:grid;place-items:center;width:44px;height:44px;margin-bottom:16px;border-radius:14px;background:linear-gradient(135deg,var(--gold),#c58b2b);color:#fff;font-weight:900;box-shadow:0 9px 18px rgba(197,139,43,.2)}
.steps{counter-reset:s}
.section .grid:has(.step){counter-reset:s}
.proof{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin-top:30px}
.proof .card{text-align:center;padding:29px 18px}
.proof b{display:block;color:var(--navy);font-size:27px;line-height:1.3}
.proof p{margin-bottom:0}

/* Forms */
.form{max-width:900px;padding:30px;border:1px solid var(--line);border-radius:22px;background:#fff;box-shadow:var(--shadow-sm)}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:19px}
.field{display:flex;flex-direction:column;gap:7px;color:#344054;font-weight:700}
.field.full{grid-column:1/-1}
input,select,textarea{
  width:100%;
  min-width:0;
  padding:13px 14px;
  border:1px solid #d5dbe5;
  border-radius:12px;
  outline:none;
  background:#fff;
  color:var(--ink);
  transition:border-color .2s ease,box-shadow .2s ease,background .2s ease;
}
input:focus,select:focus,textarea:focus{border-color:#9eb4d0;box-shadow:0 0 0 4px rgba(21,52,90,.08)}
textarea{min-height:130px;resize:vertical}
.notice{padding:15px 17px;border:1px solid #bfd9f5;border-radius:13px;background:#eef6ff;color:#24527a}
.success{border-color:#a7d8b7;background:#eaf8ef;color:var(--success)}
.error{border-color:#f2b8b5;background:#fff0f0;color:var(--danger)}
.status{display:inline-flex;padding:5px 10px;border-radius:999px;background:#eef2f6;color:#344054;font-size:13px;font-weight:800}

/* Tables and admin */
.table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden;border:1px solid var(--line);border-radius:15px;background:#fff;box-shadow:var(--shadow-sm)}
.table th,.table td{padding:13px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.table th{background:#f7f9fc;color:#344054;font-size:14px}
.table tr:last-child td{border-bottom:0}
.adminbar{background:#101c2d;color:#fff;padding:14px 20px;box-shadow:0 7px 20px rgba(0,0,0,.12)}
.adminbar a{display:inline-block;margin-right:20px;color:#e8eef6;font-weight:700}
.adminbar a:hover{color:#f6cb76}
.login{max-width:430px;margin:75px auto;padding:32px}
.login h1{margin-top:0;color:var(--navy)}

/* SEO copy */
.seo-copy .wrap{max-width:1000px}
.seo-copy h2,.seo-copy h3{color:var(--navy)}
.seo-copy p{color:#526071;font-size:17px}

/* Footer */
footer{padding-top:54px;background:linear-gradient(135deg,#0c1828,#132844);color:#dce5f0}
.foot{display:grid;grid-template-columns:2fr 1fr 1fr;gap:36px}
.foot h3{color:#fff}
.foot a{color:#dce5f0}
.foot a:hover{color:#f4cb79}
.copy{margin-top:34px;padding:19px;text-align:center;border-top:1px solid rgba(255,255,255,.1);color:#9fb0c4}

/* Responsive */
@media(max-width:980px){
  .nav nav{display:none;position:absolute;top:76px;left:18px;right:18px;padding:15px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:var(--shadow-md);flex-direction:column;align-items:stretch;gap:0}
  .nav nav a{padding:11px 8px;border-bottom:1px solid #f0f2f5}
  .nav nav a:last-child{border-bottom:0}
  .nav nav.open{display:flex}
  .menu{display:block}
  .nav>.btn{display:none}
  .hero-grid{grid-template-columns:1fr;gap:42px}
  .factory-card{max-width:680px;transform:none}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .proof{grid-template-columns:repeat(2,minmax(0,1fr))}
  .foot{grid-template-columns:1.5fr 1fr}
}

@media(max-width:640px){
  .wrap{width:min(100% - 24px,1180px)}
  .nav{min-height:68px;gap:10px}
  .brand{font-size:14px;white-space:normal;line-height:1.25}
  .brand span{min-width:39px;padding:5px 8px}
  .nav nav{top:68px;left:12px;right:12px}
  .hero{padding:58px 0 54px}
  .hero h1{font-size:38px;letter-spacing:-.8px}
  .hero p{font-size:17px}
  .actions{display:grid;grid-template-columns:1fr}
  .actions .btn{width:100%}
  .factory-card{padding:15px;border-radius:21px}
  .machine{height:220px;font-size:62px}
  .facts{grid-template-columns:1fr}
  .section{padding:58px 0}
  .grid,.proof,.foot{grid-template-columns:minmax(0,1fr);gap:16px}
  .card{padding:19px}
  .product-card{padding:11px 11px 17px}
  .product-card h3{font-size:19px}
  .fields{display:block}
  .field{margin-bottom:15px}
  .form{padding:20px;border-radius:17px}
  .table{display:block;overflow-x:auto;white-space:nowrap}
}


/* =========================================================
   NAT Clean Operations UI — frontend + admin
   Inspired by the clean internal dashboard visual language
   ========================================================= */
:root{
  --ui-bg:#f3f5fa;
  --ui-panel:#ffffff;
  --ui-border:#e2e7f0;
  --ui-text:#172033;
  --ui-muted:#8a94aa;
  --ui-primary:#4457ff;
  --ui-primary-soft:#eef0ff;
  --ui-green:#22c55e;
  --ui-cyan:#0ea5e9;
  --ui-orange:#f97316;
  --ui-red:#ef4444;
  --ui-sidebar:214px;
  --ui-topbar:64px;
  --ui-radius:14px;
  --ui-shadow:0 5px 18px rgba(24,39,75,.055);
}

/* Frontend alignment with dashboard visual language */
body:not(.admin-ui):not(.login-page){background:#fff;color:var(--ui-text)}
body:not(.admin-ui):not(.login-page) .top{background:rgba(255,255,255,.96);border-bottom:1px solid var(--ui-border);box-shadow:none}
body:not(.admin-ui):not(.login-page) .nav{min-height:68px}
body:not(.admin-ui):not(.login-page) .brand{font-size:16px;color:#111827}
body:not(.admin-ui):not(.login-page) .brand span{background:#17181c;border-radius:9px;box-shadow:none}
body:not(.admin-ui):not(.login-page) .nav nav a{font-size:14px;color:#536078}
body:not(.admin-ui):not(.login-page) .btn{border-radius:10px;background:#1f2937;box-shadow:none}
body:not(.admin-ui):not(.login-page) .btn:hover{box-shadow:0 6px 16px rgba(17,24,39,.14)}
body:not(.admin-ui):not(.login-page) .btn.alt{background:var(--ui-primary)}
body:not(.admin-ui):not(.login-page) .hero{padding:82px 0;background:linear-gradient(135deg,#111827 0%,#1f2937 56%,#334155 100%)}
body:not(.admin-ui):not(.login-page) .hero:before{opacity:.55}
body:not(.admin-ui):not(.login-page) .factory-card{transform:none;border-radius:18px;box-shadow:0 22px 60px rgba(0,0,0,.22)}
body:not(.admin-ui):not(.login-page) .section.soft{background:var(--ui-bg)}
body:not(.admin-ui):not(.login-page) .card{border-color:var(--ui-border);border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
body:not(.admin-ui):not(.login-page) .card:hover{transform:translateY(-2px);box-shadow:0 10px 30px rgba(24,39,75,.09)}
body:not(.admin-ui):not(.login-page) .tag{background:var(--ui-primary-soft);border-color:#d9ddff;color:#3543cf}
body:not(.admin-ui):not(.login-page) .product-card img{border-radius:11px}
body:not(.admin-ui):not(.login-page) input,
body:not(.admin-ui):not(.login-page) select,
body:not(.admin-ui):not(.login-page) textarea{border-radius:10px;border-color:#dce2eb}

/* Admin shell */
body.admin-ui{margin:0;min-height:100vh;background:var(--ui-bg);color:var(--ui-text);line-height:1.55}
.admin-shell{min-height:100vh}
.admin-sidebar{
  position:fixed;inset:0 auto 0 0;width:var(--ui-sidebar);z-index:80;
  background:#fff;border-right:1px solid var(--ui-border);overflow-y:auto;
  box-shadow:3px 0 15px rgba(24,39,75,.035)
}
.admin-brand{height:82px;display:flex;align-items:center;gap:11px;padding:0 17px;border-bottom:1px solid #f0f2f7}
.admin-logo{width:38px;height:38px;border-radius:11px;background:linear-gradient(145deg,#27282d,#111216);color:#fff;display:grid;place-items:center;font-size:11px;font-weight:900;font-style:italic;box-shadow:0 7px 16px rgba(17,24,39,.18)}
.admin-brand-copy strong{display:block;font-size:14px;line-height:1.2;color:#111827}
.admin-brand-copy small{display:block;margin-top:3px;color:#9aa3b5;font-size:10px}
.admin-nav{padding:16px 9px}
.admin-nav-label{padding:10px 8px 7px;color:#99a2b3;font-size:9px;font-weight:800;letter-spacing:.15em;text-transform:uppercase}
.admin-nav a{display:flex;align-items:center;gap:11px;min-height:43px;margin:3px 0;padding:9px 11px;border-radius:10px;color:#3e485b;font-size:13px;font-weight:650;transition:.18s ease}
.admin-nav a:hover{background:#f5f7fb;color:#1f2937}
.admin-nav a.active{background:linear-gradient(90deg,#e9f9ef,#f4fcf7);color:#169c4b;border:1px solid #a8ebbf;box-shadow:0 5px 13px rgba(34,197,94,.10)}
.admin-nav-icon{width:22px;text-align:center;font-size:15px}
.admin-nav .logout-link{margin-top:14px;color:#a23b3b}
.admin-main{min-height:100vh;margin-left:var(--ui-sidebar)}
.admin-topbar{position:sticky;top:0;z-index:70;height:var(--ui-topbar);display:flex;align-items:center;justify-content:space-between;padding:0 25px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--ui-border);backdrop-filter:blur(12px)}
.admin-topbar-left{display:flex;align-items:center;gap:14px}
.admin-menu-toggle{border:0;background:transparent;color:#5f6b82;font-size:21px;cursor:pointer;padding:5px}
.admin-page-title{font-size:15px;font-weight:800;color:#182238}
.admin-date{color:#8d97aa;font-size:12px}
.admin-content{padding:26px 24px 50px;max-width:1600px;margin:0 auto}
.admin-heading{margin-bottom:17px}
.admin-heading h1{margin:0;font-size:21px;line-height:1.3;color:#152039}
.admin-heading p{margin:4px 0 0;color:var(--ui-muted);font-size:12px}
.admin-panel{background:#fff;border:1px solid var(--ui-border);border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
.admin-panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;border-bottom:1px solid var(--ui-border)}
.admin-panel-title{font-size:14px;font-weight:800;color:#182238}
.admin-panel-body{padding:18px}
.admin-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:17px 0 22px}
.admin-stat{position:relative;min-height:126px;padding:19px 20px;background:#fff;border:1px solid var(--ui-border);border-left:4px solid var(--stat-color,var(--ui-primary));border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
.admin-stat-label{display:flex;align-items:center;gap:7px;color:#838da2;font-size:12px}
.admin-stat-value{margin-top:13px;color:var(--stat-color,var(--ui-primary));font-size:31px;font-weight:850;line-height:1}
.admin-stat-note{margin-top:10px;color:#a0a8b8;font-size:10px}
.admin-stat.is-purple{--stat-color:#5b5cf6}.admin-stat.is-blue{--stat-color:#3b82f6}.admin-stat.is-cyan{--stat-color:#06a7c8}.admin-stat.is-green{--stat-color:#22c55e}.admin-stat.is-orange{--stat-color:#f97316}.admin-stat.is-red{--stat-color:#ef4444}
.admin-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:15px;padding:13px 16px;background:#fff;border:1px solid var(--ui-border);border-radius:var(--ui-radius)}
.admin-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:8px 14px;border:1px solid #dbe1eb;border-radius:9px;background:#fff;color:#3f4b61;font-size:12px;font-weight:750;cursor:pointer;box-shadow:none;transition:.18s ease}
.admin-btn:hover{background:#f7f8fb;border-color:#cfd6e2;transform:none}
.admin-btn.primary{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}
.admin-btn.success{background:#20b85a;border-color:#20b85a;color:#fff}
.admin-btn.danger{color:#dc2626;background:#fff7f7;border-color:#fecaca}
.admin-table-wrap{width:100%;overflow:auto}
.admin-table{width:100%;border-collapse:collapse;font-size:12px;background:#fff}
.admin-table th{padding:12px 14px;background:#fafbfc;border-bottom:1px solid var(--ui-border);color:#7e889a;text-align:left;font-size:10px;font-weight:800;letter-spacing:.03em;white-space:nowrap}
.admin-table td{padding:12px 14px;border-bottom:1px solid #edf0f5;color:#3b4558;vertical-align:middle}
.admin-table tbody tr:hover{background:#fafbff}
.admin-table tbody tr:last-child td{border-bottom:0}
.admin-table a{color:#3347d6;font-weight:750}
.admin-badge{display:inline-flex;align-items:center;padding:4px 9px;border-radius:999px;background:#eef1f6;color:#5e697c;font-size:10px;font-weight:800;white-space:nowrap}
.admin-badge.new,.admin-badge.quoted,.admin-badge.waiting_payment{background:#fff7df;color:#a66a00}
.admin-badge.payment_review,.admin-badge.production{background:#eaf6ff;color:#1570a6}
.admin-badge.shipping{background:#fff0e6;color:#c2570b}
.admin-badge.completed{background:#eaf9ef;color:#14863e}
.admin-badge.cancelled{background:#fff0f0;color:#c43b3b}
.admin-form{max-width:none;padding:20px;background:#fff;border:1px solid var(--ui-border);border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
.admin-form .fields{gap:15px}
.admin-form .field{font-size:12px;color:#4b5568}
.admin-form input,.admin-form select,.admin-form textarea{min-height:42px;padding:10px 12px;border-radius:9px;border:1px solid #dce2eb;background:#fff;font-size:13px}
.admin-form input:focus,.admin-form select:focus,.admin-form textarea:focus{border-color:#9da9ff;box-shadow:0 0 0 3px rgba(68,87,255,.09)}
.admin-form textarea{min-height:110px}
.admin-grid-2{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:18px}
.admin-order-info p{margin:7px 0;color:#526071;font-size:13px}
.admin-empty{padding:42px 20px;text-align:center;color:#9aa3b5}

/* Login */
body.login-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,#e8ebff,transparent 35%),linear-gradient(135deg,#f7f8fb,#eef1f7)}
.login-card{width:min(420px,100%);padding:34px;background:#fff;border:1px solid var(--ui-border);border-radius:18px;box-shadow:0 24px 70px rgba(24,39,75,.13)}
.login-mark{width:48px;height:48px;margin-bottom:18px;border-radius:13px;background:#191b20;color:#fff;display:grid;place-items:center;font-size:13px;font-weight:900;font-style:italic}
.login-card h1{margin:0 0 5px;font-size:23px;color:#172033}
.login-card .login-subtitle{margin:0 0 22px;color:#9099aa;font-size:12px}
.login-card .btn{width:100%;background:var(--ui-primary);box-shadow:none;border-radius:10px}

@media(max-width:1100px){
  .admin-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .admin-grid-2{grid-template-columns:1fr}
}
@media(max-width:760px){
  :root{--ui-sidebar:250px}
  .admin-sidebar{transform:translateX(-100%);transition:transform .22s ease;box-shadow:15px 0 40px rgba(24,39,75,.16)}
  body.admin-menu-open .admin-sidebar{transform:translateX(0)}
  .admin-main{margin-left:0}
  .admin-topbar{padding:0 14px}
  .admin-content{padding:18px 12px 35px}
  .admin-stat-grid{grid-template-columns:1fr 1fr;gap:10px}
  .admin-stat{min-height:112px;padding:15px}
  .admin-stat-value{font-size:27px}
}
@media(max-width:480px){
  .admin-stat-grid{grid-template-columns:1fr}
  .admin-date{display:none}
  .admin-page-title{font-size:14px}
  .admin-form{padding:15px}
}


/* =========================================================
   Bootstrap 5.3 compatibility + Modern UI enhancement layer
   Loaded after Bootstrap so the NAT Design visual identity wins.
   ========================================================= */
:root {
  --bs-body-font-family: "Noto Sans Thai", "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: #14213d;
  --bs-body-bg: #f4f7fb;
  --bs-primary: #0f2d52;
  --bs-primary-rgb: 15,45,82;
  --bs-warning: #f6b51b;
  --bs-warning-rgb: 246,181,27;
  --bs-border-radius: .8rem;
  --bs-border-radius-lg: 1.15rem;
  --bs-box-shadow-sm: 0 8px 24px rgba(15,45,82,.08);
  --bs-box-shadow: 0 16px 44px rgba(15,45,82,.12);
}

/* Prevent Bootstrap's reboot from changing existing custom layout unexpectedly */
body { margin: 0; }
a { text-underline-offset: 3px; }
img, svg { max-width: 100%; }

/* Shared modern cards */
.card,
.admin-panel,
.admin-form,
.login-card {
  border: 1px solid rgba(15,45,82,.10);
  box-shadow: 0 12px 36px rgba(15,45,82,.08);
  backdrop-filter: saturate(120%) blur(4px);
  -webkit-backdrop-filter: saturate(120%) blur(4px);
}

.card,
.admin-panel,
.admin-form {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(15,45,82,.13);
  border-color: rgba(246,181,27,.34);
}

/* Bootstrap utility-friendly buttons while preserving existing .btn / .admin-btn */
.btn,
.admin-btn {
  border-radius: .75rem;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.btn:hover,
.admin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15,45,82,.14);
}
.btn:active,
.admin-btn:active { transform: translateY(0); }

/* Forms benefit from Bootstrap focus treatment */
.form-control,
.form-select,
.field input,
.field select,
.field textarea {
  border-radius: .75rem;
  border: 1px solid #d9e1ec;
  min-height: 44px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.form-control:focus,
.form-select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(246,181,27,.9);
  box-shadow: 0 0 0 .25rem rgba(246,181,27,.16);
  outline: 0;
}

/* Bootstrap responsive table support */
.table-responsive,
.admin-table-wrap {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table,
.admin-table { vertical-align: middle; }

/* Glass-like top navigation */
.top,
.admin-topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

/* Accessibility: visible keyboard focus */
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(246,181,27,.45);
  outline-offset: 2px;
}

/* Motion-safe interaction */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Small screens: Bootstrap-style breathing room and no horizontal overflow */
@media (max-width: 767.98px) {
  html, body { overflow-x: hidden; }
  .wrap, .admin-content { width: 100%; max-width: 100%; }
  .btn, .admin-btn { min-height: 42px; }
  .admin-table { min-width: 720px; }
}

/* Product shop / cart */
.product-shop-grid{display:grid;grid-template-columns:minmax(0,1.06fr) minmax(360px,.94fr);gap:54px;align-items:start}.product-gallery{position:sticky;top:100px}.product-main-image{aspect-ratio:1/1;background:#f6f7f9;border:1px solid var(--line);border-radius:24px;overflow:hidden}.product-main-image img{width:100%;height:100%;object-fit:contain;transition:opacity .18s ease}.product-thumbs{display:flex;gap:10px;margin-top:14px;overflow:auto;padding:2px}.product-thumb{width:78px;height:78px;flex:0 0 78px;border:2px solid transparent;border-radius:12px;background:#fff;padding:4px;cursor:pointer}.product-thumb.active{border-color:var(--gold)}.product-thumb img{width:100%;height:100%;object-fit:cover;border-radius:8px}.product-buy-panel{background:#fff}.product-breadcrumb{display:flex;gap:9px;color:var(--muted);font-size:14px}.product-buy-panel h1{font-size:clamp(30px,4vw,48px);line-height:1.2;margin:14px 0 10px;color:var(--navy-2)}.product-subtitle{color:var(--muted);font-size:18px}.product-price{font-size:34px;font-weight:900;color:#d47b16;background:#fff8ea;padding:14px 18px;border-radius:14px;margin:22px 0}.product-option-group{padding:17px 0;border-bottom:1px solid var(--line)}.product-option-title{font-weight:800;margin-bottom:10px}.product-option-title span{color:#d92d20}.product-option-values{display:flex;flex-wrap:wrap;gap:9px}.product-option-chip input{position:absolute;opacity:0}.product-option-chip span{display:flex;align-items:center;gap:8px;border:1px solid #d7dce5;border-radius:10px;padding:9px 14px;cursor:pointer;background:#fff;transition:.18s}.product-option-chip input:checked+span{border-color:var(--gold);box-shadow:0 0 0 2px rgba(217,164,65,.16);background:var(--gold-soft)}.product-option-chip small{color:#d47b16}.quantity-row{display:flex;align-items:center;gap:20px;padding:22px 0}.quantity-control{display:flex;border:1px solid #d7dce5;border-radius:10px;overflow:hidden}.quantity-control button{width:42px;border:0;background:#f7f8fa;cursor:pointer;font-size:20px}.quantity-control input{width:62px;border:0;text-align:center}.product-buy-actions{display:flex;gap:12px}.product-cart-btn{flex:1}.product-trust{display:grid;grid-template-columns:1fr;gap:10px;margin-top:22px}.product-trust>div{display:grid;grid-template-columns:34px 1fr;column-gap:7px;padding:12px 14px;border:1px solid var(--line);border-radius:12px}.product-trust small{grid-column:2;color:var(--muted)}.product-description-card{margin-top:45px;padding:28px;border:1px solid var(--line);border-radius:20px;background:#fff}.cart-heading{display:flex;justify-content:space-between;align-items:end;margin-bottom:22px}.cart-layout{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:28px}.cart-items{display:grid;gap:12px}.cart-item{display:grid;grid-template-columns:110px minmax(0,1fr) 90px 120px;gap:18px;align-items:center;padding:16px;background:#fff;border:1px solid var(--line);border-radius:16px}.cart-item>img{width:110px;height:110px;object-fit:cover;border-radius:12px;background:#f5f6f8}.cart-item-name{font-size:18px;font-weight:850;color:var(--navy)}.cart-option,.cart-unit{font-size:14px;color:var(--muted)}.cart-item-qty input{width:76px;padding:8px;border:1px solid var(--line);border-radius:9px}.cart-item-qty small{display:block;color:var(--muted);font-size:11px}.cart-line-total{text-align:right}.cart-summary,.checkout-summary{position:sticky;top:100px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;box-shadow:var(--shadow-sm)}.cart-summary>div{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}.cart-summary .cart-grand-total strong{font-size:25px;color:#d47b16}.cart-summary p{font-size:13px;color:var(--muted)}.cart-summary .btn{width:100%}.empty-cart{text-align:center;padding:70px 20px;border:1px dashed #d5dbe5;border-radius:20px}.empty-cart>div{font-size:62px}.checkout-wrap{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:35px}.checkout-item{display:flex;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid var(--line)}.admin-image-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.admin-image-item{border:1px solid var(--line);border-radius:12px;padding:8px}.admin-image-item img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;margin-bottom:8px}.shop-admin-block{margin-top:18px}.option-builder{display:grid;gap:12px}.option-builder input,.option-builder textarea{width:100%;padding:10px;border:1px solid var(--line);border-radius:9px}.option-group-admin{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--line)}.option-group-admin span{display:inline-block;margin:6px 6px 0 0;padding:4px 8px;border-radius:7px;background:#f2f4f7;font-size:12px}.admin-btn.danger{color:#b42318;border-color:#f0c5c0}.field.checkbox{display:flex;align-items:center;gap:8px}.field.checkbox input{width:auto}
@media(max-width:900px){.product-shop-grid,.cart-layout,.checkout-wrap{grid-template-columns:1fr}.product-gallery,.cart-summary,.checkout-summary{position:static}.cart-item{grid-template-columns:84px minmax(0,1fr) 70px}.cart-item>img{width:84px;height:84px}.cart-line-total{grid-column:2/-1}.admin-image-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:560px){.product-shop-grid{gap:25px}.product-buy-actions{flex-direction:column}.cart-heading{align-items:start;gap:10px;flex-direction:column}.cart-item{grid-template-columns:72px 1fr}.cart-item>img{width:72px;height:72px}.cart-item-qty{grid-column:2}.cart-line-total{grid-column:2}.admin-image-grid{grid-template-columns:repeat(2,1fr)}}
.cart-nav-link{display:inline-flex!important;align-items:center;gap:6px}.cart-count{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:99px;background:var(--gold);color:#fff;font-size:12px;font-weight:900}

/* Product detail usability fixes */
.product-main-image{position:relative;isolation:isolate}
.product-main-image img{display:block;will-change:opacity,transform}
.product-main-image img.is-changing{opacity:.18;transform:scale(.985)}
.gallery-nav{position:absolute;z-index:3;top:50%;transform:translateY(-50%);width:44px;height:44px;border:1px solid rgba(15,38,68,.12);border-radius:50%;background:rgba(255,255,255,.92);box-shadow:0 8px 24px rgba(15,38,68,.13);font-size:31px;line-height:1;color:var(--navy);cursor:pointer;display:grid;place-items:center;transition:transform .18s ease,background .18s ease,box-shadow .18s ease}
.gallery-nav:hover{background:#fff;transform:translateY(-50%) scale(1.06);box-shadow:0 12px 30px rgba(15,38,68,.2)}
.gallery-prev{left:14px}.gallery-next{right:14px}
.gallery-counter{position:absolute;z-index:3;right:14px;bottom:14px;padding:6px 11px;border-radius:999px;background:rgba(15,38,68,.76);color:#fff;font-size:13px;backdrop-filter:blur(8px)}
.product-thumbs{scrollbar-width:thin;scroll-snap-type:x proximity}
.product-thumb{scroll-snap-align:start;transition:border-color .18s ease,transform .18s ease,box-shadow .18s ease}
.product-thumb:hover{transform:translateY(-2px)}
.product-thumb.active{box-shadow:0 0 0 2px rgba(217,164,65,.15)}
.product-option-values{align-items:stretch}
.product-option-chip{position:relative;display:inline-flex;max-width:100%}
.product-option-chip span{min-height:44px;justify-content:center;line-height:1.25;word-break:break-word}
.product-option-chip input:focus-visible+span{outline:3px solid rgba(30,110,255,.2);outline-offset:2px}
.product-option-empty{display:grid;gap:4px;margin:8px 0 2px;padding:14px 16px;border:1px dashed #d3dae5;border-radius:12px;background:#f8fafc;color:var(--navy)}
.product-option-empty span{font-size:14px;color:var(--muted)}
.quantity-row{flex-wrap:wrap}
.quantity-control{width:142px;max-width:100%;flex:0 0 142px;background:#fff}
.quantity-control button{flex:0 0 42px;height:42px;padding:0;display:grid;place-items:center}
.quantity-control input{flex:0 0 56px;width:56px;min-width:0;height:42px;padding:0 4px;border-left:1px solid #e1e5ec;border-right:1px solid #e1e5ec;border-radius:0;-moz-appearance:textfield}
.quantity-control input::-webkit-outer-spin-button,.quantity-control input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
@media(max-width:600px){.product-main-image{border-radius:18px}.gallery-nav{width:40px;height:40px}.gallery-prev{left:9px}.gallery-next{right:9px}.product-buy-actions{flex-direction:column}.product-buy-actions .btn{width:100%}.product-option-chip{flex:1 1 calc(50% - 9px)}.product-option-chip span{width:100%;padding:10px}.quantity-row{justify-content:space-between}.quantity-control{width:136px;flex-basis:136px}}


/* Automatic product slideshow + modern motion */
.product-gallery{--slide-duration:650ms}
.product-main-image::after{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.16),transparent 42%,rgba(15,38,68,.035));
}
.product-main-image img{
  position:relative;z-index:0;transform-origin:center center;
  backface-visibility:hidden;transition:none
}
.product-main-image img.slide-out{
  animation:productSlideOut var(--slide-duration) cubic-bezier(.4,0,.2,1) both
}
.product-main-image img.slide-in{
  animation:productSlideIn var(--slide-duration) cubic-bezier(.16,1,.3,1) both
}
.gallery-progress{
  position:absolute;z-index:4;left:18px;right:74px;bottom:18px;height:4px;
  overflow:hidden;border-radius:999px;background:rgba(255,255,255,.46);
  box-shadow:0 1px 6px rgba(15,38,68,.12);backdrop-filter:blur(5px)
}
.gallery-progress span{
  display:block;width:100%;height:100%;border-radius:inherit;
  background:linear-gradient(90deg,var(--gold),#ffca52);
  transform:scaleX(0);transform-origin:left center
}
.gallery-progress span.is-running{animation:galleryProgress linear forwards}
.product-gallery:hover .gallery-progress span.is-running,
.product-gallery:focus-within .gallery-progress span.is-running{animation-play-state:paused}
.product-thumb.active img{animation:thumbPop .35s cubic-bezier(.16,1,.3,1)}
@keyframes productSlideOut{
  0%{opacity:1;transform:scale(1) translateX(0);filter:blur(0)}
  100%{opacity:0;transform:scale(.975) translateX(-10px);filter:blur(2px)}
}
@keyframes productSlideIn{
  0%{opacity:0;transform:scale(1.035) translateX(12px);filter:blur(3px)}
  100%{opacity:1;transform:scale(1) translateX(0);filter:blur(0)}
}
@keyframes galleryProgress{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes thumbPop{0%{transform:scale(.92)}100%{transform:scale(1)}}
@media(max-width:600px){
  .gallery-progress{left:13px;right:66px;bottom:14px;height:3px}
}
@media(prefers-reduced-motion:reduce){
  .product-main-image img.slide-out,.product-main-image img.slide-in,.product-thumb.active img{animation:none!important}
  .gallery-progress{display:none}
}

/* Bootstrap 4 carousel structure, refined with Modern UI */
.modern-card{background:rgba(255,255,255,.94);border:1px solid rgba(15,38,68,.08);border-radius:24px;box-shadow:0 18px 50px rgba(15,38,68,.09);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.product-gallery.modern-card{padding:14px;overflow:hidden}
.product-buy-panel.modern-card{padding:clamp(22px,3vw,36px)}
.product-carousel{position:relative;border-radius:18px;overflow:hidden;background:linear-gradient(145deg,#f8fafc,#eef2f7)}
.product-carousel .carousel-inner{position:relative;width:100%;overflow:hidden;aspect-ratio:1/1}
.product-carousel .carousel-item{position:relative;display:none;width:100%;height:100%;margin-right:-100%;backface-visibility:hidden;transition:transform .65s cubic-bezier(.22,1,.36,1),opacity .65s ease}
.product-carousel .carousel-item.active,.product-carousel .carousel-item-next,.product-carousel .carousel-item-prev{display:block}
.product-carousel .carousel-item-next:not(.carousel-item-left),.product-carousel .active.carousel-item-right{transform:translateX(100%);opacity:.25}
.product-carousel .carousel-item-prev:not(.carousel-item-right),.product-carousel .active.carousel-item-left{transform:translateX(-100%);opacity:.25}
.product-carousel .carousel-item-next.carousel-item-left,.product-carousel .carousel-item-prev.carousel-item-right{transform:translateX(0);opacity:1}
.product-carousel .carousel-item img{width:100%;height:100%;object-fit:contain;padding:18px;transform:scale(1.015);transition:transform 5s ease}
.product-carousel .carousel-item.active img{transform:scale(1)}
.product-carousel .carousel-indicators{position:absolute;right:0;bottom:16px;left:0;z-index:5;display:flex;justify-content:center;gap:8px;padding:0;margin:0 78px;list-style:none}
.product-carousel .carousel-indicators li{box-sizing:content-box;flex:0 1 auto;width:8px;height:8px;border:0;border-radius:999px;background:rgba(255,255,255,.7);box-shadow:0 2px 8px rgba(15,38,68,.2);cursor:pointer;transition:width .25s ease,background .25s ease,transform .25s ease}
.product-carousel .carousel-indicators li.active{width:28px;background:#fff;transform:translateY(-1px)}
.product-carousel .carousel-control-prev,.product-carousel .carousel-control-next{position:absolute;top:50%;z-index:6;display:flex;align-items:center;justify-content:center;width:46px;height:46px;padding:0;border:1px solid rgba(15,38,68,.1);border-radius:50%;background:rgba(255,255,255,.9);box-shadow:0 10px 28px rgba(15,38,68,.16);transform:translateY(-50%);opacity:.94;transition:opacity .2s ease,transform .2s ease,box-shadow .2s ease}
.product-carousel .carousel-control-prev{left:14px}.product-carousel .carousel-control-next{right:14px}
.product-carousel .carousel-control-prev:hover,.product-carousel .carousel-control-next:hover{opacity:1;transform:translateY(-50%) scale(1.07);box-shadow:0 14px 36px rgba(15,38,68,.23)}
.product-carousel .carousel-control-prev-icon,.product-carousel .carousel-control-next-icon{display:inline-block;width:20px;height:20px;background:transparent center/100% 100% no-repeat}
.product-carousel .carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230f2644' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E")}
.product-carousel .carousel-control-next-icon{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230f2644' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")}
.product-carousel .gallery-counter{right:14px;bottom:14px;background:rgba(15,38,68,.72);box-shadow:0 8px 20px rgba(15,38,68,.16)}
.product-carousel .gallery-progress{left:14px;right:14px;bottom:0;height:3px;border-radius:0;background:rgba(255,255,255,.3)}
.product-thumbs{display:flex;gap:10px;margin-top:12px;padding:2px 1px 5px;overflow-x:auto}
.product-thumb{flex:0 0 76px;width:76px;height:76px;padding:4px;border:1px solid rgba(15,38,68,.12);border-radius:14px;background:#fff;box-shadow:0 5px 16px rgba(15,38,68,.06);transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease}
.product-thumb img{width:100%;height:100%;object-fit:cover;border-radius:10px}
.product-thumb:hover{transform:translateY(-3px);box-shadow:0 10px 24px rgba(15,38,68,.12)}
.product-thumb.active{border-color:var(--gold);box-shadow:0 0 0 3px rgba(217,164,65,.16),0 10px 24px rgba(15,38,68,.1)}
.product-option-chip span{box-shadow:0 3px 10px rgba(15,38,68,.035)}
.product-option-chip span:hover{border-color:rgba(217,164,65,.7);transform:translateY(-1px);box-shadow:0 8px 20px rgba(15,38,68,.08)}
.quantity-control{height:44px;border-radius:12px;box-shadow:0 4px 14px rgba(15,38,68,.06)}
.quantity-control button{transition:background .18s ease,color .18s ease}.quantity-control button:hover{background:var(--gold-soft);color:#9b6810}
.product-cart-btn{box-shadow:0 10px 26px rgba(217,164,65,.24);transition:transform .2s ease,box-shadow .2s ease}.product-cart-btn:hover{transform:translateY(-2px);box-shadow:0 15px 34px rgba(217,164,65,.32)}
@media(max-width:600px){.product-gallery.modern-card{padding:9px;border-radius:18px}.product-buy-panel.modern-card{padding:20px;border-radius:18px}.product-carousel{border-radius:14px}.product-carousel .carousel-inner{aspect-ratio:4/5}.product-carousel .carousel-item img{padding:10px}.product-carousel .carousel-control-prev,.product-carousel .carousel-control-next{width:40px;height:40px}.product-carousel .carousel-control-prev{left:9px}.product-carousel .carousel-control-next{right:9px}.product-carousel .carousel-indicators{bottom:12px;margin:0 64px}.product-thumb{flex-basis:64px;width:64px;height:64px}}
@media(prefers-reduced-motion:reduce){.product-carousel .carousel-item,.product-carousel .carousel-item img,.product-thumb,.product-option-chip span,.product-cart-btn{transition:none!important}}

/* =========================================================
   Product carousel definitive fix v9
   Bootstrap 4-compatible class names, Modern UI behavior.
   All product images stay inside one frame and only one slide
   is visible at a time.
   ========================================================= */
#productCarousel.product-carousel{
  position:relative;
  isolation:isolate;
  width:100%;
  overflow:hidden;
  border-radius:20px;
  background:linear-gradient(145deg,#f8fafc 0%,#eef3f8 100%);
  box-shadow:inset 0 0 0 1px rgba(15,38,68,.06);
}

#productCarousel .carousel-inner.product-main-image{
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:1 / 1;
  min-height:300px;
  overflow:hidden;
  border-radius:inherit;
}

#productCarousel .carousel-inner > .carousel-item{
  position:absolute !important;
  inset:0;
  z-index:0;
  display:block !important;
  float:none !important;
  width:100%;
  height:100%;
  margin:0 !important;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translate3d(4%,0,0) scale(.985);
  transition:
    opacity .52s ease,
    transform .66s cubic-bezier(.22,1,.36,1),
    visibility 0s linear .68s;
  backface-visibility:hidden;
  will-change:opacity,transform;
}

#productCarousel .carousel-inner > .carousel-item:first-child{
  position:absolute !important;
}

#productCarousel .carousel-inner > .carousel-item.active{
  z-index:2;
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translate3d(0,0,0) scale(1);
  transition-delay:0s;
}

#productCarousel .carousel-inner > .carousel-item.prepare-right{
  z-index:3;
  opacity:0;
  visibility:visible;
  transform:translate3d(5%,0,0) scale(.985);
}

#productCarousel .carousel-inner > .carousel-item.prepare-left{
  z-index:3;
  opacity:0;
  visibility:visible;
  transform:translate3d(-5%,0,0) scale(.985);
}

#productCarousel .carousel-inner > .carousel-item.slide-out-left,
#productCarousel .carousel-inner > .carousel-item.slide-out-right{
  z-index:1;
  visibility:visible;
  pointer-events:none;
  opacity:0;
}

#productCarousel .carousel-inner > .carousel-item.slide-out-left{
  transform:translate3d(-4%,0,0) scale(.985);
}

#productCarousel .carousel-inner > .carousel-item.slide-out-right{
  transform:translate3d(4%,0,0) scale(.985);
}

#productCarousel .carousel-item > img{
  display:block;
  width:100% !important;
  height:100% !important;
  max-width:100%;
  margin:0;
  padding:clamp(10px,2vw,20px);
  object-fit:contain;
  object-position:center;
  border:0;
  user-select:none;
  -webkit-user-drag:none;
  transform:scale(1.018);
  transition:transform 4.5s ease;
}

#productCarousel .carousel-item.active > img{
  transform:scale(1);
}

#productCarousel .carousel-control-prev,
#productCarousel .carousel-control-next{
  position:absolute;
  top:50%;
  z-index:10;
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  padding:0;
  border:1px solid rgba(15,38,68,.1);
  border-radius:50%;
  background:rgba(255,255,255,.9);
  box-shadow:0 10px 30px rgba(15,38,68,.16);
  color:#0f2644;
  opacity:.95;
  transform:translateY(-50%);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  transition:transform .2s ease,box-shadow .2s ease,opacity .2s ease;
  cursor:pointer;
}

#productCarousel .carousel-control-prev{left:14px}
#productCarousel .carousel-control-next{right:14px}

#productCarousel .carousel-control-prev:hover,
#productCarousel .carousel-control-next:hover{
  opacity:1;
  transform:translateY(-50%) scale(1.08);
  box-shadow:0 14px 36px rgba(15,38,68,.23);
}

#productCarousel .carousel-control-prev:focus-visible,
#productCarousel .carousel-control-next:focus-visible,
#productCarousel .carousel-indicators [data-slide-to]:focus-visible{
  outline:3px solid rgba(217,164,65,.38);
  outline-offset:3px;
}

#productCarousel .carousel-indicators{
  position:absolute;
  right:76px;
  bottom:15px;
  left:76px;
  z-index:11;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:auto;
  padding:0;
  margin:0;
  list-style:none;
  pointer-events:none;
}

#productCarousel .carousel-indicators [data-slide-to]{
  box-sizing:border-box;
  flex:0 0 auto;
  width:9px;
  height:9px;
  min-width:0;
  padding:0;
  margin:0;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.72);
  box-shadow:0 2px 9px rgba(15,38,68,.22);
  opacity:1;
  text-indent:-9999px;
  pointer-events:auto;
  cursor:pointer;
  transition:width .25s ease,background .25s ease,transform .25s ease;
}

#productCarousel .carousel-indicators [data-slide-to].active{
  width:30px;
  background:#fff;
  transform:translateY(-1px);
}

#productCarousel .gallery-counter{
  position:absolute;
  right:14px;
  bottom:14px;
  z-index:11;
  min-width:52px;
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  background:rgba(15,38,68,.72);
  box-shadow:0 8px 24px rgba(15,38,68,.18);
  color:#fff;
  font-size:12px;
  line-height:1;
  text-align:center;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

#productCarousel .gallery-progress{
  position:absolute;
  right:0;
  bottom:0;
  left:0;
  z-index:12;
  height:3px;
  overflow:hidden;
  background:rgba(255,255,255,.3);
  pointer-events:none;
}

#productCarousel .gallery-progress > span{
  display:block;
  width:100%;
  height:100%;
  border-radius:0;
  background:linear-gradient(90deg,var(--gold),#ffd16b);
  transform:scaleX(0);
  transform-origin:left center;
}

#productCarousel .gallery-progress > span.is-running{
  animation:productCarouselProgress linear forwards;
}

@keyframes productCarouselProgress{
  from{transform:scaleX(0)}
  to{transform:scaleX(1)}
}

.product-gallery .product-thumbs{
  display:flex;
  gap:10px;
  width:100%;
  margin-top:12px;
  padding:2px 1px 6px;
  overflow-x:auto;
  overscroll-behavior-inline:contain;
  scroll-snap-type:x proximity;
}

.product-gallery .product-thumb{
  flex:0 0 76px;
  width:76px;
  height:76px;
  padding:4px;
  overflow:hidden;
  border:1px solid rgba(15,38,68,.12);
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 16px rgba(15,38,68,.06);
  scroll-snap-align:start;
  cursor:pointer;
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}

.product-gallery .product-thumb img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:10px;
}

.product-gallery .product-thumb:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 24px rgba(15,38,68,.12);
}

.product-gallery .product-thumb.active{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(217,164,65,.16),0 10px 24px rgba(15,38,68,.1);
}

/* Keep the quantity selector compact on every screen. */
.product-buy-panel .quantity-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:16px;
}

.product-buy-panel .quantity-control{
  display:grid;
  grid-template-columns:42px 56px 42px;
  flex:0 0 auto;
  width:140px !important;
  max-width:140px !important;
  min-width:140px;
  height:42px;
  overflow:hidden;
  border:1px solid rgba(15,38,68,.14);
  border-radius:12px;
  background:#fff;
  box-shadow:0 4px 14px rgba(15,38,68,.06);
}

.product-buy-panel .quantity-control button,
.product-buy-panel .quantity-control input{
  width:100% !important;
  min-width:0 !important;
  height:40px;
  padding:0;
  border:0;
  border-radius:0;
  text-align:center;
}

.product-buy-panel .quantity-control input{
  border-right:1px solid rgba(15,38,68,.1);
  border-left:1px solid rgba(15,38,68,.1);
  appearance:textfield;
  -moz-appearance:textfield;
}

@media(max-width:600px){
  #productCarousel.product-carousel{border-radius:15px}
  #productCarousel .carousel-inner.product-main-image{aspect-ratio:4 / 5;min-height:280px}
  #productCarousel .carousel-item > img{padding:10px}
  #productCarousel .carousel-control-prev,
  #productCarousel .carousel-control-next{width:40px;height:40px}
  #productCarousel .carousel-control-prev{left:9px}
  #productCarousel .carousel-control-next{right:9px}
  #productCarousel .carousel-indicators{right:64px;bottom:12px;left:64px}
  #productCarousel .gallery-counter{right:9px;bottom:10px}
  .product-gallery .product-thumb{flex-basis:64px;width:64px;height:64px}
  .product-buy-panel .quantity-row{justify-content:space-between}
  .product-buy-panel .quantity-control{grid-template-columns:40px 52px 40px;width:132px!important;max-width:132px!important;min-width:132px}
}

@media(prefers-reduced-motion:reduce){
  #productCarousel .carousel-inner > .carousel-item,
  #productCarousel .carousel-item > img,
  #productCarousel .carousel-control-prev,
  #productCarousel .carousel-control-next,
  #productCarousel .carousel-indicators [data-slide-to],
  .product-gallery .product-thumb{
    transition:none !important;
  }
  #productCarousel .gallery-progress{display:none}
}

/* =========================================================
   Product thumbnail strip v10 — Shopee-style horizontal row
   ========================================================= */
.product-gallery.modern-card > .product-thumbs,
.product-gallery .product-thumbs[role="tablist"]{
  display:grid !important;
  grid-auto-flow:column;
  grid-auto-columns:72px;
  grid-template-rows:72px;
  justify-content:start;
  align-items:center;
  gap:10px;
  width:100%;
  max-width:100%;
  min-height:78px;
  margin:12px 0 0;
  padding:3px 2px 6px;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  scrollbar-width:none;
  -ms-overflow-style:none;
  touch-action:pan-x;
}

.product-gallery .product-thumbs::-webkit-scrollbar{
  display:none;
  width:0;
  height:0;
}

.product-gallery .product-thumbs > button.product-thumb{
  display:block !important;
  position:relative;
  flex:none !important;
  width:72px !important;
  min-width:72px !important;
  max-width:72px !important;
  height:72px !important;
  min-height:72px !important;
  max-height:72px !important;
  aspect-ratio:1 / 1;
  margin:0 !important;
  padding:3px !important;
  overflow:hidden;
  border:2px solid transparent !important;
  border-radius:8px !important;
  background:#fff !important;
  box-shadow:0 2px 8px rgba(15,38,68,.08) !important;
  scroll-snap-align:start;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease !important;
}

.product-gallery .product-thumbs > button.product-thumb::after{
  content:"";
  position:absolute;
  inset:3px;
  border-radius:5px;
  box-shadow:inset 0 0 0 1px rgba(15,38,68,.06);
  pointer-events:none;
}

.product-gallery .product-thumbs > button.product-thumb > img{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  height:100% !important;
  min-height:0 !important;
  max-height:none !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:5px !important;
  object-fit:cover !important;
  object-position:center !important;
  transform:none;
}

.product-gallery .product-thumbs > button.product-thumb:hover{
  z-index:2;
  transform:translateY(-2px) !important;
  border-color:rgba(217,164,65,.55) !important;
  box-shadow:0 7px 18px rgba(15,38,68,.14) !important;
}

.product-gallery .product-thumbs > button.product-thumb.active,
.product-gallery .product-thumbs > button.product-thumb[aria-current="true"]{
  z-index:3;
  border-color:var(--gold) !important;
  box-shadow:0 0 0 1px var(--gold),0 7px 18px rgba(15,38,68,.14) !important;
}

.product-gallery .product-thumbs > button.product-thumb:focus-visible{
  outline:3px solid rgba(217,164,65,.28);
  outline-offset:2px;
}

@media(max-width:600px){
  .product-gallery.modern-card > .product-thumbs,
  .product-gallery .product-thumbs[role="tablist"]{
    grid-auto-columns:58px;
    grid-template-rows:58px;
    gap:8px;
    min-height:64px;
    margin-top:9px;
    padding-bottom:4px;
  }

  .product-gallery .product-thumbs > button.product-thumb{
    width:58px !important;
    min-width:58px !important;
    max-width:58px !important;
    height:58px !important;
    min-height:58px !important;
    max-height:58px !important;
    border-radius:7px !important;
  }
}

@media(prefers-reduced-motion:reduce){
  .product-gallery .product-thumbs,
  .product-gallery .product-thumbs > button.product-thumb{
    scroll-behavior:auto !important;
    transition:none !important;
  }
}



/* Product thumbnail strip v11 fallback */
#ndProductThumbsV11{display:flex!important;flex-flow:row nowrap!important;gap:10px!important;overflow-x:auto!important;overflow-y:hidden!important;width:100%!important;max-width:100%!important}
#ndProductThumbsV11>.nd-product-thumb-v11{display:block!important;flex:0 0 72px!important;width:72px!important;min-width:72px!important;max-width:72px!important;height:72px!important;min-height:72px!important;max-height:72px!important;padding:3px!important;margin:0!important;overflow:hidden!important}
#ndProductThumbsV11>.nd-product-thumb-v11>img{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:cover!important}



#productCarousel .carousel-item > img.product-slide-image{
  width:min(82%, 520px) !important;
  height:min(82%, 520px) !important;
  max-width:calc(100% - 36px) !important;
  max-height:calc(100% - 36px) !important;
  margin:auto !important;
  padding:0 !important;
  object-fit:contain !important;
  object-position:center !important;
}

@media(max-width:600px){
  #productCarousel .carousel-item > img.product-slide-image{
    width:min(90%, 360px) !important;
    height:min(90%, 360px) !important;
    max-width:calc(100% - 20px) !important;
    max-height:calc(100% - 20px) !important;
  }
}


/* =========================================================
   Product carousel image sizing v13
   Resize only the image; carousel-item visibility remains
   controlled by the active class and JavaScript.
   ========================================================= */
#productCarousel .carousel-item > img.product-slide-image{
  position:absolute !important;
  top:50% !important;
  left:50% !important;
  width:min(82%, 520px) !important;
  height:min(82%, 520px) !important;
  max-width:calc(100% - 36px) !important;
  max-height:calc(100% - 36px) !important;
  margin:0 !important;
  padding:0 !important;
  object-fit:contain !important;
  object-position:center !important;
  transform:translate(-50%,-50%) scale(1.018) !important;
  transition:transform 4.5s ease, opacity .35s ease !important;
}

#productCarousel .carousel-item.active > img.product-slide-image{
  transform:translate(-50%,-50%) scale(1) !important;
}

@media(max-width:600px){
  #productCarousel .carousel-item > img.product-slide-image{
    width:min(90%, 360px) !important;
    height:min(90%, 360px) !important;
    max-width:calc(100% - 20px) !important;
    max-height:calc(100% - 20px) !important;
  }
}
