/* (11/11/2026) กล่องตะกร้าที่แถบหัว shopping (ชี้ไอคอนตะกร้า) — markup .smc- จาก shopping/cart_shopping/cart_basket.php
   กรอบ .cart-dropdown-wrap + ปุ่ม "ตะกร้าสินค้า" (.shopping-cart-button) มาจากไฟล์ header เดิม → จัดด้วย :has(.smc)
   สีจาก configmlm > ตั้งค่าสี (Member) ผ่าน --shd-* (shop_header_head.php) · โหลดจาก shopping/includes/shop_header_head.php */

/* ---------- กรอบ dropdown ---------- */
.cart-dropdown-wrap:has(.smc) {
    width: 360px;
    padding: 0 !important;
    border: 1px solid var(--shd-line, #e5e9f0);
    border-radius: 16px;
    box-shadow: 0 18px 40px -16px rgba(15, 40, 70, .35), 0 2px 6px rgba(15, 40, 70, .06);
    overflow: hidden;
    text-align: left;
}
.cart-dropdown-wrap:has(.smc) > .shopping-cart-footer { /* header-top.php มี .text-center · header_middle.php ไม่มี */
    margin: 0 !important; padding: 0 16px 16px !important; border: 0 !important; background: #fff;
}
.cart-dropdown-wrap:has(.smc) .shopping-cart-button { display: block !important; margin: 0 !important; padding: 0 !important; }
.cart-dropdown-wrap:has(.smc) .shopping-cart-button a {
    display: flex !important; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 44px; margin: 0 !important; padding: 0 16px !important;
    border: 0 !important; border-radius: 12px !important;
    background: var(--shd-c2, #0a4069) !important; color: #fff !important;
    font-size: 15px !important; font-weight: 700; line-height: 1 !important;
    transition: filter .15s, transform .1s;
}
.cart-dropdown-wrap:has(.smc) .shopping-cart-button a::before {
    content: "\f07a"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 14px;
}
.cart-dropdown-wrap:has(.smc) .shopping-cart-button a:hover { filter: brightness(1.1); }
.cart-dropdown-wrap:has(.smc) .shopping-cart-button a:active { transform: scale(.98); }

/* ---------- หัวกล่อง ---------- */
.smc { color: var(--shd-text, #1f2937); }
.smc-head {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 18px 12px; border-bottom: 1px solid var(--shd-line, #e5e9f0);
}
.smc-title { font-size: 16px; font-weight: 700; color: var(--shd-text, #1f2937); }
.smc-count {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--shd-c1, #2cabe3) 14%, #fff); color: var(--shd-c1, #2cabe3);
    font-size: 12px; font-weight: 700;
}

/* ---------- รายการสินค้า ---------- */
.smc-list { max-height: min(340px, 52vh); overflow-y: auto; padding: 6px 10px; overscroll-behavior: contain; }
.smc-list::-webkit-scrollbar { width: 6px; }
.smc-list::-webkit-scrollbar-thumb { background: #d5dde6; border-radius: 6px; }
.smc-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 8px; border-radius: 12px; transition: background .15s;
}
.smc-item + .smc-item { margin-top: 2px; }
.smc-item:hover { background: var(--shd-soft, #f3f6f9); }
.smc-img {
    flex: 0 0 56px; width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
    background: #f5f7fa; border: 1px solid var(--shd-line, #e5e9f0);
}
.smc-img img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; display: block; }
.smc-info { flex: 1 1 auto; min-width: 0; }
.smc-name {
    font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--shd-text, #1f2937);
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.smc-code { margin-top: 1px; font-size: 12px; color: var(--shd-muted, #6b7280); }
.smc-qty { margin-top: 3px; font-size: 13px; color: var(--shd-muted, #6b7280); font-variant-numeric: tabular-nums; }
.smc-end { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.smc-line { font-size: 14px; font-weight: 700; color: var(--shd-text, #1f2937); font-variant-numeric: tabular-nums; white-space: nowrap; }
.smc-del {
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: #9aa4b2; font-size: 16px; line-height: 1;
    transition: background .15s, color .15s;
}
.smc-del i { line-height: 1; display: inline-flex; }
.smc-del:hover, .smc-del:focus-visible { background: color-mix(in srgb, var(--shd-cancel, #ef4444) 12%, #fff); color: var(--shd-cancel, #ef4444); outline: none; }

/* ---------- ตะกร้าว่าง ---------- */
.smc-empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 28px 18px 22px; font-size: 14px; color: var(--shd-muted, #6b7280); text-align: center;
}
.smc-empty-ic {
    width: 56px; height: 56px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--shd-soft, #f3f6f9); color: #9aa4b2; font-size: 28px;
}

/* ---------- สรุปยอด ---------- */
.smc-sum { padding: 12px 18px 14px; border-top: 1px solid var(--shd-line, #e5e9f0); background: #fff; }
.smc-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    font-size: 13.5px; color: var(--shd-muted, #6b7280);
}
.smc-row + .smc-row { margin-top: 4px; }
.smc-row b { font-weight: 700; color: var(--shd-text, #1f2937); font-variant-numeric: tabular-nums; }
.smc-row.smc-total span { font-size: 14.5px; font-weight: 600; color: var(--shd-text, #1f2937); }
.smc-row.smc-total b { font-size: 18px; color: var(--shd-c2, #0a4069); }

/* จอ < 1200 (แถบบนมือถือ): ไอคอนตะกร้าไม่ได้อยู่ชิดขอบขวา → กล่องยึดขอบขวาจอแทน ไม่ล้นซ้าย */
@media (max-width: 1199px) {
    header.header-area .cart-dropdown-wrap:has(.smc) {
        position: fixed; left: auto; right: 12px; top: 74px !important;
        width: min(360px, calc(100vw - 24px));
    }
}
