/**
 * Gorgeous Favorites — frontend styles
 *
 * All selectors are scoped under .gf-* class hooks so they don't bleed into
 * the rest of the theme. To override anything, target the same class with
 * higher specificity in your theme's Custom CSS.
 *
 * To disable this stylesheet entirely:
 *   add_filter( 'gorgeous_fav_load_styles', '__return_false' );
 */

/* ============================================================
   HEART ICON (single product page)
   ============================================================ */
.gf-heart-icon {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease;
}
.gf-heart-icon:hover {
    transform: scale(1.08);
}
.gf-heart-icon:active {
    transform: scale(0.96);
}
.gf-heart-icon .gf-heart-svg path {
    fill: #ffffff;
    stroke: #222222;
    stroke-width: 1.8;
    stroke-linejoin: round;
    transition: fill 0.18s ease, stroke 0.18s ease;
}
.gf-heart-icon.is-watching .gf-heart-svg path {
    fill: #e63946;
    stroke: #e63946;
}
.gf-heart-icon.gf-pulse {
    animation: gfHeartPulse 0.4s ease;
}
@keyframes gfHeartPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ============================================================
   SAVE SEARCH BUTTON
   ============================================================ */
.gf-save-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #ffffff;
    color: #222222;
    border: 1.5px solid #222222;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    font-family: inherit;
}
.gf-save-search-btn:hover {
    background: #222222;
    color: #ffffff;
}
.gf-save-search-btn.is-saved {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #2e7d32;
    pointer-events: none;
    cursor: default;
}
.gf-save-search-btn .gf-save-search-icon {
    display: inline-flex;
    align-items: center;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.gf-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    background: #1a1a1a;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    max-width: 90vw;
}
.gf-toast.gf-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.gf-toast.gf-toast-error {
    background: #c62828;
}

/* ============================================================
   WATCHLIST GRID
   ============================================================ */
.gf-watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
}
.gf-wl-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.gf-wl-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-3px);
    border-color: #d1d5db;
}
.gf-wl-card.is-unavailable {
    opacity: 0.65;
}
.gf-wl-card.is-unavailable .gf-wl-thumb img {
    filter: grayscale(0.6);
}

.gf-wl-thumb {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f9fafb;
    text-decoration: none;
}
.gf-wl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.gf-wl-card:hover .gf-wl-thumb img {
    transform: scale(1.04);
}

.gf-wl-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}
.gf-wl-badge-deal {
    background: #e63946;
    color: #ffffff;
}
.gf-wl-badge-unavailable {
    background: #6b7280;
    color: #ffffff;
}

.gf-wl-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.gf-wl-title {
    color: #111827;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}
.gf-wl-title:hover {
    color: #1a73e8;
}
.gf-wl-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
/* Intentionally no typography overrides on .gf-wl-price-current — the
   inner WooCommerce price markup (.woocommerce-Price-amount, .amount, etc.)
   inherits its styling from the theme, so prices match the rest of the site. */
.gf-wl-price-current {
    display: inline-flex;
    align-items: baseline;
}
.gf-wl-price-old {
    font-size: 0.85em;
    color: #9ca3af;
    text-decoration: line-through;
}
.gf-wl-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}
.gf-wl-buy {
    flex: 1;
    text-align: center;
    background: #111827;
    color: #ffffff;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: background 0.18s ease;
    line-height: 1.2;
}
.gf-wl-buy:hover {
    background: #1f2937;
    color: #ffffff;
}
.gf-wl-remove {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.18s ease;
    font-family: inherit;
}
.gf-wl-remove:hover {
    border-color: #c62828;
    color: #c62828;
    background: #fef2f2;
}
.gf-wl-remove span {
    display: inline-block;
}

/* ============================================================
   SAVED SEARCHES LIST
   ============================================================ */
.gf-searches-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.gf-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.gf-search-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.gf-search-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.gf-search-query-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.gf-search-icon {
    display: inline-flex;
    align-items: center;
    color: #6b7280;
    flex-shrink: 0;
}
.gf-search-query {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    word-break: break-word;
}
.gf-search-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.gf-search-chip {
    display: inline-block;
    padding: 3px 10px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.gf-search-meta {
    color: #9ca3af;
    font-size: 12px;
}
.gf-search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.gf-search-run {
    background: #111827;
    color: #ffffff;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease;
    line-height: 1.2;
    white-space: nowrap;
}
.gf-search-run:hover {
    background: #1f2937;
    color: #ffffff;
}
.gf-search-delete {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gf-search-delete:hover {
    border-color: #c62828;
    color: #c62828;
    background: #fef2f2;
}

/* ============================================================
   FOLLOWED SHOPS GRID
   ============================================================ */
.gf-shops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.gf-shop-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
    color: inherit;
}
.gf-shop-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #d1d5db;
}
.gf-shop-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f4f6;
}
.gf-shop-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
}
.gf-shop-name {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
    line-height: 1.3;
}
.gf-shop-cta {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}
.gf-shop-card:hover .gf-shop-cta {
    color: #1a73e8;
}

/* ============================================================
   COUNT BADGE (header)
   ============================================================ */
.gf-count-badge {
    display: inline-block;
    min-width: 18px;
    padding: 2px 6px;
    background: #e63946;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 10px;
    text-align: center;
    vertical-align: middle;
    margin-left: 4px;
}
.gf-count-zero {
    display: none !important;
}

/* ============================================================
   EMPTY / LOGIN STATES
   ============================================================ */
.gf-empty,
.gf-login-prompt {
    padding: 48px 24px;
    background: #fafafa;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    text-align: center;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}
.gf-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.gf-login-prompt svg {
    color: #9ca3af;
}
.gf-login-prompt p {
    margin: 0;
}
.gf-login-btn {
    display: inline-block;
    background: #111827;
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease;
}
.gf-login-btn:hover {
    background: #1f2937;
    color: #ffffff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .gf-watchlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    .gf-wl-body {
        padding: 12px;
    }
    .gf-wl-title {
        font-size: 13px;
    }
    .gf-wl-price-current {
        font-size: 14px;
    }
    .gf-wl-buy, .gf-wl-remove {
        font-size: 12px;
        padding: 8px 10px;
    }
    .gf-wl-remove span {
        display: none;
    }
    .gf-search-item {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }
    .gf-search-actions {
        justify-content: stretch;
    }
    .gf-search-run {
        flex: 1;
        text-align: center;
    }
    .gf-shops-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    .gf-shop-card {
        padding: 16px 12px;
    }
    .gf-shop-avatar,
    .gf-shop-avatar-placeholder {
        width: 56px;
        height: 56px;
    }
}

/* ============================================================
   AUTO-INJECTED SAVE SEARCH WRAPPER (archive pages)
   ============================================================ */
.gf-save-search-wrap {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 20px;
    padding: 0;
}

@media (max-width: 640px) {
    .gf-save-search-wrap {
        justify-content: stretch;
    }
    .gf-save-search-wrap .gf-save-search-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   LOGIN MODAL (shown when guest clicks heart or save-search)
   ============================================================ */
.gf-login-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: gfFadeIn 0.18s ease;
}
@keyframes gfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.gf-login-modal {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    animation: gfSlideUp 0.22s ease;
}
@keyframes gfSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.gf-login-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.18s ease;
}
.gf-login-modal-close:hover {
    color: #111827;
}
.gf-login-modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.gf-login-modal-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}
.gf-login-modal-text {
    margin: 0 0 22px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.55;
}
.gf-login-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.gf-login-modal-primary,
.gf-login-modal-secondary {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    line-height: 1.2;
}
.gf-login-modal-primary {
    background: #111827;
    color: #ffffff;
}
.gf-login-modal-primary:hover {
    background: #1f2937;
    color: #ffffff;
}
.gf-login-modal-secondary {
    background: #ffffff;
    color: #111827;
    border: 1.5px solid #d1d5db;
}
.gf-login-modal-secondary:hover {
    border-color: #111827;
}

/* ============================================================
   LOOP HEART (shop/category/tag/search product cards) — v1.5
   ============================================================ */
.gf-loop-heart-wrap {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    pointer-events: none;
}
.gf-loop-heart-wrap .gf-heart-icon {
    pointer-events: auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
}
.gf-loop-heart-wrap .gf-heart-icon:hover {
    background: #ffffff;
    transform: scale(1.06);
}
.gf-loop-heart-wrap .gf-heart-icon.is-watching {
    background: #ffffff;
}

/* The product card needs to be a positioning context.
   Most themes (Divi, Storefront, Astra) wrap the loop item in <li class="product"> or similar. */
ul.products li.product,
.woocommerce ul.products li.product,
.products .product,
.et_pb_shop ul.products li.product {
    position: relative;
}

/* ============================================================
   EMPTY SEARCH PROMPT (no products found) — v1.5
   ============================================================ */
.gf-empty-search-prompt {
    margin: 30px 0 20px;
    padding: 36px 24px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}
.gf-empty-search-inner {
    max-width: 480px;
    margin: 0 auto;
}
.gf-empty-search-heading {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}
.gf-empty-search-text {
    margin: 0 0 22px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.55;
}
.gf-empty-search-action {
    display: flex;
    justify-content: center;
}
.gf-empty-search-prompt .gf-save-search-btn {
    padding: 12px 24px;
    font-size: 15px;
}
.gf-empty-search-prompt .gf-save-search-btn::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linejoin='round'><path d='M12 21s-7.5-4.6-9.5-9.4C1.1 7.7 4.1 4 8 4c1.7 0 3.2.8 4 2 .8-1.2 2.3-2 4-2 3.9 0 6.9 3.7 5.5 7.6C19.5 16.4 12 21 12 21z'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    vertical-align: middle;
}

@media (max-width: 640px) {
    .gf-loop-heart-wrap {
        top: 6px;
        right: 6px;
    }
    .gf-loop-heart-wrap .gf-heart-icon {
        width: 30px;
        height: 30px;
    }
    .gf-empty-search-prompt {
        padding: 24px 16px;
    }
    .gf-empty-search-heading {
        font-size: 18px;
    }
}
