/* ============================================
   Wishlist Styles
   ============================================ */

/* Wishlist Page */
.novateplica-wishlist-page {
    margin: 20px auto;
    padding: 0 20px;
    max-width: 1390px;
}

/* Header */
.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.wishlist-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wishlist-title i {
    color: #ff4757;
    font-size: 28px;
}

[data-theme="dark"] .wishlist-title {
    color: #ffffff;
}

/* Removed conflicting wishlist-count styles that broke header badge centering */
/* .wishlist-count { ... } was causing issues */

.count-number {
    font-size: 36px;
    font-weight: 700;
    color: #4CAF50;
}

.count-text {
    font-size: 16px;
    color: #666;
}

/* Empty State */
.wishlist-empty {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 120px;
    color: #e0e0e0;
    margin-bottom: 30px;
}

.wishlist-empty h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

.wishlist-empty p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-continue-shopping:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Controls */
.wishlist-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: flex-end;
}

.btn-clear-wishlist,
.btn-add-all-to-cart {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #333;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear-wishlist:hover {
    border-color: #ff4757;
    color: #ff4757;
    background: #fff5f5;
}

.btn-add-all-to-cart {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.btn-add-all-to-cart:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Объединенные стили из wishlist-fixes.css */

/* Prevent horizontal scroll */
body.page-template-page-wishlist {
    overflow-x: hidden;
}

.page-template-page-wishlist .site-content {
    background: #f9fafb;
    padding: 40px 0;
    min-height: 60vh;
}

/* Fix wishlist count wrapper */
.wishlist-count-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.wishlist-count-wrapper .count-number {
    font-size: 36px;
    font-weight: 700;
    color: #4CAF50;
}

.wishlist-count-wrapper .count-text {
    font-size: 16px;
    color: #666;
}

/* header styling */
.wishlist-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
}

/* Grid Fix: Remove container grid to let UL handle layout */
.wishlist-grid {
    display: block;
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.wishlist-grid ul.products {
    display: grid;
    /* Forces 6 columns on large screens */
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    border-top: 1px solid #e9e9e9;
    border-left: 1px solid #e9e9e9;
    padding: 0;
    margin: 0;
    list-style: none;
    box-sizing: border-box;
    width: 100%;
}

.wishlist-grid ul.products li.product {
    margin: 0;
    padding: 0;
    width: auto;
    float: none;
    list-style: none;
    display: block;
}

/* Smaller padding for smaller cards */
.wishlist-grid ul.products li.product .novateplica-product-card {
    padding: 12px 10px;
}

/* Fix for potential ghost items */
.wishlist-grid ul.products::before,
.wishlist-grid ul.products::after {
    display: none !important;
}

@media (max-width: 768px) {
    .wishlist-grid ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* Item removed since we use content-product.php, but let's keep it visible just in case */
.wishlist-item {
    display: block;
}


/* Wishlist Button (Loop) */
.novateplica-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.novateplica-wishlist-btn:hover {
    color: #ff4757;
    transform: scale(1.1);
}

.novateplica-wishlist-btn.in-wishlist {
    color: #ff4757;
    background: #fff5f5;
}

.novateplica-wishlist-btn.in-wishlist i {
    animation: heartBeat 0.3s ease;
}

/* Wishlist Button (Single Product) */
.novateplica-wishlist-btn-single {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #333;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.novateplica-wishlist-btn-single:hover {
    border-color: #ff4757;
    color: #ff4757;
    background: #fff5f5;
}

.novateplica-wishlist-btn-single.in-wishlist {
    border-color: #ff4757;
    color: #ff4757;
    background: #fff5f5;
}

.novateplica-wishlist-btn-single i {
    font-size: 18px;
}

/* Animation */
@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1.1);
    }

    75% {
        transform: scale(1.2);
    }
}

/* Responsive */
@media (max-width: 1400px) {
    .wishlist-grid ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    .wishlist-grid ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .novateplica-wishlist-page {
        padding: 0 15px;
    }

    .wishlist-grid {
        display: block;
    }

    .wishlist-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .wishlist-grid ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        border-top: none !important;
        border-left: none !important;
    }

    /* Stack actions on mobile if they don't fit */
    .wishlist-grid .product-actions.variable-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .wishlist-grid .product-actions.variable-actions .btn-small {
        width: 100% !important;
    }

    .wishlist-grid .var-trigger-wrapper.inline-trigger {
        margin-top: 5px !important;
        text-align: center;
    }

    .wishlist-controls {
        flex-direction: column;
        width: 100%;
    }

    .btn-clear-wishlist,
    .btn-add-all-to-cart {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Custom Confirm Modal
   ============================================ */

.novateplica-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.novateplica-confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.novateplica-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.novateplica-confirm-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    text-align: center;
}

.novateplica-confirm-modal.show .novateplica-confirm-content {
    transform: scale(1);
}

.novateplica-confirm-icon {
    font-size: 64px;
    color: #ff9800;
    margin-bottom: 20px;
}

.novateplica-confirm-message {
    font-size: 18px;
    color: #333;
    margin-bottom: 30px;
    font-weight: 500;
    line-height: 1.5;
}

.novateplica-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.novateplica-confirm-no,
.novateplica-confirm-yes {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.novateplica-confirm-no {
    background: #e0e0e0;
    color: #333;
}

.novateplica-confirm-no:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

.novateplica-confirm-yes {
    background: #4CAF50;
    color: white;
}

.novateplica-confirm-yes:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Prevent page shift when modal opens */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* Notification Types Upgrade */
.wishlist-notification.report .notif-icon {
    background-color: #fee2e2;
    color: #dc2626;
}

.wishlist-notification.report {
    background-color: #fff1f2;
    border-left: 4px solid #dc2626;
}

/* Fix double icon on buy button in wishlist card */
.novateplica-wishlist-page li.product .add_to_cart_button.loading::before,
.novateplica-wishlist-page li.product .add_to_cart_button.added::before {
    display: none !important;
}

/* Avoid overlapping internal <i> and CSS ::before */
.novateplica-wishlist-page li.product .add_to_cart_button i {
    position: relative;
    z-index: 2;
}
