/* ═══════════════════════════════════════════════════════
   AGC Wishlist — Frontend styles
   ═══════════════════════════════════════════════════════ */

/* ── Heart button (inline / loop) ───────────────────── */
.agc-wl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 7px;
    border-radius: 50%;
    color: #999;
    line-height: 1;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    vertical-align: middle;
}
.agc-wl-icon {
    display: block;
    flex-shrink: 0;
}
.agc-wl-icon--fill {
    display: none;
}
.agc-wl-btn--active .agc-wl-icon--outline {
    display: none;
}
.agc-wl-btn--active .agc-wl-icon--fill {
    display: block;
}
.agc-wl-btn-label {
    font-size: 13px;
    line-height: 1;
}
.agc-wl-btn:hover {
    background: rgba(220, 38, 38, 0.07);
    color: #dc2626;
}
.agc-wl-btn--active {
    color: #dc2626;
}
.agc-wl-btn--active i {
    animation: agc-wl-pop 0.25s ease;
}
.agc-wl-btn--loading {
    pointer-events: none;
    opacity: 0.5;
}
@keyframes agc-wl-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Loop wrap (auto-injected overlay) */
.agc-wl-loop-wrap {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}
.agc-wl-loop-wrap .agc-wl-btn {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 7px;
}
.agc-wl-loop-wrap .agc-wl-btn:hover {
    background: #fff;
}

/* ── Counter link (header) ──────────────────────────── */
.agc-wl-counter-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 6px;
    color: inherit;
    text-decoration: none;
    line-height: 1;
}
.agc-wl-counter-link i {
    font-size: 22px;
    display: block;
}
.agc-wl-counter {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    border-radius: 999px;
    text-align: center;
    transform: translate(30%, -20%);
}

/* ── Page: toolbar ──────────────────────────────────── */
.agc-wl-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
}
.agc-wl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
.agc-wl-toolbar-count {
    font-size: 14px;
    color: #666;
}
.agc-wl-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.agc-wl-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    line-height: 1;
}
.agc-wl-tool-btn i { font-size: 15px; }
.agc-wl-tool-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}
.agc-wl-tool-btn--danger {
    color: #c0392b;
    border-color: #f5c6c2;
}
.agc-wl-tool-btn--danger:hover {
    background: #fff5f5;
    border-color: #e0756d;
}

/* ── Page: product grid ─────────────────────────────── */
.agc-wl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.agc-wl-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}
.agc-wl-item:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.09);
}

/* Removing animation */
.agc-wl-item--removing {
    animation: agc-wl-fadeout 0.3s ease forwards;
    pointer-events: none;
}
@keyframes agc-wl-fadeout {
    to { opacity: 0; transform: scale(0.95); }
}

/* Image area */
.agc-wl-item-img {
    position: relative;
    background: #f8f8f8;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.agc-wl-item-img a {
    display: block;
    width: 100%;
    height: 100%;
}
.agc-wl-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}
.agc-wl-item:hover .agc-wl-item-img img {
    transform: scale(1.04);
}

/* Quick-remove X button */
.agc-wl-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    transition: background 0.12s, color 0.12s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    opacity: 0;
}
.agc-wl-item:hover .agc-wl-item-remove {
    opacity: 1;
}
.agc-wl-item-remove:hover {
    background: #fff;
    color: #c0392b;
}
.agc-wl-item-remove i { font-size: 14px; }

/* Badges */
.agc-wl-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 4;
}
.agc-wl-badge--sale { background: #dc2626; color: #fff; }
.agc-wl-badge--out  { background: #555;    color: #fff; }

/* Item body */
.agc-wl-item-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.agc-wl-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #111;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.agc-wl-item-name:hover { color: #dc2626; }

.agc-wl-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}
.agc-wl-item-price del {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    margin-right: 4px;
}
.agc-wl-item-price ins {
    text-decoration: none;
}
.agc-wl-item-date {
    font-size: 11px;
    color: #aaa;
}

/* Note textarea */
.agc-wl-item-note {
    width: 100%;
    resize: none;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    transition: border-color 0.15s;
    font-family: inherit;
    background: #fafafa;
    box-sizing: border-box;
}
.agc-wl-item-note:focus {
    outline: none;
    border-color: #dc2626;
    background: #fff;
}
.agc-wl-item-note.agc-wl-note-saved {
    border-color: #22c55e;
}

/* Move to cart button */
.agc-wl-move-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 12px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s;
    line-height: 1;
}
.agc-wl-move-btn i { font-size: 15px; }
.agc-wl-move-btn:hover { background: #333; }
.agc-wl-move-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Empty state ─────────────────────────────────────── */
.agc-wl-empty {
    text-align: center;
    padding: 64px 24px;
    color: #888;
}
.agc-wl-empty i {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    color: #ddd;
}
.agc-wl-empty p {
    font-size: 16px;
    margin: 0 0 20px;
    color: #666;
}
.agc-wl-empty-cta {
    display: inline-block;
    padding: 11px 24px;
    background: #111;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s;
}
.agc-wl-empty-cta:hover {
    background: #333;
    color: #fff;
}

/* ── Shared banner ───────────────────────────────────── */
.agc-wl-shared-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #92400e;
}
.agc-wl-shared-banner i { font-size: 18px; }

/* ── Share modal ─────────────────────────────────────── */
.agc-wl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    animation: agc-wl-fade 0.15s ease;
}
.agc-wl-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 28px;
    width: min(420px, calc(100vw - 32px));
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    animation: agc-wl-modal-in 0.2s ease;
}
@keyframes agc-wl-modal-in {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes agc-wl-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.agc-wl-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f4f4f4;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.12s;
}
.agc-wl-modal-close:hover { background: #eee; color: #111; }
.agc-wl-modal-close i { font-size: 16px; }

.agc-wl-modal-icon {
    width: 52px;
    height: 52px;
    background: #fff0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.agc-wl-modal-icon i { font-size: 26px; color: #dc2626; }
.agc-wl-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0 0 6px;
}
.agc-wl-modal-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 20px;
}

.agc-wl-share-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.agc-wl-share-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #333;
    background: #f9f9f9;
    cursor: text;
}
.agc-wl-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 14px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s;
    flex-shrink: 0;
}
.agc-wl-copy-btn:hover { background: #333; }
.agc-wl-copy-btn i { font-size: 15px; }

.agc-wl-share-socials {
    display: flex;
    gap: 10px;
}
.agc-wl-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: filter 0.12s;
    line-height: 1;
}
.agc-wl-social--wa {
    background: #25d366;
    color: #fff;
}
.agc-wl-social--wa:hover { filter: brightness(0.9); color: #fff; }
.agc-wl-social--link {
    background: #f4f4f4;
    color: #333;
}
.agc-wl-social--link:hover { background: #e8e8e8; }
.agc-wl-social i { font-size: 16px; }

/* ── Toast notification ──────────────────────────────── */
.agc-wl-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #111;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.agc-wl-toast.agc-wl-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.agc-wl-toast.agc-wl-toast--success { background: #16a34a; }
.agc-wl-toast.agc-wl-toast--error   { background: #dc2626; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .agc-wl-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .agc-wl-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    .agc-wl-share-socials {
        flex-direction: column;
    }
}
