/* ========== Wishlist Page — Hero + Table Layout ========== */

/* !!! Override theme's aggressive .p-card-img svg rule (.p-card-img svg{width:64px;height:64px;stroke:#ccc;opacity:.5}) !!! */
.md-card-actions svg,
.p-card-img .md-card-actions svg,
.md-wishlist-btn svg {
    width: 17px !important;
    height: 17px !important;
    stroke: currentColor !important;
    fill: none !important;
    opacity: 1 !important;
}

.md-wishlist-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-bottom: 1px solid #eee;
    background: #fff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}
.md-wishlist-btn:last-child {
    border-bottom: none;
}
.md-wishlist-btn svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.md-wishlist-btn:hover {
    background: #eef3ff;
    color: #1e5fbb;
}
.md-wishlist-btn.active {
    background: #1e5fbb;
    color: #fff;
}
.md-wishlist-btn.active svg {
    stroke: #fff;
    fill: #fff;
}

/* ========== Wishlist Button (Single Product page) ========== */
.pd-cta .md-wishlist-btn-single {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #d4d4d8;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
}
.pd-cta .md-wishlist-btn-single:hover {
    border-color: #1e5fbb;
    color: #1e5fbb;
    background: #eef3ff;
}
.pd-cta .md-wishlist-btn-single.active {
    background: #1e5fbb;
    color: #fff;
    border-color: #1e5fbb;
}

/* ========== Wishlist Badge (Header) ========== */
.md-wishlist-header-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    color: var(--nav-link, #1a1a2e);
    text-decoration: none;
}
.md-wishlist-header-btn svg {
    width: 22px;
    height: 22px;
}
.md-wishlist-header-btn .md-wishlist-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: #1e5fbb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}
.md-wishlist-header-btn .md-wishlist-badge.show {
    display: flex;
}

/* ========== Wishlist Page — Table Layout (match meditechshop.com/wishlist) ========== */
.md-wishlist-page {
    max-width: 1320px;
    margin: 0 auto 60px;
    padding: 0;
}
.md-wishlist-page .md-wishlist-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
}

/* Table container */
.md-wishlist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

/* Header row */
.md-wishlist-table thead th {
    background: #f8f9fa;
    padding: 12px 18px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    font-size: 13px;
}
.md-wl-th-select  { width: 44px; }
.md-wl-th-product { width: 45%; }
.md-wl-th-desc    { width: auto; }

/* Body rows */
.md-wishlist-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}
.md-wishlist-table tbody tr:hover td {
    background: #fafafa;
}

.md-wishlist-table tbody td {
    padding: 18px 16px;
    vertical-align: middle;
    background: #fff;
}

/* --- Product cell --- */
.md-wl-cell-product { vertical-align: top !important; }
.md-wl-product-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.md-wl-img-link {
    display: block;
    flex-shrink: 0;
}
.md-wl-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 4px;
    display: block;
}
.md-wl-info { min-width: 0; }
.md-wl-name {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
    line-height: 1.35;
}
.md-wl-name:hover { color: #2563eb; text-decoration: underline; }
.md-wl-stock {
    font-size: 12px;
    color: #2e7d32;
    font-weight: 500;
}
.md-wl-sku {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

/* (price column removed) */

/* --- Description cell --- */
.md-wl-cell-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    max-width: 300px;
}

/* Empty state */
.md-wishlist-empty {
    text-align: center;
    padding: 80px 24px;
    color: #999;
    font-size: 15px;
}
.md-wishlist-empty svg { color: #ccc; margin-bottom: 16px; }
.md-wishlist-empty a {
    display: inline-block;
    margin-top: 16px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.md-wishlist-empty a:hover { text-decoration: underline; }
.md-wishlist-loading {
    text-align: center;
    padding: 60px 24px;
    color: #999;
}

/* ========== Wishlist — Select column & selection ========== */
.md-wl-th-select  { text-align: center; }
.md-wl-cell-select { text-align: center; vertical-align: middle; }
.md-wl-select,
.md-wl-select-all {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1e5fbb;
}
.md-wishlist-table tbody tr.selected td {
    background: #eef3ff !important;
}
.md-wishlist-table tbody tr.selected .md-wl-name {
    color: #1e5fbb;
}

/* ========== Wishlist — Bottom action bar ========== */
.md-wl-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.md-wl-selected-count {
    font-size: 13px;
    color: #666;
    margin-right: auto;
}
.md-wl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid #d4d4d8;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
}
.md-wl-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.md-wl-btn:hover {
    border-color: #1e5fbb;
    color: #1e5fbb;
    background: #eef3ff;
}
.md-wl-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.md-wl-btn:disabled:hover {
    border-color: #d4d4d8;
    color: #374151;
    background: #fff;
}
.md-wl-btn-delete:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fef2f2;
}
.md-wl-btn-delete:disabled:hover {
    border-color: #d4d4d8;
    color: #374151;
    background: #fff;
}

/* ========== Wishlist — Toast ========== */
.md-wl-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all .3s ease;
    z-index: 9999;
}
.md-wl-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== Wishlist — Share Popover（灰色调，契合网站整体风格）========== */
.md-wl-share-popover {
    position: absolute;
    z-index: 1000;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 18px 16px 14px;
    width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    text-align: center;
}
.md-wl-share-popover.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.md-wl-share-popover::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    margin-left: -8px;
    border-width: 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent #f5f5f5;
}
.md-wl-share-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
    margin-bottom: 14px;
    text-transform: uppercase;
    color: #222;
}
.md-wl-share-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.md-wl-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 2px;
    color: #fff;
    text-decoration: none;
    transition: transform .15s ease, opacity .15s;
}
.md-wl-share-btn:hover {
    transform: translateY(-2px);
    opacity: .92;
}
.md-wl-share-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    stroke: none;
    flex-shrink: 0;
}
.md-wl-share-linkedin { background: #0077b5; }
.md-wl-share-x { background: #000000; }
.md-wl-share-email { background: #777; }
.md-wl-share-email svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-wl-share-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color .15s;
}
.md-wl-share-close:hover { color: #222; }
.md-wl-share-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ========== Wishlist — Print ========== */
@media print {
    .site-header, .site-footer, .site-navigation, .main-navigation,
    header, footer, nav { display: none !important; }
    .md-wl-actions,
    .md-wl-cell-select, .md-wl-th-select { display: none !important; }
    .md-wishlist-page { margin: 0; max-width: 100%; }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .md-wishlist-page { padding: 16px; }
    .md-wishlist-page .md-wishlist-title { font-size: 20px; }
    .md-wishlist-table { font-size: 13px; }
    .md-wishlist-table thead th { padding: 10px 12px; font-size: 12px; }
    .md-wishlist-table tbody td { padding: 14px 10px; }
    .md-wl-img { width: 56px; height: 56px; }
    .md-wl-name { font-size: 13px; }
    .md-wl-product-inner { gap: 10px; }
    .md-wl-add-cart { padding: 8px 14px; font-size: 12px; }

    /* Mobile: always show actions */
    .md-card-actions {
        opacity: 1;
    }
}
