/* รายละเอียดสินค้า shopping UI ใหม่ (shopping/cart_shopping/cart_product_detail_v2.php) — prefix .spd-
   ใช้ token/การ์ด/ปุ่มตะกร้าลอยจาก shop_list.css (.sv2) · สีจาก configmlm ผ่าน --shd-* */

.spd-crumb {
    display: flex; flex-wrap: wrap; gap: 8px;
    font-size: 14px; color: var(--sv2-muted); margin-bottom: 16px;
    animation: sv2-rise .4s cubic-bezier(.2, .7, .2, 1) both;
}
.spd-crumb a { color: var(--sv2-muted); }
.spd-crumb a:hover { color: var(--sv2-c2); }
.spd-crumb span:last-child { color: var(--sv2-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }

/* ---------- ส่วนหลัก ---------- */
.spd-main {
    display: flex; flex-wrap: wrap; gap: 40px;
    padding: 28px; background: #fff; border: 1px solid var(--sv2-line); border-radius: 20px;
    animation: sv2-rise .5s cubic-bezier(.2, .7, .2, 1) .05s both;
}
.spd-gallery { flex: 1 1 420px; min-width: 0; display: flex; gap: 14px; }
.spd-thumbs { flex: 0 0 76px; display: flex; flex-direction: column; gap: 10px; }
.spd-thumb {
    width: 76px; height: 76px; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
    background: #eef2f6; border: 2px solid transparent; transition: border-color .2s, transform .2s;
}
.spd-thumb:hover { transform: translateY(-2px); }
.spd-thumb.is-on { border-color: var(--sv2-c2); }
.spd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spd-photo {
    flex: 1; min-width: 0; aspect-ratio: 1 / 1; max-height: 620px;
    border-radius: 16px; background: #eef2f6; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.spd-photo img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.spd-photo:hover img { transform: scale(1.04); }
.spd-photo img.is-swap { animation: spd-fade .35s ease; }
@keyframes spd-fade { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.spd-info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.spd-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.spd-tag { padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.spd-tag--soft { background: var(--sv2-tint); color: var(--sv2-c2); }
.spd-tag--line { border: 1px solid var(--sv2-line); color: #34495e; }
.spd-name { margin: 0; font-size: 30px; line-height: 1.3; font-weight: 700; }
.spd-code { margin-top: -8px; font-size: 14px; color: var(--sv2-muted); }
.spd-pricebox {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
    padding: 16px 18px; border-radius: 14px; background: #f6f9fb;
}
.spd-price { font-size: 32px; font-weight: 700; line-height: 1.1; }
.spd-pv { font-size: 14px !important; padding: 3px 12px !important; }

.spd-qtyrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.spd-label { font-size: 15px; font-weight: 600; }
.spd-qty { display: inline-flex; align-items: center; border: 1px solid var(--sv2-line); border-radius: 12px; overflow: hidden; background: #fff; }
.spd-qty button {
    width: 44px; height: 44px; border: 0; background: #fff; color: #34495e;
    font-size: 20px; line-height: 1; cursor: pointer; transition: background .15s;
}
.spd-qty button:hover { background: var(--sv2-soft); }
.spd-qty input {
    width: 60px; height: 44px; border: 0; border-left: 1px solid var(--sv2-line); border-right: 1px solid var(--sv2-line);
    text-align: center; font: inherit; font-size: 16px; font-weight: 700; color: var(--sv2-text); -moz-appearance: textfield;
}
.spd-qty input::-webkit-outer-spin-button, .spd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.spd-sum { font-size: 14px; color: var(--sv2-muted); }
.spd-sum strong { color: var(--sv2-text); }

.spd-buy { display: flex; gap: 10px; flex-wrap: wrap; }
.spd-btn {
    height: 52px; padding: 0 22px; border-radius: 14px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font: inherit; font-size: 16px; font-weight: 700; transition: filter .15s, background .2s, color .2s;
}
.spd-btn--primary { flex: 2 1 240px; border: 0; background: var(--sv2-c2); color: #fff; }
.spd-btn--primary:hover { filter: brightness(1.1); }
.spd-btn--primary.is-in { background: var(--sv2-tint); color: var(--sv2-c2); box-shadow: inset 0 0 0 1px var(--sv2-c2); }
.spd-btn--primary.is-pop { animation: sv2-pop .35s cubic-bezier(.2, .7, .2, 1); }
.spd-btn--line { flex: 1 1 160px; border: 1px solid var(--sv2-c2); background: #fff; color: var(--sv2-c2); }
.spd-btn--line:hover { background: var(--sv2-tint); }
.spd-btn:disabled { opacity: .6; cursor: wait; }
.spd-btn:active { transform: scale(.98); }
.spd-square { width: 52px !important; height: 52px !important; border-radius: 14px !important; }

.spd-note {
    display: flex; gap: 12px; align-items: flex-start;
    padding-top: 16px; border-top: 1px solid var(--sv2-line);
}
.spd-note-ic { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; background: var(--sv2-soft); color: var(--sv2-c2); display: flex; align-items: center; justify-content: center; }
.spd-note strong { display: block; font-size: 15px; }
.spd-note span { display: block; font-size: 13px; color: var(--sv2-muted); }

/* ---------- แท็บ ---------- */
.spd-tabs {
    margin-top: 20px; padding: 8px 28px 28px;
    background: #fff; border: 1px solid var(--sv2-line); border-radius: 20px;
    animation: sv2-rise .5s cubic-bezier(.2, .7, .2, 1) .12s both;
}
.spd-tablist { display: flex; gap: 6px; border-bottom: 1px solid var(--sv2-line); }
.spd-tab {
    height: 50px; padding: 0 16px; margin-bottom: -1px;
    border: 0; border-bottom: 2px solid transparent; background: transparent;
    font: inherit; font-size: 15px; font-weight: 700; color: var(--sv2-muted); cursor: pointer;
    transition: color .2s, border-color .2s;
}
.spd-tab:hover { color: var(--sv2-text); }
.spd-tab.is-on { color: var(--sv2-c2); border-bottom-color: var(--sv2-c2); }
.spd-panel { padding-top: 20px; font-size: 15px; line-height: 1.75; color: #34495e; animation: spd-fade .3s ease; }
.spd-richtext { max-width: 900px; overflow-wrap: anywhere; }
.spd-richtext img { max-width: 100%; height: auto; border-radius: 12px; }
.spd-muted { color: var(--sv2-muted); margin: 0; }
.spd-spec { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.spd-spec dl { flex: 1 1 360px; margin: 0; display: grid; grid-template-columns: 160px 1fr; row-gap: 10px; }
.spd-spec dt { color: var(--sv2-muted); font-weight: 500; }
.spd-spec dd { margin: 0; color: var(--sv2-text); font-weight: 600; }
.spd-qr { margin: 0; text-align: center; padding: 12px; border: 1px solid var(--sv2-line); border-radius: 14px; }
.spd-qr img { width: 140px; height: 140px; display: block; }
.spd-qr figcaption { font-size: 12px; color: var(--sv2-muted); margin-top: 4px; }
.spd-h3 { margin: 24px 0 10px; font-size: 16px; font-weight: 700; }
.spd-pack { list-style: none; margin: 0; padding: 0; border: 1px solid var(--sv2-line); border-radius: 12px; overflow: hidden; }
.spd-pack li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.spd-pack li + li { border-top: 1px solid var(--sv2-line); }
.spd-pack small { color: var(--sv2-muted); margin-left: 6px; }

/* ---------- สินค้าที่เกี่ยวข้อง ---------- */
.spd-related { margin-top: 28px; }
.spd-related h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; }
.sv2-body--pad { padding-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
    .spd *, .spd *::before, .spd *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 767px) {
    .spd-main { padding: 16px; gap: 20px; border-radius: 16px; }
    .spd-gallery { flex-direction: column-reverse; }
    .spd-thumbs { flex-direction: row; flex: 0 0 auto; overflow-x: auto; }
    .spd-thumb { width: 64px; height: 64px; flex: 0 0 auto; }
    .spd-name { font-size: 22px; }
    .spd-price { font-size: 26px; }
    .spd-tabs { padding: 4px 16px 20px; border-radius: 16px; }
    .spd-spec dl { grid-template-columns: 120px 1fr; }
    .spd-crumb span:last-child { max-width: 100%; }
}
