/* Bull Wishlist Styles */

/* Miniature wishlist button (product listings) */
.bm-wishlist-btn-mini {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
}

.bm-wishlist-btn-mini:hover {
    background-color: #fff;
    color: #e74c3c;
    transform: scale(1.1);
}

.bm-wishlist-btn-mini.in-wishlist {
    background-color: #fff;
    color: #e74c3c;
}

.bm-wishlist-btn-mini.in-wishlist:hover {
    background-color: #fff;
    color: #c0392b;
}

.bm-wishlist-btn-mini:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bm-wishlist-btn-mini svg,
.bm-wishlist-btn-mini img {
    width: 18px;
    height: 18px;
}

/* Product cover wishlist button (product page) */
.bm-wishlist-btn-cover {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    z-index: 100;
}

.bm-wishlist-btn-cover svg,
.bm-wishlist-btn-cover img {
    width: 22px;
    height: 22px;
}

/* Ensure images container can show the button */
.images-container,
.product-images,
.product-gallery {
    position: relative;
    overflow: visible;
}

/* Product page wishlist button */
.bm-wishlist-button-container {
    margin: 1rem 0;
}

.bm-wishlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bm-wishlist-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.bm-wishlist-btn.in-wishlist {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.bm-wishlist-btn.in-wishlist:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.bm-wishlist-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bm-wishlist-icon svg,
.bm-wishlist-icon img {
    width: 20px;
    height: 20px;
}

/* Show outline by default, filled when in wishlist */
.bm-wishlist-btn .bm-wishlist-icon-filled {
    display: none;
}

.bm-wishlist-btn .bm-wishlist-icon-outline {
    display: inline-flex;
}

.bm-wishlist-btn.in-wishlist .bm-wishlist-icon-filled {
    display: inline-flex;
}

.bm-wishlist-btn.in-wishlist .bm-wishlist-icon-outline {
    display: none;
}

/* Navigation wishlist link */
.bm-wishlist-nav {
    display: grid;
}

.bm-wishlist-nav a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;
    position: relative;
}

.bm-wishlist-nav a:hover {
    color: #e74c3c;
}

.bm-wishlist-nav-label {
    display: none;
}

@media (min-width: 768px) {
    .bm-wishlist-nav-label {
        display: inline;
    }
}

.bm-wishlist-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #fff;
    background-color: #e74c3c;
    border-radius: 50%;
    position: absolute;
    top: -8px;
    right: -8px;
}

/* Wishlist page styles */
.bm-wishlist-container {
    padding: 1rem 0;
}

.bm-wishlist-products table {
    width: 100%;
}

.bm-wishlist-products th {
    background-color: #f5f5f5;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.bm-wishlist-products td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

.bm-wishlist-image {
    width: 100px;
}

.bm-wishlist-image img {
    max-width: 80px;
    height: auto;
}

.bm-wishlist-name a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.bm-wishlist-name a:hover {
    color: #e74c3c;
}

.bm-wishlist-combination {
    margin-top: 0.25rem;
    color: #666;
}

.bm-wishlist-price {
    font-weight: 600;
    color: #333;
}

.bm-wishlist-actions {
    white-space: nowrap;
}

.bm-wishlist-actions .btn {
    margin-right: 0.5rem;
}

.bm-wishlist-actions .btn:last-child {
    margin-right: 0;
}

.bm-wishlist-remove {
    cursor: pointer;
}

/* Customer account link */
#bm-wishlist-link {
    text-decoration: none;
}

#bm-wishlist-link .link-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

#bm-wishlist-link:hover .link-item {
    background-color: #eee;
}

/* Toast notification */
.bm-wishlist-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.bm-wishlist-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.bm-wishlist-toast.success {
    background-color: #27ae60;
}

.bm-wishlist-toast.error {
    background-color: #e74c3c;
}

/* Multiple wishlists sidebar */
.bm-wishlists-sidebar {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bm-wishlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.bm-wishlists-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.bm-create-wishlist-btn {
    padding: 0.25rem 0.5rem;
}

.bm-create-wishlist-form {
    margin-bottom: 1rem;
}

.bm-wishlists-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bm-wishlist-item {
    position: relative;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.bm-wishlist-item:hover {
    background-color: #e9ecef;
}

.bm-wishlist-item.active {
    background-color: #e74c3c;
}

.bm-wishlist-item.active .bm-wishlist-link {
    color: #fff;
}

.bm-wishlist-item.active .bm-wishlist-menu-btn {
    color: #fff;
}

.bm-wishlist-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: #333;
    text-decoration: none;
    flex: 1;
}

.bm-wishlist-link:hover {
    text-decoration: none;
}

.bm-wishlist-item.active .bm-wishlist-link:hover {
    color: #fff;
}

.bm-wishlist-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-wishlist-count-badge {
    background-color: #6c757d;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}

.bm-wishlist-item.active .bm-wishlist-count-badge {
    background-color: rgba(255, 255, 255, 0.3);
}

.bm-wishlist-default-badge {
    color: #ffc107;
    margin-left: 0.25rem;
}

.bm-wishlist-item.active .bm-wishlist-default-badge {
    color: #fff;
}

.bm-wishlist-actions-dropdown {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.bm-wishlist-menu-btn {
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #6c757d;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bm-wishlist-item:hover .bm-wishlist-menu-btn {
    opacity: 1;
}

.bm-wishlist-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 150px;
}

.bm-wishlist-dropdown-menu.show {
    display: block;
}

.bm-wishlist-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
}

.bm-wishlist-dropdown-menu button:hover {
    background-color: #f8f9fa;
}

.bm-wishlist-dropdown-menu .bm-delete-wishlist {
    color: #dc3545;
}

/* Wishlist content header */
.bm-wishlist-content-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.bm-wishlist-content-header h2 {
    margin: 0;
}

/* Modal styles */
.bm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.bm-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.bm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.bm-modal-header h4 {
    margin: 0;
}

.bm-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.bm-modal-body {
    padding: 1.5rem;
}

.bm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* Stock alert button */
.bm-stock-alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #17a2b8;
    background-color: #fff;
    color: #17a2b8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.bm-stock-alert-btn:hover {
    background-color: #17a2b8;
    color: #fff;
}

.bm-stock-alert-btn.active {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
}

.bm-stock-alert-btn.active:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.bm-stock-alert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bm-stock-alert-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.bm-stock-alert-text {
    white-space: nowrap;
}

/* Out of stock indicator on product row */
.bm-wishlist-product-row.out-of-stock .bm-wishlist-price::after {
    content: "Out of stock";
    display: block;
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: normal;
    margin-top: 0.25rem;
}

/* Wishlist selector dropdown (for miniature buttons) */
.bm-wishlist-selector {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 200px;
    max-width: 280px;
    overflow: hidden;
    animation: bm-dropdown-fade 0.2s ease;
}

@keyframes bm-dropdown-fade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bm-wishlist-selector-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
}

.bm-wishlist-selector-list {
    max-height: 200px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bm-wishlist-selector-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.bm-wishlist-selector-item:last-child {
    border-bottom: none;
}

.bm-wishlist-selector-item:hover {
    background-color: #f8f9fa;
}

.bm-wishlist-selector-item.has-product {
    background-color: #e8f5e9;
}

.bm-wishlist-selector-item.has-product:hover {
    background-color: #c8e6c9;
}

.bm-wishlist-selector-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #333;
}

.bm-wishlist-selector-item-check {
    color: #27ae60;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.bm-wishlist-selector-item-count {
    font-size: 0.75rem;
    color: #6c757d;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.bm-wishlist-selector-default {
    color: #ffc107;
    margin-left: 0.25rem;
}

.bm-wishlist-selector-create {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    color: #e74c3c;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.bm-wishlist-selector-create:hover {
    background-color: #fef5f5;
}

.bm-wishlist-selector-create svg {
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Create new wishlist form in selector */
.bm-wishlist-selector-create-form {
    padding: 0.75rem 1rem;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
}

.bm-wishlist-selector-create-form input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.bm-wishlist-selector-create-form input:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

.bm-wishlist-selector-create-actions {
    display: flex;
    gap: 0.5rem;
}

.bm-wishlist-selector-create-actions button {
    flex: 1;
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.bm-wishlist-selector-save {
    background-color: #e74c3c;
    color: #fff;
}

.bm-wishlist-selector-save:hover {
    background-color: #c0392b;
}

.bm-wishlist-selector-save:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.bm-wishlist-selector-cancel {
    background-color: #f0f0f0;
    color: #333;
}

.bm-wishlist-selector-cancel:hover {
    background-color: #e0e0e0;
}

/* Loading state */
.bm-wishlist-selector-loading {
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Wrapper for positioning */
.bm-wishlist-btn-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.bm-wishlist-btn-wrapper .bm-wishlist-btn-mini {
    position: relative;
    top: auto;
    right: auto;
}

/* Adjust selector position for cover button */
.bm-wishlist-btn-wrapper .bm-wishlist-btn-cover {
    position: relative;
    top: auto;
    right: auto;
}

/* Mobile: position dropdown to not overflow screen */
@media (max-width: 480px) {
    .bm-wishlist-selector {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: none;
        border-radius: 16px 16px 0 0;
        animation: bm-dropdown-slide-up 0.25s ease;
    }

    @keyframes bm-dropdown-slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .bm-wishlist-selector-list {
        max-height: 50vh;
    }
}

/* Mobile responsive */
@media (max-width: 767px) {
    .bm-wishlist-products table,
    .bm-wishlist-products thead,
    .bm-wishlist-products tbody,
    .bm-wishlist-products th,
    .bm-wishlist-products td,
    .bm-wishlist-products tr {
        display: block;
    }

    .bm-wishlist-products thead {
        display: none;
    }

    .bm-wishlist-products tr {
        margin-bottom: 1rem;
        border: 1px solid #eee;
        border-radius: 4px;
        padding: 1rem;
    }

    .bm-wishlist-products td {
        border: none;
        padding: 0.5rem 0;
        text-align: left;
    }

    .bm-wishlist-products td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 0.5rem;
    }

    .bm-wishlist-image {
        width: 100%;
        text-align: center;
    }

    .bm-wishlist-actions {
        text-align: center;
        margin-top: 0.5rem;
    }

    .bm-wishlist-actions .btn {
        display: inline-block;
        margin-bottom: 0.5rem;
        margin-right: 0.25rem;
    }

    .bm-wishlists-sidebar {
        margin-bottom: 1.5rem;
    }

    .bm-wishlist-menu-btn {
        opacity: 1;
    }
}
