/* shop.css — สไตล์หน้าร้านค้า (shop.html) และหน้ารายละเอียดสินค้า (product.html)
   ใช้ร่วมกับ style.css (v4) — ตัวแปรสี/เงา/ปุ่มมาจากไฟล์นั้น */

/* ── หัวหน้า ── */
.shop-hero {
  margin-top: -92px; padding: 168px 5vw 120px; text-align: center;
  background:
    radial-gradient(55% 60% at 10% 40%, rgba(21,101,232,.16), transparent 70%),
    radial-gradient(50% 55% at 92% 50%, rgba(255,190,90,.22), transparent 70%),
    radial-gradient(45% 40% at 55% 105%, rgba(125,211,252,.26), transparent 70%),
    #fff;
}
.shop-hero h1 {
  font-size: clamp(34px, 5vw, 60px); font-weight: 800; letter-spacing: -1.4px; margin: 16px 0 14px;
  line-height: 1.3; padding: .14em .06em .12em;
  background: linear-gradient(100deg, var(--ink) 30%, var(--brand) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.shop-hero p { font-size: 17px; color: var(--gray-600); max-width: 640px; margin: 0 auto; line-height: 1.8; }

.shop-main { max-width: 1180px; margin: -64px auto 0; padding: 0 5vw 110px; position: relative; z-index: 2; min-height: 360px; }
.shop-count { font-size: 13.5px; color: var(--gray-500); margin: 0 4px 16px; font-weight: 500; }

/* ── กริดสินค้า: การ์ดสี่เหลี่ยมมุมมน (รูป / ชื่อ / ราคา) ── */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.shop-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: #fff;
  border: 1px solid var(--gray-200); border-radius: 26px; padding: 12px 12px 20px; box-shadow: var(--shadow-card);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.shop-card:hover { transform: translateY(-5px); border-color: #BFD3FA; box-shadow: 0 30px 56px -28px rgba(21,101,232,.45); }
.shop-img {
  aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #EEF4FF, #F8FAFF);
  display: flex; align-items: center; justify-content: center; color: #9DB6E5;
}
.shop-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.shop-card:hover .shop-img img { transform: scale(1.05); }
.shop-info { padding: 16px 10px 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.shop-name {
  font-size: 16.5px; font-weight: 700; color: var(--ink); line-height: 1.45; letter-spacing: -.1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em;
}
.shop-price { font-size: 19px; font-weight: 800; color: var(--brand); letter-spacing: -.3px; }
.shop-price.ask { font-size: 14px; font-weight: 600; color: var(--gray-500); }
.shop-more { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.shop-card:hover .shop-more { color: var(--brand); }

/* โครงรอโหลด */
.shop-skel { border-radius: 26px; border: 1px solid var(--gray-100); padding: 12px 12px 22px; background: #fff; }
.shop-skel .a, .shop-skel .b, .shop-skel .c { background: linear-gradient(90deg, #EEF2FA 25%, #F7F9FD 50%, #EEF2FA 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 14px; }
.shop-skel .a { aspect-ratio: 4/3; border-radius: 18px; }
.shop-skel .b { height: 16px; margin: 18px 10px 10px; width: 80%; }
.shop-skel .c { height: 16px; margin: 0 10px; width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── ยังไม่มีสินค้า ── */
.shop-empty {
  position: relative; overflow: hidden; text-align: center; padding: 70px 24px 64px; border-radius: 34px;
  background: linear-gradient(180deg, #fff, #F6F9FF); border: 1px solid var(--gray-200); box-shadow: var(--shadow-card);
}
.shop-empty::before { content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%; right: -120px; top: -150px; background: rgba(21,101,232,.07); }
.shop-empty::after { content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%; left: -90px; bottom: -130px; background: rgba(255,190,90,.14); }
.shop-empty > * { position: relative; z-index: 1; }
.shop-empty-art { width: 150px; height: 150px; margin: 0 auto 26px; border-radius: 42px; background: linear-gradient(135deg, #EAF2FF, #fff); border: 1px solid #D5E3FB; display: flex; align-items: center; justify-content: center; color: var(--brand); box-shadow: 0 24px 50px -24px rgba(21,101,232,.55); }
.shop-empty h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: var(--ink); margin-bottom: 10px; letter-spacing: -.4px; }
.shop-empty p { font-size: 15.5px; color: var(--gray-600); max-width: 520px; margin: 0 auto 28px; line-height: 1.8; }
.shop-empty-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-soft { display: inline-flex; align-items: center; padding: 15px 28px; border-radius: 999px; background: #fff; border: 1px solid var(--gray-200); color: var(--ink); font: 600 15px 'IBM Plex Sans Thai', sans-serif; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn-soft:hover { background: var(--gray-50); }
.shop-error { text-align: center; padding: 60px 20px; color: var(--gray-600); }
.shop-error .btn-soft { margin-top: 16px; }

/* ── หน้ารายละเอียดสินค้า ── */
.prod-page { max-width: 1180px; margin: 0 auto; padding: 124px 5vw 110px; }
.prod-back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--gray-600); padding: 9px 16px 9px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--gray-200); margin-bottom: 26px; transition: color .15s, border-color .15s; }
.prod-back:hover { color: var(--brand); border-color: #BFD3FA; }
.prod-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: start; }
.prod-gallery { position: sticky; top: 100px; }
.prod-main-img {
  aspect-ratio: 1 / 1; border-radius: 30px; overflow: hidden; background: linear-gradient(135deg, #EEF4FF, #F8FAFF);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-card); display: flex; align-items: center; justify-content: center; color: #9DB6E5;
}
.prod-main-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.prod-thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.prod-thumb { width: 74px; height: 74px; border-radius: 16px; overflow: hidden; border: 2px solid transparent; background: #F3F6FC; padding: 0; cursor: pointer; opacity: .7; transition: opacity .15s, border-color .15s; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-thumb:hover { opacity: 1; }
.prod-thumb.on { opacity: 1; border-color: var(--brand); }
.prod-summary h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; color: var(--ink); letter-spacing: -.8px; line-height: 1.3; margin-bottom: 14px; }
.prod-price { font-size: 34px; font-weight: 800; color: var(--brand); letter-spacing: -.8px; margin-bottom: 8px; }
.prod-price.ask { font-size: 20px; color: var(--gray-500); font-weight: 600; letter-spacing: 0; }
.prod-lead { font-size: 15.5px; line-height: 1.85; color: var(--gray-600); margin: 18px 0 26px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.prod-actions { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.btn-dl {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 7px 7px 26px; border: none; cursor: pointer; border-radius: 999px;
  background: var(--brand); color: #fff; font: 600 15.5px 'IBM Plex Sans Thai', sans-serif; text-decoration: none; box-shadow: 0 16px 30px -12px rgba(21,101,232,.7); transition: transform .18s;
}
.btn-dl:hover { transform: translateY(-2px); }
.btn-dl:disabled { opacity: .7; cursor: progress; }
.btn-dl .arrow { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-dl.dark { background: var(--ink); box-shadow: 0 16px 30px -14px rgba(14,26,51,.65); }
.btn-dl.dark .arrow { color: var(--ink); }
.btn-dl-msg { font-size: 13px; color: #dc2626; min-height: 18px; }
.prod-sections { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; margin-top: 44px; align-items: start; }
.prod-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 28px; padding: 28px 30px; box-shadow: var(--shadow-card); }
.prod-card h2 { font-size: 19px; font-weight: 800; color: var(--ink); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.prod-card h2::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: var(--brand); }
.prod-desc { font-size: 15px; line-height: 1.9; color: var(--gray-700); white-space: pre-line; word-break: break-word; }
.prod-specs { width: 100%; border-collapse: collapse; }
.prod-specs tr + tr td { border-top: 1px solid var(--gray-100); }
.prod-specs td { padding: 12px 4px; font-size: 14px; vertical-align: top; }
.prod-specs td:first-child { color: var(--gray-500); font-weight: 600; width: 42%; padding-right: 14px; }
.prod-specs td:last-child { color: var(--ink); font-weight: 500; word-break: break-word; }
.prod-doc { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 20px; background: #F6F9FF; border: 1px solid #D9E6FB; margin-top: 4px; }
.prod-doc-ic { width: 48px; height: 48px; border-radius: 14px; background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid #D9E6FB; }
.prod-doc-info { flex: 1; min-width: 0; }
.prod-doc-info b { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-doc-info span { font-size: 12.5px; color: var(--gray-500); }
.prod-doc .btn-dl { padding: 5px 5px 5px 18px; font-size: 13.5px; }
.prod-doc .btn-dl .arrow { width: 34px; height: 34px; }
.prod-skel-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; }
.prod-skel-top .a { aspect-ratio: 1/1; border-radius: 30px; }
.prod-skel-top .a, .prod-skel-top .b { background: linear-gradient(90deg, #EEF2FA 25%, #F7F9FD 50%, #EEF2FA 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.prod-skel-top .b { height: 220px; border-radius: 24px; }

@media (max-width: 900px) {
  .prod-top, .prod-skel-top { grid-template-columns: 1fr; gap: 28px; }
  .prod-gallery { position: static; }
  .prod-sections { grid-template-columns: 1fr; }
  .prod-actions { max-width: none; }
}
@media (max-width: 600px) {
  .shop-hero { margin-top: -78px; padding: 132px 6vw 100px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shop-card { border-radius: 20px; padding: 8px 8px 14px; }
  .shop-img { border-radius: 14px; }
  .shop-info { padding: 12px 6px 0; }
  .shop-name { font-size: 14px; }
  .shop-price { font-size: 16px; }
  .prod-page { padding-top: 100px; }
  .prod-card { padding: 22px 20px; }
  .prod-doc { flex-wrap: wrap; }
}

[hidden] { display: none !important; }
/* การ์ดเอกสาร: ไอคอน+ชื่อไฟล์แถวบน ปุ่มเต็มความกว้างแถวล่าง */
.prod-doc { flex-wrap: wrap; }
.prod-doc-info { flex: 1 1 calc(100% - 70px); }
.prod-doc .btn-dl { width: 100%; padding: 6px 6px 6px 22px; font-size: 14px; }
.prod-doc .btn-dl .arrow { width: 36px; height: 36px; }
