/* หน้าร้าน PNPR — ธีมขาว สีส้มวินเทจ + กรมท่า แบบห้างวัสดุก่อสร้าง */
body { background: #f5f6f8; }
.wrap { max-width: 1240px; }

.announce { background: var(--navy); font-weight: 500; }

/* ส่วนหัว */
.topbar { position: sticky; top: 0; z-index: 40; background: #fff; box-shadow: 0 1px 0 var(--sep), 0 2px 10px rgba(0,0,0,.04); }
.top-row { display: flex; align-items: center; gap: 18px; height: 72px; }
.logo-link { display: flex; align-items: center; gap: 10px; color: var(--label); flex: none; }
.logo-link img { width: 44px; height: 44px; border-radius: 11px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text b { font-family: Rockwell, "Roboto Slab", Georgia, serif; font-size: 22px; letter-spacing: .06em; color: var(--tint-ink); }
.logo-text small { font-size: 12px; color: var(--label2); max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bigsearch { flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; border: 2px solid var(--tint); border-radius: 12px; padding: 0 14px; background: #fff; color: var(--label2); }
.bigsearch svg { width: 20px; height: 20px; flex: none; }
.bigsearch input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.act { position: relative; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 10px; cursor: pointer; color: var(--navy); font-size: 12px; font-weight: 500; border-radius: 10px; }
.act:hover { background: #f2f3f5; }
.act svg { width: 25px; height: 25px; }
.act .badge { top: 0; right: 4px; font-style: normal; background: var(--tint); }
.catbar { background: var(--navy); }
.catbar .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.catbar .wrap::-webkit-scrollbar { display: none; }
.catbar button { flex: none; border: 0; background: transparent; color: rgba(255,255,255,.88); font-size: 15px; font-weight: 500; padding: 11px 14px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.catbar button:hover { color: #fff; }
.catbar button.on { color: #fff; border-bottom-color: var(--tint); font-weight: 600; }
@media (max-width: 760px) {
  .top-row { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .bigsearch { order: 3; flex-basis: 100%; height: 42px; }
  .top-actions { margin-left: auto; }
  .act span { display: none; }
  .act { padding: 6px; }
  .logo-text small { max-width: 150px; }
}

/* แบนเนอร์ */
.hero { position: relative; margin-top: 18px; border-radius: 18px; overflow: hidden; display: flex; align-items: center; min-height: 260px; background: linear-gradient(115deg, #fff7ee 0%, #ffe9d3 55%, #ffd9b3 100%); border: 1px solid #f6dcc0; }
.hero.has-img { background-size: cover; background-position: center; }
.hero.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.8) 45%, rgba(255,255,255,0) 75%); }
.hero-text { position: relative; flex: 1; padding: 34px 36px; max-width: 640px; }
.hero-badge { display: inline-block; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; padding: 5px 12px; border-radius: 8px; margin-bottom: 12px; }
.hero-badge:empty { display: none; }
.hero h1 { font-size: 38px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; color: var(--navy); white-space: pre-line; }
.hero p { margin: 0 0 20px; color: #4a5563; font-size: 17px; white-space: pre-line; }
.hero-img { position: relative; flex: none; padding: 24px 48px 24px 0; }
.hero-logo { width: 180px; height: 180px; filter: drop-shadow(0 16px 30px rgba(200,86,26,.3)); transform: rotate(-6deg); }
.hero.has-img .hero-img { display: none; }
.hero-img-btn { position: absolute; right: 12px; bottom: 12px; }
@media (max-width: 760px) { .hero { min-height: 0; } .hero-img { display: none; } .hero-text { padding: 24px 20px; } .hero h1 { font-size: 28px; } }

/* จุดเด่น */
.usp { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.usp div { background: #fff; border: 1px solid #eceef1; border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 500; }
.usp div::before { content: "✓"; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #fff1e4; color: var(--tint-ink); display: grid; place-items: center; font-weight: 800; }
.usp:empty { display: none; }

.sec-row { display: flex; align-items: center; gap: 12px; }
.sec-h { font-size: 22px; font-weight: 700; margin: 28px 0 12px; flex: 1; color: var(--navy); }
.sec-h::before { content: ""; display: inline-block; width: 5px; height: 20px; background: var(--tint); border-radius: 3px; margin-right: 10px; vertical-align: -3px; }
.sort { margin-top: 16px; border: 1px solid #dfe2e6; background: #fff; border-radius: 10px; padding: 7px 10px; font-size: 14px; }

/* หมวดหมู่ */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.cat-tile { background: #fff; border: 1px solid #eceef1; border-radius: 14px; padding: 16px 8px; text-align: center; cursor: pointer; transition: .15s; }
.cat-tile:hover { border-color: var(--tint); box-shadow: 0 6px 18px rgba(232,113,26,.12); transform: translateY(-2px); }
.cat-tile i { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%; background: #fff4e9; font-size: 30px; font-style: normal; }
.cat-tile span { font-size: 14px; font-weight: 600; }
@media (max-width: 400px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } .cat-tile i { width: 46px; height: 46px; font-size: 24px; } .cat-tile span { font-size: 12px; } }

/* การ์ดสินค้า */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr 1fr; gap: 8px; } }
.pcard { position: relative; background: #fff; border: 1px solid #eceef1; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { border-color: #f3c9a3; box-shadow: 0 8px 22px rgba(0,0,0,.07); }
.pimg { aspect-ratio: 1; background: #fafafa; display: grid; place-items: center; font-size: 64px; overflow: hidden; position: relative; }
.pimg img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.credit { line-height: 1.5; }
.credit a { color: var(--label2); text-decoration: underline; }
.tag { position: absolute; top: 8px; left: 8px; z-index: 1; }
.disc { background: var(--red); color: #fff; font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 6px; }
.pbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pname { font-size: 15px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; color: #1f2933; }
.pprice { font-size: 21px; font-weight: 700; color: var(--red); }
.pprice small { font-size: 13px; color: var(--label2); font-weight: 400; }
.pold { font-size: 13px; color: var(--label2); text-decoration: line-through; min-height: 1.2em; }
.padd { margin-top: auto; padding-top: 6px; }
.padd .btn { width: 100%; min-height: 38px; font-size: 15px; padding: 6px 10px; border-radius: 10px; }
.pedit { position: absolute; top: 8px; right: 8px; z-index: 2; }

/* รายละเอียดสินค้า */
.pd-img { aspect-ratio: 4/3; border-radius: var(--r); font-size: 96px; margin-bottom: 14px; border: 1px solid #eceef1; }
.pd-name { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.pd-price { font-size: 30px; font-weight: 700; margin: 6px 0 12px; color: var(--red); }
.pd-desc { white-space: pre-line; color: #4a5563; margin: 0 0 16px; }
.stepper { display: inline-flex; align-items: center; background: #f1f2f4; border-radius: 10px; }
.stepper button { border: 0; background: transparent; width: 40px; height: 38px; font-size: 22px; cursor: pointer; }
.stepper input { width: 46px; text-align: center; border: 0; background: transparent; font-weight: 600; font-size: 17px; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pd-actions { display: flex; gap: 12px; align-items: center; }
.pd-actions .btn { flex: 1; }

/* ตะกร้า + ขั้นตอน */
.steps { display: flex; gap: 6px; padding: 0 16px 12px; flex: none; }
.st { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label2); padding-bottom: 8px; border-bottom: 3px solid #e3e5e8; }
.st i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: #e3e5e8; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.st.on { color: var(--label); font-weight: 600; border-color: var(--tint); }
.st.on i { background: var(--tint); }
.st.done { border-color: #f3c9a3; }
.st.done i { background: #f3a96a; }
.sheet { background: #f5f6f8; }
.cline { display: flex; gap: 12px; align-items: center; }
.cline .pimg { width: 62px; height: 62px; border-radius: 10px; font-size: 28px; flex: none; border: 1px solid #eceef1; }
.cline .info { flex: 1; min-width: 0; }
.cline .info b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cline .stepper button { width: 32px; height: 30px; font-size: 18px; }
.cline .stepper input { width: 34px; font-size: 15px; }
.summary .row { justify-content: space-between; }
.summary .row.total { font-weight: 700; font-size: 19px; }
.summary .row.total span:last-child { color: var(--red); }
.ship-hint { font-size: 13px; color: var(--tint-ink); text-align: center; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }
.actions-row { display: flex; gap: 10px; margin-top: 14px; }
.actions-row .btn:last-child { flex: 1; }

.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--sep); }
.cart-bar .btn { max-width: 680px; margin: 0 auto; display: flex; }
body.has-bar { padding-bottom: 90px; }

/* ท้ายเว็บ */
.footer { margin-top: 48px; background: var(--navy); color: rgba(255,255,255,.82); padding: 32px 0 20px; font-size: 15px; }
.footer a { color: #ffd2a8; }
.footer b { color: #fff; }
.footer h4 { color: #fff; margin: 4px 0 10px; font-size: 16px; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; }
.foot-grid img { border-radius: 12px; }
.foot-grid p { margin: 8px 0 0; white-space: pre-line; }
#foot-contact div { margin-bottom: 6px; }
.steps-list { margin: 0; padding-left: 18px; line-height: 1.9; }
.copy { border-top: 1px solid rgba(255,255,255,.15); margin-top: 22px; padding-top: 14px; color: rgba(255,255,255,.55); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

.orow { cursor: pointer; color: var(--label); }
.orow .info { flex: 1; min-width: 0; }
.orow .chev { color: var(--label3); font-size: 20px; }

/* โหมดแก้ไขหน้าเว็บ (แอดมิน) */
.edit-only { display: none !important; }
body.editing .edit-only { display: inline-flex !important; }
body.editing [data-edit] { outline: 2px dashed var(--tint); outline-offset: 3px; border-radius: 4px; cursor: text; min-width: 40px; min-height: 1em; }
body.editing [data-edit]:empty::before { content: "+ ..."; color: var(--label3); }
body.editing .hidden[data-edit] { display: block !important; }
body.editing [data-edit]:focus { outline-style: solid; background: rgba(255,255,255,.7); }
.editbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 120; background: #16181d; color: #fff; border-radius: 16px; padding: 8px 8px 8px 14px; display: flex; gap: 8px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100% - 24px); flex-wrap: wrap; }
.editbar .eb-title { font-size: 14px; font-weight: 600; margin-right: 4px; }
.editbar .btn.gray { background: #2c2f36; color: #fff; }
body.has-bar .editbar { bottom: calc(84px + env(safe-area-inset-bottom)); }
