.shop-body{margin:0;background:#fff;color:#111;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial}
.shop-topbar{position:sticky;top:0;z-index:10;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border-bottom:1px solid #eee}
.shop-topbar__inner{max-width:1100px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.shop-brand{display:flex;align-items:center;gap:16px}
.shop-brand__logo{width:50px;height:50px;border-radius:12px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900}
.shop-brand__name{font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: .2px;
  line-height: 1.05;}
.shop-brand__domain{font-size:14px;color:#666;margin-top:1px}
.shop-nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.shop-nav__link{color:#222;text-decoration:none;font-weight:700;font-size:13px;padding:8px 10px;border-radius:12px}
.shop-nav__link:hover{background:#f4f4f4}
.shop-nav__btn{color:#fff;background:#111;text-decoration:none;font-weight:900;font-size:13px;padding:9px 12px;border-radius:12px}
.shop-main{padding:18px 0}
.shop-hero__inner{max-width:1100px;margin:0 auto;padding:0 16px;display:grid;grid-template-columns:1.1fr .9fr;gap:16px}
@media (max-width:900px){.shop-hero__inner{grid-template-columns:1fr}}
.shop-kicker{color:#666;font-weight:800;letter-spacing:.02em}
/* D2 PATCH — reduce product headline size */
.shop-headline{
  font-size: 1.8rem;      /* เดิมมักจะ ~2.8–3rem */
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.3px;
}

/* Tablet */
@media (max-width: 1024px){
  .shop-headline{
    font-size: 1.8rem;
  }
}

/* Mobile */
@media (max-width: 520px){
  .shop-headline{
    font-size: 1.55rem;
    line-height: 1.2;
  }
}

@media (max-width:900px){.shop-headline{font-size:34px}}
.shop-subheadline{color:#444;margin:0 0 14px 0;font-size:15px;line-height:1.5}
.shop-cta{display:flex;gap:10px;flex-wrap:wrap}
.shop-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 14px;border-radius:14px;text-decoration:none;font-weight:900;font-size:13px;border:1px solid #e6e6e6}
.shop-btn--primary{background:#111;color:#fff;border-color:#111}
.shop-btn--ghost{background:#fff;color:#111}
.shop-hero-hint{margin-top:14px;color:#888;font-weight:900;font-size:12px;letter-spacing:.12em}
.shop-hero-card{border:1px solid #eee;border-radius:18px;overflow:hidden;background:#fff}
/* ===== D2 HERO SIZE FIX ===== */

/* เปลี่ยนกรอบ Hero เป็น 16:9 */
.shop-hero-imgwrap{
  aspect-ratio: 16 / 9;
  max-height: 620px;        /* ปรับใหญ่-เล็กได้ */
  background: #f6f6f6;
}

/* ให้รูปไม่ถูกบีบ */
.shop-hero-img{
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ยกเลิกการล็อค section hero */
.shop-hero{
  max-height: none;
  overflow: visible;
  display: block;
}

/* มือถือ */
@media (max-width: 900px){
  .shop-hero-imgwrap{
    max-height: 340px;
  }
}
.shop-hero-fallback{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}
.shop-hero-fallback__badge{background:#111;color:#fff;font-weight:1000;border-radius:999px;padding:6px 10px}
.shop-hero-card__note{padding:12px 14px;border-top:1px solid #eee}
.shop-note__title{font-weight:1000}
.shop-note__desc{color:#555;font-size:13px;margin-top:4px}

.shop-section{margin-top:28px}
.shop-section__inner{max-width:1100px;margin:0 auto;padding:0 16px}
.shop-section__head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.shop-section__title{margin:0;font-size:20px;font-weight:1000}
.shop-section__sub{margin:0;color:#666;font-size:13px}

.shop-features{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media (max-width:900px){.shop-features{grid-template-columns:1fr}}
.shop-feature{border:1px solid #eee;border-radius:18px;padding:14px;background:#fff}
.shop-feature__icon{font-size:18px}
.shop-feature__title{font-weight:1000;margin-top:6px}
.shop-feature__desc{color:#555;font-size:13px;margin-top:4px;line-height:1.4}

.shop-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media (max-width:900px){.shop-grid{grid-template-columns:1fr}}
.shop-item{border:1px solid #eee;border-radius:18px;overflow:hidden;background:#fff}
.shop-item__imgbtn{padding:0;border:0;background:transparent;display:block;width:100%;cursor:pointer;position:relative}
.shop-item__img{width:100%;height:240px;object-fit:cover;background:#f6f6f6}
.shop-item__tag{
  position: relative;
  top: auto;
  left: auto;
  margin-bottom: 12px;
}

.shop-item__body{padding:12px 14px}
.shop-item__row{display:flex;justify-content:space-between;gap:10px}
.shop-item__name{font-weight:1000}
.shop-item__price{font-weight:1000;color:#111}
.shop-item__desc{
  visibility: hidden;
  height: 0;
  margin: 0;
}

.shop-section--contact .shop-contact{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:900px){.shop-section--contact .shop-contact{grid-template-columns:1fr}}
.shop-contact__card,.shop-mapbox{border:1px solid #eee;border-radius:18px;padding:14px;background:#fff}
.shop-contact__title{font-weight:1000}
.shop-contact__value{color:#333;margin-top:6px}
.shop-contact__split{height:1px;background:#eee;margin:12px 0}
.shop-contact__row{display:flex;justify-content:space-between;gap:10px;padding:6px 0}
.shop-contact__k{color:#666;font-weight:800}
.shop-contact__v{font-weight:900}
.shop-contact__actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.shop-mapbox__hint{font-weight:1000}
.shop-mapbox__url{color:#555;margin-top:6px;word-break:break-all}

.shop-footer{margin-top:26px;border-top:1px solid #eee}
.shop-footer__inner{max-width:1100px;margin:0 auto;padding:14px 16px;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;color:#666;font-size:13px}
.shop-footer__links a{color:#111;text-decoration:none;font-weight:900;margin-left:10px}

.shop-modal{position:fixed;inset:0;display:none}
.shop-modal.is-open{display:block}
.shop-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.shop-modal__panel{position:relative;max-width:900px;margin:6vh auto;background:#fff;border-radius:18px;overflow:hidden;border:1px solid #eee}
.shop-modal__close{position:absolute;top:10px;right:10px;border:0;background:#111;color:#fff;width:36px;height:36px;border-radius:12px;font-size:20px;cursor:pointer}
.shop-modal__imgwrap{background:#f6f6f6}
.shop-modal__imgwrap img{width:100%;max-height:70vh;object-fit:contain;display:block}
.shop-modal__meta{padding:12px 14px}
.shop-modal__name{font-weight:1000}
.shop-modal__desc{color:#555;font-size:13px;margin-top:6px;line-height:1.4}

/* --- D2 ADD: product dropdown + shop admin helpers (keep existing theme) --- */
.shop-nav__group{display:flex;align-items:center;gap:10px;margin-right:10px}
.shop-nav__label{opacity:.9;font-weight:700}
.shop-nav__select{
  padding:8px 10px;border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.25);color:#fff;outline:none
}

/* feature icon image */
.shop-feature__icon--img{display:flex;align-items:center;justify-content:center;overflow:hidden}
.shop-feature__icon--img img{width:34px;height:34px;object-fit:cover;border-radius:10px}

/* admin */
.shop-admin-grid{display:grid;grid-template-columns:360px 1fr;gap:16px}
@media (max-width: 980px){.shop-admin-grid{grid-template-columns:1fr}}
.shop-admin-card{border:1px solid rgba(255,255,255,.12);border-radius:16px;padding:14px;background:rgba(0,0,0,.18)}
.shop-admin-title{font-weight:900;margin-bottom:8px}
.shop-admin-label{display:block;margin:10px 0 6px 0;opacity:.92}
.shop-admin-input,.shop-admin-select{
  width:100%;padding:10px 12px;border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.25);color:#fff;outline:none
}
.shop-admin-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.shop-admin-split{height:1px;background:rgba(255,255,255,.10);margin:12px 0}
.shop-admin-row{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0}
.shop-admin-mini{flex:1;min-width:180px}
.shop-admin-mini label{display:block;margin:0 0 6px 0;opacity:.9;font-size:.9rem}
.shop-admin-msg{margin-top:10px;opacity:.95}
.shop-admin-msg.ok{color:#b9ffcf}
.shop-admin-msg.err{color:#ffb9b9}
/* D2 PATCH — modal scroll */
.shop-modal{
  overflow: auto;              /* เผื่อบางเบราว์เซอร์ */
}

.shop-modal__panel{
  max-height: calc(100vh - 40px);  /* กันชนบนล่าง */
  overflow: auto;                  /* ทำ scrollbar ใน panel */
  -webkit-overflow-scrolling: touch;
}

/* กัน list ยาวๆ ให้เลื่อนสบายขึ้น (optional แต่ช่วยมาก) */
#featList{
  max-height: calc(100vh - 220px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* D2 PATCH — modal must be top-most */
.shop-modal{
  position: fixed;
  inset: 0;
  z-index: 99999;          /* สูงพอให้ทับทุกอย่าง */
  display: none;           /* JS เปิดเป็น block */
}

.shop-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.shop-modal__panel{
  position: relative;
  z-index: 100000;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

/* D2 FIX — ซ่อนข้อความแหล่งที่มา (Preview + path) */
.shop-modal__meta,
.shop-modal__desc,
#shopModalDesc,
.preview,
.preview-path{
  display: none !important;
}

/* D2 FIX — ให้ icon / bullet ขึ้นบรรทัดใหม่ */
.shop-feature__desc{
  white-space: pre-line;
  line-height: 1.7;
}

/* ===== D2 FIX : Gallery 16:9 ===== */

/* กรอบรูป Gallery */
.shop-item__imgbtn{
  aspect-ratio: 16 / 9;
  background: #f6f6f6;
  display: block;
}

/* รูปใน Gallery */
.shop-item__img{
  width: 100%;
  height: 100% !important;   /* override ของเดิม */
  object-fit: contain;       /* ไม่ตัดรูป */
  display: block;
}

/* ปรับ Grid ให้ดูโล่งขึ้น */
.shop-grid{
  align-items: start;
}
