/* ==============================================
   Creet Wishlist — Frontend CSS
   CSS class prefix: creet-wl-
   ============================================== */

/* ---- Heart button on product cards ---- */
.creet-wl-btn {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    background-color: rgba(255, 255, 255, 0.92) !important;
    border: none !important;
    border-color: transparent !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.2s !important;
    z-index: 5 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14) !important;
    padding: 0 !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
    text-indent: 0 !important;
    font-size: 0 !important;
}

.creet-wl-btn:hover {
    background: #fff !important;
    background-color: #fff !important;
    transform: scale(1.12) !important;
    color: #ef4444 !important;
    border-color: transparent !important;
}

.creet-wl-btn:focus {
    outline: 2px solid #fca5a5;
    outline-offset: 2px;
}

.creet-wl-btn svg {
    display: block;
    pointer-events: none;
    transition: fill 0.2s, stroke 0.2s;
    font-size: 20px;
}

.creet-wl-btn--active {
    color: #ef4444 !important;
}

.creet-wl-btn--active svg path {
    fill: #ef4444;
    stroke: #ef4444;
}

/* Ensure product card wrapper is positioned for absolute btn */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    position: relative;
}

/* ---- Wishlist counter in nav ---- */
.creet-wl-counter {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.creet-wl-count {
    background: #C3FD73;
    color: #000;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -6px;
    right: -6px;
    line-height: 1;
}

.creet-wl-count:empty,
.creet-wl-count[data-count="0"] {
    display: none;
}

/* ---- My Account wishlist grid ---- */
.creet-wl-account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    direction: rtl;
}

@media (max-width: 782px) {
    .creet-wl-account-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ---- Account wishlist product card ---- */
.creet-wl-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.creet-wl-card:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
}

.creet-wl-card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.creet-wl-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.creet-wl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.creet-wl-card:hover .creet-wl-card-image img {
    transform: scale(1.04);
}

.creet-wl-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.creet-wl-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.creet-wl-card-name:hover {
    color: #1a1a2e;
    text-decoration: underline;
}

.creet-wl-card-price {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.creet-wl-card-price ins {
    text-decoration: none;
    color: #0f172a;
}

.creet-wl-card-price del {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 400;
    margin-left: 4px;
}

.creet-wl-card-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.creet-wl-add-to-cart {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    width: 100%;
    padding: 6px 12px !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.creet-wl-add-to-cart:hover {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #0f172a !important;
    text-decoration: none;
}

.creet-wl-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: color 0.2s, border-color 0.2s;
    text-align: center;
}

.creet-wl-remove-btn:hover {
    color: #ef4444;
    border-color: #fca5a5;
}

.creet-wl-remove-btn svg {
    flex-shrink: 0;
}

/* ---- Empty state ---- */
.creet-wl-empty {
    text-align: center;
    padding: 48px 24px;
    direction: rtl;
}

.creet-wl-empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: #cbd5e1;
}

.creet-wl-empty p {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 16px;
}

.creet-wl-empty-link {
    display: inline-block;
    padding: 10px 24px;
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s;
}

.creet-wl-empty-link:hover {
    background: #1e293b;
    color: #fff;
    text-decoration: none;
}

/* ---- Toast notification ---- */
.creet-wl-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 500;
    font-size: 13px;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    white-space: nowrap;
    direction: rtl;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.creet-wl-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- Single product page heart button ---- */
.creet-wl-single-wrap {
    display: inline-block;
    margin: 0;
}

/* Override the global theme button rule that injects primary-color bg */
.creet-wl-single-btn.creet-wl-btn,
.creet-wl-single-btn {
    position: static !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: border-color 0.2s, background 0.2s, transform 0.15s !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    color: #94a3b8 !important;
    font-size: 0 !important;
    text-indent: 0 !important;
    top: auto !important;
    left: auto !important;
}

.creet-wl-single-btn.creet-wl-btn svg {
    font-size: 20px;
}

.creet-wl-single-btn.creet-wl-btn:hover,
.creet-wl-single-btn:hover {
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
    background-color: #fff5f5 !important;
    transform: scale(1.08) !important;
    color: #ef4444 !important;
}

.creet-wl-single-btn.creet-wl-btn--active {
    border-color: #ef4444 !important;
    background: #fff5f5 !important;
    background-color: #fff5f5 !important;
    color: #ef4444 !important;
}

.creet-wl-single-btn.creet-wl-btn--active svg path {
    fill: #ef4444;
    stroke: #ef4444;
}
