/* =========================================================
   shop.css — หน้าสินค้าทั้งหมด (หมวดหมู่), หน้าในหมวด, หน้ารายละเอียดสินค้า
   ========================================================= */

/* ---------- หน้าสินค้าทั้งหมด: การ์ดหมวดหมู่ ---------- */
.select-head { margin-bottom: 14px; line-height: 1.35; }
.select-head small { display: block; font-size: 13px; color: var(--c-blue-pale); }
.select-head p { font-size: 17px; color: var(--c-blue); }

.category-list { display: grid; gap: 17px; padding-bottom: 32px; }
.category-card {
  display: block;
  padding: 15px 20px 17px;
  background: var(--c-cream);
  border: 1px solid var(--c-blue);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
}
.category-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08); }
.banner {
  display: block;
  width: 100%;
  aspect-ratio: 930 / 270;
  object-fit: cover;
  border-radius: 10px;
  background: var(--c-sky);
}
.category-name { margin-top: 8px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--c-text); }
.category-count { font-size: 11px; color: var(--c-blue-pale); }
.category-btn {
  display: block;
  margin-top: 10px;
  height: 29px;
  line-height: 27px;
  border: 1px solid #DCE4EE;
  border-bottom: 2px solid var(--c-blue);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text);
}

/* ---------- หน้าในหมวด ---------- */
.category-banner { border-radius: 12px; }
.category-section-title {
  margin: 16px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--c-blue);
  font-size: 20px;
  font-weight: 500;
  color: var(--c-blue);
}
.category-products { padding-bottom: 32px; }

/* ---------- หน้ารายละเอียดสินค้า ---------- */
.pd-main {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--c-text);
  border-radius: 15px;
  overflow: hidden;
  background: var(--c-sky);
}
.pd-main img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.pd-thumb {
  width: 80px;
  height: 80px;
  padding: 0;
  border: 1px solid #DBDFDE;
  border-radius: 10px;
  overflow: hidden;
  background: var(--c-sky);
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb[aria-pressed="true"] { border: 2px solid #4587CF; }

.pd-name { margin-top: 6px; font-size: 26px; font-weight: 600; line-height: 1.35; color: var(--c-text); }
.pd-price { font-size: 17px; font-weight: 500; color: var(--c-blue); }

.pd-desc {
  margin-top: 12px;
  padding: 10px 9px 14px;
  background: var(--c-cream);
  border: 1px solid var(--c-blue);
  border-radius: 12px;
}
.pd-desc-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-blue); }
.pd-desc-head svg { width: 14px; height: 14px; }
.pd-desc-text { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--c-text); white-space: pre-line; }

.pd-buy {
  margin-top: 11px;
  padding: 10px 9px 18px;
  background: var(--c-cream);
  border: 1px solid var(--c-blue);
  border-radius: 12px;
}
.pd-buy-label { font-size: 12px; color: var(--c-blue); }
.qty { display: flex; gap: 8px; margin-top: 6px; }
.qty-btn {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border: 1px solid var(--c-blue);
  border-radius: 10px;
  background: #fff;
  color: var(--c-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn svg { width: 22px; height: 22px; }
.qty-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.qty-input {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: 1px solid var(--c-blue);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  font: inherit;
  font-size: 22px;
  font-weight: 500;
  color: var(--c-blue);
  outline: none;
}
.qty-input:focus { border-color: var(--c-blue-strong); box-shadow: 0 0 0 3px rgba(94, 150, 210, 0.18); }
.qty-input:disabled { background: #fff; }

.pd-soldout { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--c-red); }
.pd-closed { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--c-red); overflow-wrap: anywhere; }
.pd-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  font-size: 15px;
  color: var(--c-blue);
}
.pd-total strong { font-size: 20px; font-weight: 600; color: var(--c-text); }
.btn-order {
  width: 100%;
  height: 40px;
  margin-top: 10px;
  border-radius: 10px;
  background: var(--c-blue-pale);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.15s;
}
.btn-order:hover { background: var(--c-blue); }
.btn-order:disabled { background: #E9EDEF; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08); cursor: not-allowed; }
.pd-buy .form-alert { margin-top: 12px; }
.pd-stock { margin: 8px 0 32px; text-align: center; font-size: 11px; color: var(--c-blue); }

/* ---------- จอใหญ่ขึ้น ---------- */
@media (min-width: 640px) {
  .page-head h1 { font-size: 30px; }
  .back-btn { width: 32px; height: 32px; }
  .back-btn svg { width: 18px; height: 18px; }
  .category-list { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
  .category-name { font-size: 17px; }
  .category-count { font-size: 13px; }
  .category-btn { height: 34px; line-height: 32px; font-size: 14px; }
  .category-section-title { font-size: 24px; }
}
/* คอม: รูปอยู่ซ้าย ข้อมูลและปุ่มซื้ออยู่ขวา */
@media (min-width: 900px) {
  .pd-layout {
    display: grid;
    grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
  .pd-name { margin-top: 0; font-size: 32px; }
  .pd-price { font-size: 20px; }
}
