/* VS Wishlist Pro — Frontend Styles */
/* Zero external dependencies — all local */

/* ── Button ─────────────────────────────────────────────────────────── */
.vs-wl-btn-wrapper {
    display: inline-block;
    margin: 8px 0;
}
.vs-wl-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #c00;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.vs-wl-add-btn:hover,
.vs-wl-add-btn:focus {
    background: transparent;
    border-color: transparent;
    color: #c00;
    text-decoration: none;
}
.vs-wl-btn-wrapper .vs-wl-add-btn {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
.vs-wl-add-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
.vs-wl-add-btn.vs-wl-added-btn,
.vs-wl-btn-wrapper.vs-wl-added .vs-wl-add-btn {
    color: #c00;
    border-color: #c00;
}
.vs-wl-add-btn .vs-wl-icon svg {
    display: block;
    flex-shrink: 0;
}

/* Product-loop placement: keep the heart clear of sale/category badges. */
.vs-wl-loop-btn-wrapper {
    position: absolute;
    top: 50%;
    right: 12px;
    z-index: 5;
    margin: 0;
    transform: translateY(-50%);
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}
.vs-wl-loop-btn-wrapper .vs-wl-add-btn {
    padding: 6px 10px;
}

.vs-wl-gallery-host {
    position: relative;
}
.vs-wl-single-btn-wrapper {
    position: absolute;
    top: 50%;
    right: 18px;
    z-index: 5;
    margin: 0;
    transform: translateY(-50%);
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}
.vs-wl-single-btn-wrapper .vs-wl-add-btn {
    padding: 6px 10px;
}

/* On narrow product grids, an absolute button can cover the product title
 * because themes position the entire product card differently on mobile.
 * Return it to normal document flow so the title and price remain readable. */
@media (max-width: 767px) {
    .vs-wl-loop-btn-wrapper {
        position: static !important;
        top: auto;
        right: auto;
        z-index: 1;
        display: flex;
        width: fit-content;
        margin: 8px auto 10px;
        transform: none !important;
        padding: 0;
    }

    .vs-wl-loop-btn-wrapper .vs-wl-add-btn {
        padding: 5px 9px;
        font-size: 13px;
        line-height: 1.2;
    }
}

.vs-wl-cart-check {
    display: none;
    margin-left: 6px;
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1;
}
.vs-wl-cart-added {
    border-color: #4caf50 !important;
    color: #2e7d32 !important;
}
.vs-wl-cart-added .vs-wl-cart-check {
    display: inline-block;
}

/* Fallback for themes/extensions that add the link after an AJAX response. */
.vs-wl-add-to-cart + .added_to_cart.wc-forward,
.vs-wl-add-to-cart ~ .added_to_cart.wc-forward {
    display: none !important;
}

/* ── Wishlist page ───────────────────────────────────────────────────── */
.vs-wishlist-page {
    margin: 0 0 30px;
}
.vs-wishlist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.vs-wishlist-title {
    flex: 1 1 20rem;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.vs-wl-share-disclosure {
    position: relative;
    margin-left: auto;
}
.vs-wl-share-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #333;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.vs-wl-share-trigger:hover,
.vs-wl-share-trigger:focus-visible {
    background: #111;
    color: #fff;
}
.vs-wl-share-trigger::before {
    content: "↗";
    font-size: 1.1em;
    line-height: 1;
}
.vs-wl-share-disclosure[open] .vs-wl-share-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.vs-wl-share-panel {
    position: absolute;
    top: calc(100% - 1px);
    right: 0;
    z-index: 20;
    min-width: 290px;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px 0 4px 4px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.16);
}
.vs-wl-share-panel .vs-wishlist-share-title {
    margin-top: 0;
    color: #222;
}
.vs-wl-share-private-note {
    margin-left: auto;
    color: #444;
    font-size: 13px;
    font-weight: 600;
}
.vs-wishlist-title {
    margin: 0;
    font-size: 1.4em;
}
.vs-wishlist-title-text[contenteditable="true"] {
    display: inline-block;
    max-width: 100%;
    border-bottom: 1px dashed #999;
    outline: none;
    cursor: text;
    padding: 2px 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}
.vs-wishlist-privacy {
    display: inline-block;
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.vs-privacy-0 { background: #e6f4ea; color: #2e7d32; }
.vs-privacy-1 { background: #fff3e0; color: #e65100; }
.vs-privacy-2 { background: #f3e5f5; color: #6a1b9a; }

/* ── Table ───────────────────────────────────────────────────────────── */
.vs-wishlist-table {
    width: 100%;
    border-collapse: collapse;
}
.vs-wishlist-table th,
.vs-wishlist-table td {
    padding: 10px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #e8e8e8;
}
.vs-wishlist-table th {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-align: left;
}
.vs-wl-col-remove { width: 32px; }
.vs-wl-col-image  { width: 72px; }
.vs-wl-col-image img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; display: block; }

.vs-wl-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eee;
    color: #555;
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.vs-wl-remove-btn:hover { background: #c00; color: #fff; }

.vs-wl-col-name a { font-weight: 500; color: #333; text-decoration: none; }
.vs-wl-col-name a:hover { color: #c00; }
.vs-wl-sku { display: block; font-size: 11px; color: #888; margin-top: 2px; }

.vs-wl-in-stock  { color: #2e7d32; font-size: 13px; font-weight: 500; }
.vs-wl-out-of-stock { color: #c62828; font-size: 13px; font-weight: 500; }

.vs-wishlist-empty {
    text-align: center;
    color: #888;
    padding: 40px 0;
    font-size: 1.05em;
}

/* ── Stock Alert ─────────────────────────────────────────────────────── */
.vs-wl-stock-alert-wrap {
    margin-top: 8px;
}
.vs-wl-notify-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 5px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #444;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.vs-wl-notify-btn:hover {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}
.vs-wl-alert-active {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #2e7d32;
    font-weight: 500;
}
.vs-wl-cancel-alert {
    font-size: 11px;
    color: #888;
    margin-left: 8px;
    text-decoration: underline;
    cursor: pointer;
}
.vs-wl-alert-form-label {
    font-size: 12px;
    color: #555;
    margin: 6px 0 4px;
}
.vs-wl-alert-form-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.vs-wl-alert-email {
    flex: 1;
    min-width: 160px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.vs-wl-alert-message {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}
.vs-wl-alert-message.success { background: #e8f5e9; color: #2e7d32; }
.vs-wl-alert-message.error   { background: #ffebee; color: #c62828; }

/* ── Footer & Share ──────────────────────────────────────────────────── */
.vs-wishlist-footer {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}
.vs-wishlist-share-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}
.vs-wishlist-share-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.vs-wishlist-share-list a,
.vs-wl-copy-link {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    color: #444;
    text-decoration: none;
    background: #fafafa;
    cursor: pointer;
    transition: background 0.15s;
}
.vs-wishlist-share-list a:hover,
.vs-wl-copy-link:hover { background: #f0f0f0; }
.vs-wl-share-facebook:hover { border-color: #3b5998; color: #3b5998; }
.vs-wl-share-twitter:hover  { border-color: #1da1f2; color: #1da1f2; }
.vs-wl-share-whatsapp:hover { border-color: #25d366; color: #25d366; }
.vs-wl-share-pinterest:hover{ border-color: #e60023; color: #e60023; }

/* ── Mobile ──────────────────────────────────────────────────────────── */
.vs-wishlist-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vs-wl-mobile-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    align-items: flex-start;
    position: relative;
}
.vs-wl-mobile-image img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; }
.vs-wl-mobile-info { flex: 1; }
.vs-wl-mobile-name a { font-weight: 500; text-decoration: none; color: #333; }
.vs-wl-mobile-price { margin: 4px 0; font-size: 14px; }
.vs-wl-mobile-remove { position: absolute; top: 8px; right: 8px; }

@media (max-width: 768px) {
    .vs-wl-share-disclosure {
        width: 100%;
        margin-left: 0;
    }
    .vs-wl-share-trigger {
        width: 100%;
        justify-content: center;
    }
    .vs-wl-share-panel {
        position: static;
        min-width: 0;
        border-radius: 0 0 4px 4px;
    }
    .vs-wl-share-private-note {
        width: 100%;
        margin-left: 0;
    }
    .vs-wishlist-table thead { display: none; }
    .vs-wishlist-table tr { display: block; border: 1px solid #e8e8e8; margin-bottom: 10px; border-radius: 6px; }
    .vs-wishlist-table td { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
    .vs-wishlist-table td:last-child { border-bottom: 0; }
    .vs-wishlist-table td::before { content: attr(data-label); font-weight: 600; min-width: 80px; font-size: 12px; color: #888; }
}
