/* Trade Bargains Growth Engine — Wishlist Styles
   Scoped under .tbge-wl-* — zero theme conflicts
   Works on Astra, Kadence, PopularFX
------------------------------------------------- */

/* -----------------------------------------------
   Heart button — product loop & single page
----------------------------------------------- */
.tbge-wl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all .2s ease;
    line-height: 1;
    white-space: nowrap;
    margin-top: 8px;
}
.tbge-wl-btn:hover {
    border-color: var(--tbge-brand, #F7931E);
    color: var(--tbge-brand, #F7931E);
}
.tbge-wl-btn--active {
    border-color: var(--tbge-brand, #F7931E);
    color: var(--tbge-brand, #F7931E);
    background: #fff8f0;
}
.tbge-wl-btn--active .tbge-wl-icon { fill: var(--tbge-brand, #F7931E); }

.tbge-wl-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: fill .2s ease, transform .2s ease;
}
.tbge-wl-btn:hover .tbge-wl-icon { transform: scale(1.15); }

/* Loop context — position below add to cart */
.tbge-wl-btn--loop { width: 100%; justify-content: center; }

/* Single product context */
.tbge-wl-btn--single { margin-top: 12px; }

/* Loading state */
.tbge-wl-btn--loading {
    opacity: .65;
    pointer-events: none;
}

/* -----------------------------------------------
   Mini-wishlist counter in nav (if theme supports)
----------------------------------------------- */
.tbge-wl-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tbge-brand, #F7931E);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    padding: 0 4px;
    line-height: 1;
}

/* -----------------------------------------------
   Wishlist page
----------------------------------------------- */
.tbge-wl-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

.tbge-wl-shared-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff8f0;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}
.tbge-wl-shop-link {
    color: var(--tbge-brand, #F7931E);
    text-decoration: none;
    font-weight: 700;
}

/* Header */
.tbge-wl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.tbge-wl-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a2332;
}
.tbge-wl-item-count {
    font-size: 16px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 6px;
}

/* Share buttons */
.tbge-wl-share {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tbge-wl-share-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}
.tbge-wl-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity .15s;
}
.tbge-wl-share-btn:hover { opacity: .85; }
.tbge-wl-share-wa    { background: #25D366; color: #fff; }
.tbge-wl-share-email { background: #374151; color: #fff; }
.tbge-wl-copy-link   { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

/* Product grid */
.tbge-wl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.tbge-wl-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.tbge-wl-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.tbge-wl-item-image {
    position: relative;
    background: #f9fafb;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.tbge-wl-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.tbge-wl-item:hover .tbge-wl-item-image img { transform: scale(1.04); }

.tbge-wl-out-of-stock {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(220,38,38,.9);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.tbge-wl-item-details { padding: 14px; }

.tbge-wl-item-name {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.tbge-wl-item-name a {
    color: #1a2332;
    text-decoration: none;
}
.tbge-wl-item-name a:hover { color: var(--tbge-brand, #F7931E); }

.tbge-wl-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--tbge-brand, #F7931E);
    margin-bottom: 12px;
}

.tbge-wl-item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tbge-wl-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--tbge-brand, #F7931E);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.tbge-wl-btn-primary:hover { opacity: .9; color: #fff; }
.tbge-wl-btn-primary:active { transform: scale(.98); }

.tbge-wl-btn-remove {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
    transition: all .15s;
    width: 100%;
    justify-content: center;
}
.tbge-wl-btn-remove:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
}

/* Bulk actions */
.tbge-wl-bulk-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}
#tbge-wl-add-all { max-width: 220px; }

.tbge-wl-continue {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
}
.tbge-wl-continue:hover { color: var(--tbge-brand, #F7931E); }

/* Empty state */
.tbge-wl-empty {
    text-align: center;
    padding: 80px 20px;
}
.tbge-wl-empty-icon {
    font-size: 72px;
    color: #e5e7eb;
    margin-bottom: 20px;
    line-height: 1;
}
.tbge-wl-empty h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 12px;
}
.tbge-wl-empty p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 24px;
}
.tbge-wl-empty .tbge-wl-btn-primary { max-width: 200px; margin: 0 auto; }

/* -----------------------------------------------
   Email capture modal (guests)
   Fires immediately on ♡ click — no delay
----------------------------------------------- */
#tbge-wl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99998;
    animation: tbge-wl-fade-in .2s ease;
}
@keyframes tbge-wl-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.tbge-wl-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 20px;
    padding: 0;
    width: calc(100% - 32px);
    max-width: 420px;
    text-align: center;
    z-index: 99999;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
    animation: tbge-wl-slide-up .25s ease;
    overflow: hidden;
}
@keyframes tbge-wl-slide-up {
    from { transform: translate(-50%, calc(-50% + 24px)); opacity: 0; }
    to   { transform: translate(-50%, -50%); opacity: 1; }
}

.tbge-wl-modal-inner {
    padding: 40px 32px 32px;
}

.tbge-wl-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.tbge-wl-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.tbge-wl-modal-icon {
    font-size: 48px;
    margin-bottom: 14px;
    line-height: 1;
    animation: tbge-wl-heartbeat .5s ease;
}
@keyframes tbge-wl-heartbeat {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.3); }
    60%  { transform: scale(1); }
    80%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.tbge-wl-modal-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.2;
}

.tbge-wl-modal-subtitle {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.tbge-wl-modal-body {
    margin: 0 0 20px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.65;
}

.tbge-wl-modal-input-wrap {
    margin-bottom: 12px;
}

#tbge-wl-email-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    color: #1a2332;
}
#tbge-wl-email-input:focus {
    border-color: var(--tbge-brand, #F7931E);
    box-shadow: 0 0 0 3px rgba(247,147,30,.12);
}
#tbge-wl-email-input.tbge-wl-input-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

/* Modal submit button — fully scoped to prevent any theme override */
#tbge-wl-email-modal .tbge-wl-modal-submit,
#tbge-wl-email-modal button#tbge-wl-email-submit {
    display: block !important;
    width: 100% !important;
    padding: 14px 20px !important;
    margin: 0 0 4px !important;
    background: #F7931E !important;
    background: var(--tbge-brand, #F7931E) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: .2px !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    transition: opacity .15s ease, transform .1s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: 0 4px 14px rgba(247,147,30,.35) !important;
}
#tbge-wl-email-modal .tbge-wl-modal-submit:hover,
#tbge-wl-email-modal button#tbge-wl-email-submit:hover {
    opacity: .92 !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(247,147,30,.45) !important;
}
#tbge-wl-email-modal .tbge-wl-modal-submit:active,
#tbge-wl-email-modal button#tbge-wl-email-submit:active {
    transform: scale(.98) !important;
}
#tbge-wl-email-modal .tbge-wl-modal-submit:disabled,
#tbge-wl-email-modal button#tbge-wl-email-submit:disabled {
    opacity: .65 !important;
    cursor: not-allowed !important;
}

.tbge-wl-modal-note {
    margin: 14px 0 0 !important;
    font-size: 12px !important;
    color: #9ca3af !important;
    line-height: 1.5 !important;
}

/* -----------------------------------------------
   Removing animation
----------------------------------------------- */
.tbge-wl-item--removing {
    opacity: 0;
    transform: scale(.9);
    transition: opacity .3s, transform .3s;
    pointer-events: none;
}

/* -----------------------------------------------
   Responsive
----------------------------------------------- */
@media (max-width: 640px) {
    .tbge-wl-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .tbge-wl-header { flex-direction: column; align-items: flex-start; }
    .tbge-wl-share { width: 100%; }
    .tbge-wl-bulk-actions { flex-direction: column; align-items: flex-start; }
    #tbge-wl-add-all { max-width: 100%; width: 100%; }
}
@media (max-width: 400px) {
    .tbge-wl-grid { grid-template-columns: 1fr; }
}
