/**
 * 위시리스트 위젯 스타일
 */

/* ========================================
   위시리스트 버튼
   ======================================== */

.btn-wishlist {
    position: absolute;
    bottom: 12px;
    right: 12px;
    top: auto;
    left: auto;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 15; /* 다른 요소들보다 위에 표시 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-wishlist:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.btn-wishlist:active {
    transform: scale(0.95);
}

.btn-wishlist.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* 하트 아이콘 SVG */
.btn-wishlist svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #e74c3c;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.btn-wishlist:hover svg {
    stroke-width: 2.5;
}

/* 활성 상태 (위시리스트에 추가됨) */
.btn-wishlist.active svg {
    fill: #e74c3c;
    stroke: #e74c3c;
    animation: heartBeat 0.5s ease;
}

/* 하트 비트 애니메이션 */
@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.2);
    }
}

/* 로딩 애니메이션 */
.btn-wishlist.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   토스트 알림
   ======================================== */

.wishlist-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #333;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 300px;
    word-break: keep-all;
}

.wishlist-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 토스트 타입별 색상 */
.wishlist-toast-success {
    background: #27ae60;
}

.wishlist-toast-error {
    background: #e74c3c;
}

.wishlist-toast-warning {
    background: #f39c12;
}

.wishlist-toast-info {
    background: #3498db;
}

/* ========================================
   반응형 디자인
   ======================================== */

@media (max-width: 768px) {
    .btn-wishlist {
        width: 36px;
        height: 36px;
        /* 위치 명확하게 고정 */
        position: absolute !important;
        bottom: 10px !important;
        right: 10px !important;
        top: auto !important;
        left: auto !important;
    }

    .btn-wishlist svg {
        width: 18px;
        height: 18px;
    }

    .wishlist-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .btn-wishlist {
        width: 32px;
        height: 32px;
        /* 작은 모바일에서도 위치 명확하게 고정 */
        position: absolute !important;
        bottom: 8px !important;
        right: 8px !important;
        top: auto !important;
        left: auto !important;
    }

    .btn-wishlist svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   접근성 개선
   ======================================== */

.btn-wishlist:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.btn-wishlist:focus:not(:focus-visible) {
    outline: none;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .btn-wishlist {
        background: #fff;
        border: 2px solid #000;
    }

    .btn-wishlist svg {
        stroke: #000;
    }

    .btn-wishlist.active svg {
        fill: #e74c3c;
        stroke: #000;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .btn-wishlist {
        background: rgba(0, 0, 0, 0.7);
    }

    .btn-wishlist:hover {
        background: rgba(0, 0, 0, 0.9);
    }

    .wishlist-toast {
        background: #1a1a1a;
        color: #fff;
    }

    .wishlist-toast-success {
        background: #1e7e34;
    }

    .wishlist-toast-error {
        background: #c0392b;
    }

    .wishlist-toast-warning {
        background: #d68910;
    }

    .wishlist-toast-info {
        background: #2980b9;
    }
}
