/* Header: cart dropdown + wishlist — v2 modern */

/* —— Cart trigger button —— */
header #cart > button.dropdown-toggle {
    gap: 10px;
    padding: 0 16px 0 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    height: 42px;
}
header #cart > button.dropdown-toggle:hover,
header #cart.open > button.dropdown-toggle {
    border-color: #9ca3af;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.10);
    background: #fafafa;
}
header #cart .header-cart-icon {
    font-size: 17px;
    color: #111827;
    line-height: 1;
}
header #cart > button.dropdown-toggle #cart-total {
    font-family: Inter, "Montserrat", "Open Sans", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    letter-spacing: 0.01em;
}

/* —— Dropdown panel —— */
header #cart .dropdown-menu {
    min-width: 380px;
    max-width: min(420px, 96vw);
    padding: 0;
    margin-top: 6px !important;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.13), 0 2px 8px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    background: #fff;
}
header #cart .dropdown-menu > li {
    padding: 0;
}

/* —— Product list —— */
header #cart .dropdown-menu li.products {
    max-height: 320px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 12px 14px 6px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
header #cart .dropdown-menu li.products::-webkit-scrollbar { width: 4px; }
header #cart .dropdown-menu li.products::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

header #cart .dropdown-menu li.products .table {
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
}
header #cart .dropdown-menu li.products .table > tbody > tr > td {
    vertical-align: middle;
    border-top: 0;
    padding: 10px 6px;
    font-family: Inter, "Open Sans", sans-serif;
    font-size: 12.5px;
    color: #374151;
}
header #cart .dropdown-menu li.products .table > tbody > tr + tr > td {
    border-top: 1px solid #f3f4f6;
}

/* 图片 */
header #cart .dropdown-menu li.products img.img-thumbnail {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    padding: 2px;
    background: #f8f9fb;
}

/* 名称列宽 */
header #cart .dropdown-menu li.products td:nth-child(2) {
    min-width: 0;
    width: 48%;
}

/* 商品名 */
header #cart .dropdown-menu li .name.cart-dropdown-product-name {
    display: block !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #111827;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4 !important;
    height: auto !important;
}
header #cart .dropdown-menu li .name.cart-dropdown-product-name:hover {
    color: #374151;
    text-decoration: underline;
}

/* option small */
header #cart .dropdown-menu li.products small {
    color: #9ca3af;
    font-size: 11px;
}

/* 数量 & 价格 */
header #cart .dropdown-menu li.products td:nth-child(3),
header #cart .dropdown-menu li.products td:nth-child(4) {
    white-space: nowrap;
    font-weight: 600;
    color: #111827;
    font-size: 12.5px;
    text-align: right;
}

/* 删除按钮 */
header #cart .dropdown-menu .btn-danger.btn-xs {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
    border: 1.5px solid #fecaca;
    background: #fff5f5;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
header #cart .dropdown-menu .btn-danger.btn-xs:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}
header #cart .dropdown-menu .btn-danger.btn-xs .fa {
    font-size: 12px;
}

/* —— Totals block —— */
header #cart .dropdown-menu li > div {
    padding: 12px 14px 14px;
    background: #f9fafb;
    border-top: 1px solid #f0f2f5;
}
header #cart .dropdown-menu li > div .table {
    margin-bottom: 12px;
    font-family: Inter, "Open Sans", sans-serif;
    font-size: 13px;
}
header #cart .dropdown-menu li > div .table-bordered td {
    border-color: #e9ecef;
    padding: 9px 12px;
    color: #374151;
}
header #cart .dropdown-menu li > div .table-bordered tr:last-child td {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
    border-top: 2px solid #e5e7eb !important;
}

/* —— View Cart button —— */
header #cart .cart-dropdown-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    border: none !important;
    background: #111827 !important;
    color: #fff !important;
    font-family: Inter, "Montserrat", "Open Sans", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 12px 16px;
    transition: background 0.18s, transform 0.15s;
}
header #cart .cart-dropdown-view-btn:hover,
header #cart .cart-dropdown-view-btn:focus {
    background: #374151 !important;
    color: #fff !important;
    transform: translateY(-1px);
}
header #cart .cart-dropdown-view-btn .fa {
    font-size: 14px;
}

/* —— Empty state —— */
header #cart .no-results {
    padding: 24px 16px !important;
    font-family: Inter, "Open Sans", sans-serif;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}
header #cart .no-results .fa {
    color: #d1d5db;
    margin-right: 6px;
    font-size: 18px;
}

/* —— Wishlist circle —— */
header .header-wishlist {
    border-color: #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
header .header-wishlist:hover {
    border-color: #9ca3af;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
header .header-wishlist a { color: #111827; }
header .header-wishlist a:hover { background: #f3f4f6 !important; }
header .header-wishlist .header-wishlist-icon {
    font-size: 17px;
    line-height: 38px;
}
