/* =============================================================
   RT WISHLIST — Stylesheet
   Primary Color : #6B705C (Sage / Olive Green)
   Background    : #F9F8F6 (Champagne Sand)
   Accent        : #6B705C
   Font          : Poppins (body), Belleza (headings)
   ============================================================= */

/* ─────────────────────────────────────────────
   CSS VARIABLES
───────────────────────────────────────────── */
:root {
    --rt-primary       : #6B705C;
    --rt-primary-dark  : #555947;
    --rt-primary-light : #8a9079;
    --rt-sand          : #F9F8F6;
    --rt-sand-dark     : #eeece8;
    --rt-text          : #1a1a1a;
    --rt-muted         : #888;
    --rt-border        : #ddd;
    --rt-red           : #c0392b;
    --rt-white         : #ffffff;
    --rt-radius        : 6px;
    --rt-shadow        : 0 4px 20px rgba(0,0,0,0.08);
    --rt-transition    : 0.22s ease;
}

/* ─────────────────────────────────────────────
   HEART BUTTON — SHOP / ARCHIVE LOOP CARD
   (Positioned absolute, top-right of image)
───────────────────────────────────────────── */

/* Make WooCommerce product image wrapper relative so we can position absolutely inside */
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce ul.products li.product a:has(img),
.woocommerce-product-gallery {
    position: relative;
    display: block;
}

.rt-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--rt-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform var(--rt-transition), box-shadow var(--rt-transition);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.rt-wishlist-btn:hover,
.rt-wishlist-btn:focus-visible {
    transform: scale(1.12);
    box-shadow: 0 4px 16px rgba(107, 112, 92, 0.25);
}

.rt-wishlist-btn:focus-visible {
    outline: 2px solid var(--rt-primary);
    outline-offset: 2px;
}

/* Heart icon — unfilled (default) */
.rt-wishlist-btn .rt-heart-icon path {
    fill: none;
    stroke: var(--rt-primary);
    stroke-width: 1.6px;
    transition: fill var(--rt-transition), stroke var(--rt-transition);
}

/* Heart icon — filled (active / in wishlist) */
.rt-wishlist-btn.active .rt-heart-icon path {
    fill: var(--rt-primary);
    stroke: var(--rt-primary);
}

/* Pulse animation when toggled */
@keyframes rt-heartbeat {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.35); }
    60%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.rt-wishlist-btn.rt-animating .rt-heart-icon {
    animation: rt-heartbeat 0.45s ease forwards;
}

/* ─────────────────────────────────────────────
   HEART BUTTON — SINGLE PRODUCT PAGE
   Square box, icon only, next to qty selector
───────────────────────────────────────────── */

/* JS creates this wrapper to hold qty + heart on same row */
.rt-qty-heart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
}

/* The heart button itself — square box, icon only */
.rt-wishlist-single {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    flex: 0 0 52px !important;
    border-radius: 4px !important;
    background: transparent !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    transform: none !important;
    transition: border-color var(--rt-transition), background var(--rt-transition);
    -webkit-tap-highlight-color: transparent;
}

.rt-wishlist-single:hover {
    border-color: var(--rt-primary) !important;
    background: transparent !important;
    transform: none !important;
}

/* Heart icon inside — outline style */
.rt-wishlist-single .rt-heart-icon path {
    fill: none !important;
    stroke: var(--rt-primary) !important;
    stroke-width: 1.5px;
    transition: fill var(--rt-transition), stroke var(--rt-transition);
}

/* Active — filled heart when saved */
.rt-wishlist-single.active {
    border-color: var(--rt-primary) !important;
    background: transparent !important;
}

.rt-wishlist-single.active .rt-heart-icon path {
    fill: var(--rt-primary) !important;
    stroke: var(--rt-primary) !important;
}

/* Heartbeat animation on toggle */
.rt-wishlist-single.rt-animating .rt-heart-icon {
    animation: rt-heartbeat 0.45s ease forwards;
}

/* Mobile */
@media screen and (max-width: 480px) {
    .rt-wishlist-single {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        flex: 0 0 48px !important;
    }
}

/* ─────────────────────────────────────────────
   WISHLIST COUNTER BADGE (for navbar icon)
   Add class .rt-wishlist-counter-wrap to your
   Elementor icon wrapper
───────────────────────────────────────────── */
.rt-wishlist-counter-wrap {
    position: relative;
    display: inline-flex;
}

.rt-wishlist-count-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--rt-primary);
    color: var(--rt-white);
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.rt-wishlist-count-badge.rt-badge-hidden {
    opacity: 0;
    transform: scale(0.5);
}

/* Inline count spans updated by JS */
.rt-wishlist-count {
    font-weight: 700;
    color: var(--rt-primary);
}

/* ─────────────────────────────────────────────
   TOAST NOTIFICATION
───────────────────────────────────────────── */
#rt-wishlist-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    background: var(--rt-text);
    color: var(--rt-white);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    padding: 12px 20px 12px 16px;
    border-radius: var(--rt-radius);
    box-shadow: var(--rt-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 320px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

#rt-wishlist-toast.rt-toast-show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#rt-wishlist-toast .rt-toast-icon {
    color: var(--rt-primary);
    flex-shrink: 0;
    font-size: 16px;
}

#rt-wishlist-toast .rt-toast-link {
    color: var(--rt-primary-light);
    text-decoration: underline;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

/* ─────────────────────────────────────────────
   WISHLIST PAGE — LAYOUT
───────────────────────────────────────────── */
.rt-wishlist-page {
    font-family: 'Poppins', sans-serif;
    color: var(--rt-text);
    padding: 10px 0 60px;
}

.rt-wishlist-page h1,
.rt-wishlist-header h2 {
    font-family: 'Belleza', sans-serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--rt-text);
    margin-bottom: 6px;
}

/* Shared wishlist banner */
.rt-wishlist-shared-banner {
    background: var(--rt-sand);
    border-left: 4px solid var(--rt-primary);
    padding: 14px 20px;
    border-radius: var(--rt-radius);
    font-size: 14px;
    color: var(--rt-primary-dark);
    margin-bottom: 28px;
}

/* ─────────────────────────────────────────────
   WISHLIST PAGE — TOOLBAR (count + share)
───────────────────────────────────────────── */
.rt-wishlist-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--rt-border);
}

.rt-wishlist-toolbar-left {
    font-size: 14px;
    color: var(--rt-muted);
}

.rt-wishlist-toolbar-left strong {
    color: var(--rt-text);
    font-weight: 600;
}

.rt-wishlist-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--rt-primary);
    border: 1.5px solid var(--rt-primary);
    background: transparent;
    border-radius: var(--rt-radius);
    padding: 8px 16px;
    cursor: pointer;
    transition: background var(--rt-transition), color var(--rt-transition);
    text-decoration: none;
}

.rt-wishlist-share-btn:hover {
    background: var(--rt-primary);
    color: var(--rt-white);
}

/* ─────────────────────────────────────────────
   WISHLIST PAGE — TABLE
───────────────────────────────────────────── */
.rt-wishlist-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.rt-wishlist-table thead th {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rt-muted);
    padding: 0 16px 14px;
    text-align: left;
    border-bottom: 2px solid var(--rt-border);
}

.rt-wishlist-table thead th:last-child {
    text-align: right;
}

.rt-wishlist-table tbody tr {
    border-bottom: 1px solid var(--rt-sand-dark);
    transition: background var(--rt-transition);
}

.rt-wishlist-table tbody tr:hover {
    background: var(--rt-sand);
}

.rt-wishlist-table td {
    padding: 18px 16px;
    vertical-align: middle;
}

/* Product image cell */
.rt-wishlist-table .rt-wl-img-cell {
    width: 100px;
    padding-right: 0;
}

.rt-wishlist-table .rt-wl-thumb {
    width: 88px;
    height: 88px;
    border-radius: var(--rt-radius);
    object-fit: cover;
    display: block;
    background: var(--rt-sand-dark);
}

/* Product name */
.rt-wl-product-name {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--rt-text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    transition: color var(--rt-transition);
}

.rt-wl-product-name:hover {
    color: var(--rt-primary);
}

.rt-wl-product-sku {
    font-size: 12px;
    color: var(--rt-muted);
}

/* Price */
.rt-wl-price {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--rt-primary);
    white-space: nowrap;
}

.rt-wl-price del {
    font-size: 13px;
    color: var(--rt-muted);
    font-weight: 400;
    display: block;
    text-decoration: line-through;
}

/* Stock */
.rt-wl-stock {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
}

.rt-wl-stock.in-stock {
    background: rgba(107, 112, 92, 0.12);
    color: var(--rt-primary-dark);
}

.rt-wl-stock.out-of-stock {
    background: rgba(192, 57, 43, 0.10);
    color: var(--rt-red);
}

/* Actions cell */
.rt-wl-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.rt-wl-add-to-cart {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--rt-primary);
    color: var(--rt-white);
    border: none;
    border-radius: var(--rt-radius);
    padding: 10px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--rt-transition), transform var(--rt-transition);
}

.rt-wl-add-to-cart:hover {
    background: var(--rt-primary-dark);
    color: var(--rt-white);
    transform: translateY(-1px);
}

.rt-wl-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--rt-muted);
    font-size: 18px;
    line-height: 1;
    transition: color var(--rt-transition), transform var(--rt-transition);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    vertical-align: middle;
}

.rt-wl-remove-btn:hover {
    color: var(--rt-red);
    transform: scale(1.2);
}

/* ─────────────────────────────────────────────
   WISHLIST PAGE — EMPTY STATE
───────────────────────────────────────────── */
.rt-wishlist-empty {
    text-align: center;
    padding: 70px 20px;
}

.rt-wishlist-empty .rt-empty-heart {
    font-size: 64px;
    color: var(--rt-sand-dark);
    margin-bottom: 20px;
    display: block;
}

.rt-wishlist-empty h3 {
    font-family: 'Belleza', sans-serif;
    font-size: 26px;
    font-weight: 400;
    color: var(--rt-text);
    margin-bottom: 10px;
}

.rt-wishlist-empty p {
    font-size: 15px;
    color: var(--rt-muted);
    margin-bottom: 28px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.rt-wishlist-empty .rt-shop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--rt-primary);
    color: var(--rt-white);
    border-radius: var(--rt-radius);
    padding: 14px 32px;
    text-decoration: none;
    transition: background var(--rt-transition);
}

.rt-wishlist-empty .rt-shop-btn:hover {
    background: var(--rt-primary-dark);
    color: var(--rt-white);
}

/* ─────────────────────────────────────────────
   MOBILE — Responsive Table → Cards
───────────────────────────────────────────── */
@media screen and (max-width: 768px) {

    .rt-wishlist-table thead {
        display: none;
    }

    .rt-wishlist-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        padding: 16px 0;
        border-bottom: 1px solid var(--rt-border);
        gap: 12px;
        align-items: flex-start;
    }

    .rt-wishlist-table td {
        padding: 0;
        border: none;
    }

    .rt-wishlist-table .rt-wl-img-cell {
        width: 80px;
        flex-shrink: 0;
    }

    .rt-wishlist-table .rt-wl-thumb {
        width: 80px;
        height: 80px;
    }

    .rt-wishlist-table .rt-wl-name-cell {
        flex: 1;
        min-width: 0;
    }

    .rt-wishlist-table .rt-wl-price-cell,
    .rt-wishlist-table .rt-wl-stock-cell {
        width: 50%;
        box-sizing: border-box;
    }

    .rt-wishlist-table .rt-wl-actions-cell {
        width: 100%;
        text-align: left;
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: space-between;
    }

    .rt-wishlist-share-btn span {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .rt-wishlist-page h1,
    .rt-wishlist-header h2 {
        font-size: 24px;
    }

    .rt-wishlist-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .rt-wl-add-to-cart {
        font-size: 12px;
        padding: 9px 14px;
    }
}
