/* หน้าสินค้า — ขอบเขตอยู่ใต้ .shop เพื่อไม่ชนกับ style.css
   ใช้ตัวแปรสีกลางของเว็บ (--green, --ink, --muted ฯลฯ) ไม่ประกาศพาเลตต์ใหม่ */
.shop{--rule:#ddd7c6;--gap:24px;color:var(--ink)}
.shop h1,.shop h2,.shop h3{font-family:"Kanit",sans-serif;font-weight:500;line-height:1.3}

/* Hero: ภาพพื้นหลัง + ชั้นมืดเดียว ไม่มีเอฟเฟกต์ซ้อน */
.shop-hero{position:relative;display:flex;align-items:flex-end;min-height:300px;padding-block:48px;
  color:#fff;background:var(--green-d) center/cover}
.shop-hero::before{content:"";position:absolute;inset:0;background:rgb(10 35 22/.55)}
.shop-hero .wrap{position:relative}
.shop-hero h1{font-size:clamp(28px,4vw,42px);margin:6px 0 12px}
.shop-brand{font-size:14px;letter-spacing:.04em;opacity:.85}

.crumb{display:flex;align-items:center;gap:6px;padding-block:16px;font-size:14px;color:var(--muted)}
.crumb a{color:var(--green)}

.shop-layout{display:grid;grid-template-columns:240px 1fr;gap:40px;padding-bottom:64px}

/* Sidebar: เส้นคั่น ไม่ใช้กล่องเงา */
.shop-side section{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid var(--rule)}
.shop-side h2{font-size:15px;margin-bottom:10px}
.cat{display:flex;justify-content:space-between;padding:8px 0;font-size:14.5px}
.cat.on{color:var(--green);font-weight:600}
.cat span{color:var(--muted);font-weight:400}
.contacts{list-style:none;padding:0;display:grid;gap:8px;font-size:14px;overflow-wrap:anywhere}
.contacts li{display:flex;gap:10px;align-items:baseline}
.contacts .ic{color:var(--green);translate:0 2px}
.qr{margin:16px 0 0;display:flex;gap:12px;align-items:center;font-size:13px;color:var(--muted)}
.qr img{width:84px;height:84px;object-fit:contain;border:1px solid var(--rule);background:#fff}

.shop-bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;
  padding-bottom:14px;margin-bottom:var(--gap);border-bottom:1px solid var(--rule)}
.shop-bar h2{font-size:22px}
.sort{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted)}
.sort select{border:1px solid var(--rule);border-radius:6px;padding:7px 10px;font:inherit;color:var(--ink);background:#fff}

/* Grid: การ์ดเรียบ แยกด้วยเส้นขอบ ไม่ยกลอย */
.items{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:var(--gap)}
.item{display:flex;flex-direction:column;background:#fff;border:1px solid var(--rule);border-radius:8px;overflow:hidden}
.item-img{display:block;background:var(--sand)}
.item-img .card-img{height:180px;width:100%;object-fit:cover}
.item-body{display:flex;flex-direction:column;flex:1;padding:16px}
.item-flag{font-size:12px;font-weight:600;color:var(--gold);margin-bottom:2px}
.item h3{font-size:16px}
.item h3 a:hover{color:var(--green)}
.item-sub{font-size:13px;color:var(--muted);margin:2px 0 8px}
.item-rate{font-size:13px;margin-bottom:6px}
.item-price{font:500 18px "Kanit",sans-serif;color:var(--green);margin-top:auto;padding-bottom:12px}
.item-buy{display:grid;gap:10px}
.item-buy .btn{width:100%;font-size:14px}
.qty{display:flex}
.qty button,.qty input{height:36px;border:1px solid var(--rule);background:#fff;color:var(--ink)}
.qty button{width:36px;display:grid;place-items:center;cursor:pointer}
.qty button:first-child{border-radius:6px 0 0 6px}
.qty button:last-child{border-radius:0 6px 6px 0}
.qty button:hover{background:var(--sand)}
.qty input{flex:1;min-width:0;border-inline:0;text-align:center;font:inherit;-moz-appearance:textfield}
.qty input::-webkit-outer-spin-button,.qty input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

.pager{display:flex;justify-content:center;gap:6px;margin-top:40px}
.pager a{min-width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--rule);border-radius:6px;font-size:14px}
.pager a:hover{border-color:var(--green)}
.pager a.on{background:var(--green);border-color:var(--green);color:#fff}

@media(max-width:860px){
  .shop-layout{grid-template-columns:minmax(0,1fr);gap:28px}
  .shop-side{order:2}
}

/* โหมดแอปบนมือถือ — เงื่อนไขเดียวกับ mobile.css (แถบเมนูล่างแทนเมนูบน) */
@media (max-width:760px),(pointer:coarse) and (max-height:520px){
  .shop-hero{min-height:0;padding-block:28px 22px}
  .shop-hero h1{font-size:26px;margin:4px 0 8px}
  .shop-hero p:last-child{font-size:14px}
  .crumb{display:none}
  .shop-layout{padding-top:0;padding-bottom:24px;gap:20px}

  /* แถบเรียงสินค้าค้างบนสุดตอนเลื่อน อยู่ใต้ header */
  .shop-bar{position:sticky;top:56px;z-index:30;margin:0 -16px 14px;padding:10px 16px;
    background:var(--cream);border-bottom:1px solid var(--rule)}
  .shop-bar h2{font-size:18px}
  .sort label{display:none}
  .sort select{min-height:42px}

  .items{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .item-img .card-img{height:130px}
  .item-body{padding:10px 10px 12px}
  .item h3{font-size:15px}
  .item-sub{font-size:12px;min-height:34px;margin-bottom:4px}
  .item-rate{font-size:12px}
  .item-price{font-size:17px;padding-bottom:8px}
  .item-buy .btn{min-height:44px;padding-inline:8px;font-size:13px}
  .qty button,.qty input{height:42px}
  .qty button{width:44px}

  .pager a{min-width:44px;height:44px}

  /* ข้อมูลติดต่ออยู่ท้ายหน้า เรียงแนวตั้งเต็มความกว้าง */
  .shop-side section{border-bottom:0;padding-bottom:0}
  .shop-side .cat{display:none}
  .shop-side section:first-child{display:none}
  .contacts li{padding:6px 0;font-size:15px}
}
@media (max-width:360px){
  .item-img .card-img{height:112px}
  .item-body{padding:8px}
}

.item-wnote{margin:-6px 0 10px;font-size:12.5px;color:#7a5b00;line-height:1.4}

/* ร้านค้าในเครือข่าย: วงกลมเรียงแถวเดียว ปัดเลื่อนซ้าย-ขวาได้ */
.net{padding-block:4px 14px}
.net-t{font-size:17px;margin-bottom:10px;color:var(--ink)}
.net-t small{font:400 13px "Sarabun",sans-serif;color:var(--muted)}
.net-row{list-style:none;padding:4px 2px 8px;margin:0 -2px;display:flex;gap:18px;overflow-x:auto;overscroll-behavior-x:contain;
  scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none;cursor:grab;user-select:none}
.net-row::-webkit-scrollbar{display:none}
.net-row.dragging{cursor:grabbing;scroll-snap-type:none}
.net-row li{flex:none;scroll-snap-align:start}
.net-row a{display:grid;justify-items:center;gap:6px;width:84px;text-align:center;-webkit-user-drag:none}
.net-row b{font:500 13px/1.3 "Kanit",sans-serif;max-width:84px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--ink)}
.net-row a.on b{color:var(--green)}
.net-row a.on .shop-av{box-shadow:0 0 0 3px var(--green)}
.net-row a:hover .shop-av{box-shadow:0 0 0 2px var(--green)}

/* โปรไฟล์ร้านที่เลือกอยู่ */
.shop-prof{display:flex;gap:18px;align-items:center;margin-bottom:20px;padding:18px;border:1px solid var(--rule);border-radius:8px;background:#fff}
.shop-prof h2{font-size:20px;color:var(--green)}
.shop-prof-tag{color:var(--muted);font-size:14px}
.shop-prof-d{margin-top:6px;font-size:14px;line-height:1.7}
.shop-prof-meta{list-style:none;padding:0;margin:8px 0 0;display:flex;flex-wrap:wrap;gap:4px 16px;font-size:13.5px;color:var(--muted)}
.shop-prof-meta .ic{color:var(--green);vertical-align:-2px}
.item-shop{display:flex;align-items:center;gap:5px;font-size:12.5px;color:var(--muted);margin:0 0 4px}
.item-shop .ic{color:var(--green)}

@media (max-width:760px),(pointer:coarse) and (max-height:520px){
  .net{padding-block:14px 6px}
  .net-t{font-size:15px;margin-bottom:6px}
  .net-row{gap:14px;margin-inline:-16px;padding-inline:16px;scroll-padding-inline:16px;scroll-snap-type:x mandatory}
  .shop-av{width:64px;height:64px}
  .shop-prof{flex-direction:column;text-align:center;padding:16px}
  .shop-prof-meta{justify-content:center}
}
