/* ===== WISHLIST MODAL ===== */

.wishlist-modal {
    display: none;
    position: fixed;
    z-index: 10003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.wishlist-modal-content {
    position: relative;
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.wishlist-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wishlist-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.wishlist-modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.wishlist-modal-close:hover {
    color: #333;
}

.wishlist-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.wishlist-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.gift-input,
.gift-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.gift-input {
    flex: 1;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.gift-card {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    background: #fff;
    position: relative;
}

.gift-card:hover:not(.booked) {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #8CB890;
}

.gift-card.selected {
    border-color: #8CB890;
}

.selection-tick {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #8CB890;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.gift-card.selected .selection-tick {
    opacity: 1;
    transform: scale(1);
}

.gift-image-container {
    width: 100%;
    aspect-ratio: 1;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gift-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Shrink to fit the box */
    transition: filter 0.3s ease;
}

.gift-card:hover:not(.booked) .gift-image {
    filter: blur(4px);
}

.product-link-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #8CB890;
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, transform 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gift-card:hover:not(.booked) .product-link-btn {
    opacity: 1;
}

.product-link-btn:hover {
    background: #7aa67d;
    color: white;
    transform: translate(-50%, -50%) scale(1.05);
}

@media (max-width: 600px) {
    .product-link-btn {
        opacity: 0.9;
        /* Make it visible on mobile since there is no hover */
        padding: 8px 14px;
        font-size: 0.8rem;
        top: 15px;
        right: 15px;
        left: auto;
        transform: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
}

.gift-image-placeholder {
    font-size: 3rem;
}

.gift-info {
    padding: 12px;
    text-align: center;
}

.gift-name {
    margin: 0 0 5px;
    font-size: 1rem;
    color: #333;
}

.gift-price {
    margin: 0;
    font-weight: bold;
    color: #8CB890;
}

/* Booked state */
.gift-card.booked {
    filter: grayscale(1);
    opacity: 0.7;
    cursor: not-allowed;
}

.booked-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    display: none;
}

.gift-card.booked:hover .gift-image-container .booked-overlay {
    background: rgba(220, 53, 69, 0.9) !important;
    /* Force red background on hover */
    display: block;
}

.booked-by-text {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 5px;
    font-weight: 500;
}

.wishlist-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.wishlist-cancel-btn,
.wishlist-submit-btn {
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Isadora', sans-serif;
    transition: all 0.2s ease;
}

.wishlist-cancel-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
}

.wishlist-submit-btn {
    background: #8CB890;
    border: 1px solid #8CB890;
    color: #fff;
}

.wishlist-submit-btn:hover {
    background: #7aa67d;
}

.wishlist-link {
    color: #8CB890;
    text-decoration: underline;
    cursor: pointer;
    font-size: 1.1rem;
}

.wishlist-link:hover {
    color: #7aa67d;
}

@media (max-width: 600px) {
    .gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .wishlist-controls {
        flex-direction: column;
    }
}