/* ========================================
   CAPOGS - КРАСИВЫЙ WISHLIST ДИЗАЙН
   Современный дизайн с карточками товаров
   ======================================== */

/* ========================================
   HIDE OLD WISHLIST TABLE - AGGRESSIVE
   ======================================== */
table.wishlist_table.traditional,
table.wishlist_table,
table.shop_table.wishlist_table,
.wishlist_table.traditional,
.wishlist_table.wishlist_view.traditional,
table.shop_table.cart.wishlist_table,
.capogs-hidden,
.wishlist-title-container,
.wishlist-title,
.yith-wcwl-page-title {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}


/* Основной контейнер */
.capogs-wishlist-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 60px auto;
    padding: 20px;
    min-height: 100px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    clear: both !important;
    --theme-palette-color-1: #ffcd05;
    --theme-palette-color-2: #fcb424;
    --theme-palette-color-3: #504e4a;
    --theme-palette-color-4: #0a0500;
    --theme-palette-color-5: #ffffff;
    --theme-palette-color-6: #f2f5f7;
    --theme-palette-color-7: #FAFBFC;
    --theme-palette-color-8: #ffffff;
    --theme-text-color: var(--theme-palette-color-3);
    --theme-link-initial-color: var(--theme-palette-color-1);
    --theme-link-hover-color: var(--theme-palette-color-2);
    --theme-border-color: var(--theme-palette-color-5);
    --theme-button-text-initial-color: #ffffff;
    --theme-button-text-hover-color: #ffffff;
    --theme-button-background-initial-color: #0a0500;
    --theme-button-background-hover-color: var(--theme-palette-color-2);
    --theme-button-border: none;
    --product-element-spacing: 25px;
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.capogs-loading {
    text-align: center;
    padding: 80px 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.capogs-loading .spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 4px solid rgba(52, 152, 219, 0.25);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.capogs-loading p {
    margin-top: 20px;
    color: #7f8c8d;
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MY COLLECTION - MENU VIEW (Like Max Mega Menu)
   ======================================== */

.capogs-collection-menu {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 10px;
}

.collection-page-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    text-align: center;
}

.collection-description {
    text-align: center;
    color: #7f8c8d;
    font-size: 12px;
    margin: 4px 0 14px;
}

/* Mega Menu Structure */
.capogs-mega-menu {
    background: #ffffff;
    border-radius: 0;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.menu-level-1 {
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.menu-level-1:last-child {
    border-bottom: none;
}

.menu-header h3 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 10px 0; /* Reduced bottom margin */
    font-weight: 700;
}

.menu-level-2-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    align-items: flex-start; /* Prevent grid items from stretching to match tallest item */
}

.menu-level-2 {
    background: #f8f9fa;
    border-radius: 0;
    padding: 15px;
    isolation: isolate; /* Isolate each accordion to prevent layout interference */
    position: relative; /* Ensure proper stacking context */
    margin-bottom: 10px; /* Reduce bottom margin to prevent excessive spacing */
}

.menu-level-3-container {
    overflow: hidden;
    /* Option 2: Scroll only for opened country content - uncomment to use */
    /* max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden; */
}

.menu-level-3-container[style*="display: none"] {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

.country-header {
    font-size: 18px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.country-header .country-flag {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 8px;
    vertical-align: middle;
}

.menu-level-3 {
    margin-bottom: 15px;
}

.menu-level-3:last-child {
    margin-bottom: 0;
}

.manufacturer-header {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.menu-level-4-container {
    padding-left: 15px;
}

.menu-level-4 {
    margin-bottom: 10px;
}

.series-header {
    font-size: 14px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 5px;
}

.menu-level-5-container {
    padding-left: 15px;
}

.menu-level-5 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: #ffffff;
    border-radius: 0;
    transition: all 0.2s ease;
}

.menu-level-5.clickable {
    cursor: pointer;
}

.menu-level-5.clickable:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

.menu-level-5.accessories {
    background: #fff9e6;
    border-left: 3px solid #f39c12;
}

.menu-level-5.accessories:hover {
    background: #fff3cd;
}

.year-name {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 500;
}

.item-count {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
}

/* Color coding for completion percentage */
.item-count.low {
    color: #e74c3c;
    font-weight: 700;
}

.item-count.partial {
    color: #f39c12;
    font-weight: 700;
}

.item-count.complete {
    color: #27ae60;
    font-weight: 700;
}

@media (max-width: 768px) {
    .menu-level-2-container {
        grid-template-columns: 1fr;
    }
}

.capogs-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.capogs-menu-category {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.capogs-menu-category:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.2);
}

.category-icon {
    font-size: 48px;
}

.category-name {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.category-count {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.view-category-btn {
    background: #3498db;
    color: #ffffff;
    border: none;
    padding: 10px 25px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.view-category-btn:hover {
    background: #2980b9;
}

/* ========================================
   ITEMS VIEW (When category selected)
   ======================================== */

.capogs-items-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px;
    position: relative;
}

.capogs-breadcrumb {
    position: sticky;
    top: calc(var(--admin-bar, 0px));
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #f3f6ff 0%, #ffffff 100%);
    border-radius: 0;
    border: 1px solid #e0e7ff;
    box-shadow: 0 12px 24px rgba(62, 108, 170, 0.08);
    flex-wrap: wrap;
    backdrop-filter: blur(6px);
}

@media (max-width: 992px) {
    .capogs-breadcrumb {
        padding: 20px 22px;
    }
}

.breadcrumb-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.back-to-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(52, 152, 219, 0.15);
    color: #1f4b70;
    border: 1px solid rgba(52, 152, 219, 0.35);
    padding: 10px 18px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 14px rgba(52, 152, 219, 0.12);
}

.back-to-menu-btn svg {
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.back-to-menu-btn:hover {
    background: #3498db;
    color: #ffffff;
    border-color: #3498db;
    transform: translateX(-4px);
    box-shadow: 0 12px 20px rgba(52, 152, 219, 0.28);
}

.back-to-menu-btn:hover svg {
    transform: translateX(-2px);
}

.breadcrumb-text {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.2px;
}

.breadcrumb-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(52, 152, 219, 0.35);
    background: rgba(52, 152, 219, 0.12);
    color: #1f4b70;
    box-shadow: 0 10px 18px rgba(52, 152, 219, 0.18);
}

.count-badge .count-text {
    display: inline-block;
}

.missing-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1f4b70;
    cursor: pointer;
    user-select: none;
}

.missing-filter input {
    width: 16px;
    height: 16px;
    accent-color: #1f4b70;
    cursor: pointer;
}

.missing-filter .missing-count {
    font-weight: 500;
    color: #7f8c8d;
}

.missing-filter.loading {
    opacity: 0.6;
    pointer-events: none;
}

.missing-filter.hidden {
    display: none !important;
}

.count-badge svg {
    stroke: currentColor;
}

.count-badge.complete {
    background: rgba(46, 204, 113, 0.16);
    color: #1f7a3c;
    border-color: rgba(46, 204, 113, 0.35);
    box-shadow: 0 10px 18px rgba(46, 204, 113, 0.18);
}

.count-badge.partial {
    background: rgba(241, 196, 15, 0.18);
    color: #9b6b04;
    border-color: rgba(241, 196, 15, 0.32);
    box-shadow: 0 10px 18px rgba(241, 196, 15, 0.18);
}

.count-badge.low {
    background: rgba(231, 76, 60, 0.16);
    color: #9c2f26;
    border-color: rgba(231, 76, 60, 0.28);
    box-shadow: 0 10px 18px rgba(231, 76, 60, 0.18);
}

.count-badge.neutral {
    background: rgba(52, 152, 219, 0.12);
    color: #1f4b70;
    border-color: rgba(52, 152, 219, 0.35);
}

/* Mobile responsive for menu */
@media (max-width: 768px) {
    .capogs-menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .collection-page-title {
        font-size: 28px;
    }
    
    .capogs-breadcrumb {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 16px;
    }
    
    .breadcrumb-left,
    .breadcrumb-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .breadcrumb-text {
        width: 100%;
        justify-content: flex-start;
    }
    
    .back-to-menu-btn {
        width: 100%;
        justify-content: center;
    }
    
    .count-badge {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .capogs-menu-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   HIERARCHICAL MENU (Like Max Mega Menu) - LEGACY
   ======================================== */

.capogs-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    gap: 15px;
}

.capogs-hierarchical-menu {
    position: relative;
}

.capogs-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.capogs-menu-toggle:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.capogs-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 90vw;
    max-height: 70vh;
    z-index: 1000;
    display: none;
}

.capogs-hierarchical-menu.open .capogs-menu-panel {
    display: block;
    animation: slideDown 0.3s ease;
}

.capogs-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}

.capogs-menu-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.capogs-menu-close:hover {
    color: #2c3e50;
}

.capogs-menu-body {
    padding: 10px 0;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
}

/* Menu items - hierarchical structure */
.capogs-category-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.menu-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    transition: background 0.2s ease;
}

.menu-item:hover > .menu-item-content {
    background: #f8f9fa;
}

.menu-item.active > .menu-item-content {
    background: #e3f2fd;
    color: #2980b9;
    font-weight: 600;
}

.menu-item-name {
    flex: 1;
    font-size: 14px;
}

.menu-item-count {
    margin-left: 10px;
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
}

.menu-indicator {
    margin-left: 10px;
    font-size: 10px;
    transition: transform 0.3s ease;
    color: #95a5a6;
}

.menu-item.expanded > .menu-item-content .menu-indicator {
    transform: rotate(90deg);
}

/* Nested levels */
.capogs-category-menu.level-2 {
    display: none;
    padding-left: 20px;
    background: #fafbfc;
}

.menu-item.expanded > .capogs-category-menu.level-2 {
    display: block;
}

.capogs-category-menu.level-3 {
    display: none;
    padding-left: 20px;
    background: #f5f7f9;
}

.menu-item.expanded > .capogs-category-menu.level-3 {
    display: block;
}

.capogs-category-menu.level-4 {
    display: none;
    padding-left: 20px;
    background: #f0f2f5;
}

.menu-item.expanded > .capogs-category-menu.level-4 {
    display: block;
}

.capogs-category-menu.level-5 {
    display: none;
    padding-left: 20px;
    background: #ebedef;
}

.menu-item.expanded > .capogs-category-menu.level-5 {
    display: block;
}

/* All items special styling */
.menu-item.all-items {
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 5px;
}

.menu-item.all-items .menu-item-content {
    font-weight: 600;
    color: #2c3e50;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .capogs-menu-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        animation: slideInLeft 0.3s ease;
    }
    
    .capogs-menu-body {
        max-height: calc(100vh - 60px);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.capogs-filter-dropdown {
    position: relative;
}

.capogs-filter-dropdown-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.capogs-filter-dropdown-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.capogs-filter-dropdown-button .filter-text {
    flex: 1;
    text-align: left;
}

.capogs-filter-dropdown-button .dropdown-arrow {
    transition: transform 0.3s ease;
}

.capogs-filter-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.capogs-filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease;
}

.capogs-filter-dropdown.open .capogs-filter-dropdown-menu {
    display: block;
}

.capogs-filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.capogs-filter-option:last-child {
    border-bottom: none;
}

.capogs-filter-option:hover {
    background: #f8f9fa;
}

.capogs-filter-option.active {
    background: #e3f2fd;
    color: #2980b9;
}

.capogs-filter-option .category-name {
    font-weight: 500;
    flex: 1;
}

.capogs-filter-option .category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 8px;
    background: #3498db;
    color: #ffffff;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
}

.capogs-filter-option.active .category-count {
    background: #2980b9;
}

.capogs-results-count {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .capogs-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .capogs-filter-dropdown-button {
        width: 100%;
    }
    
    .capogs-results-count {
        text-align: center;
    }
}

/* ========================================
   СЕКЦИЯ КАТЕГОРИЙ (LEGACY)
   ======================================== */

.capogs-category-section {
    margin-bottom: 50px;
}

.capogs-category-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    display: flex;
    align-items: center;
    gap: 12px;
}

.capogs-category-title svg {
    color: #3498db;
    flex-shrink: 0;
}

.capogs-category-count {
    font-size: 18px;
    color: #7f8c8d;
    font-weight: 400;
}

/* ========================================
   СЕТКА КАРТОЧЕК
   ======================================== */

.capogs-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .capogs-wishlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    
    .capogs-category-title {
        font-size: 22px;
    }
}

@media (max-width: 560px) {
    .capogs-wishlist-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .capogs-wishlist-container {
        padding: 15px;
    }
}

/* ========================================
   MOBILE FIX: Prevent content under footer - ULTRA AGGRESSIVE
   ======================================== */
@media (max-width: 768px) {
    /* Container styling - reasonable values */
    .capogs-wishlist-container {
        position: relative !important;
        z-index: 10 !important;
        min-height: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        /* Margin will be set by JS based on footer height */
    }
    
    /* Remove pseudo-element spacer - not needed */
    .capogs-wishlist-container::after {
        display: none !important;
    }
    
    /* Spacing is handled by JavaScript based on footer type and height */
    
    /* Ensure footer doesn't overlap - handle all footer types */
    footer,
    .site-footer,
    #footer,
    .ct-footer,
    [data-footer],
    .footer {
        position: relative !important;
        z-index: 1 !important;
        margin-top: 0 !important;
        clear: both !important;
    }
    
    /* If footer is sticky/fixed, ensure it doesn't overlap - set lower z-index */
    footer[style*="position: sticky"],
    footer[style*="position: fixed"],
    .ct-footer[style*="position: sticky"],
    .ct-footer[style*="position: fixed"],
    footer.fixed,
    footer.sticky,
    .ct-footer.fixed,
    .ct-footer.sticky,
    [data-footer*="reveal"] {
        z-index: 1 !important;
    }
    
    /* Ensure main content is above footer */
    main,
    .site-main,
    #main,
    #main-container,
    .content-area,
    .entry-content,
    .page-content {
        position: relative !important;
        z-index: 2 !important;
    }
    
    /* Small spacer div if created by JavaScript - reasonable height */
    .capogs-footer-spacer {
        display: block !important;
        width: 100% !important;
        clear: both !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 0 !important;
        background: transparent !important;
        pointer-events: none !important;
        /* Height will be set by JS - max 300px */
        max-height: 300px !important;
    }
}

@media (max-width: 480px) {
    /* Same as tablet - let JS handle spacing */
    .capogs-wishlist-container {
        position: relative !important;
        z-index: 10 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .capogs-wishlist-container::after {
        display: none !important;
    }
    
    footer[style*="position: sticky"],
    footer[style*="position: fixed"],
    .ct-footer[style*="position: sticky"],
    .ct-footer[style*="position: fixed"],
    footer.fixed,
    footer.sticky,
    .ct-footer.fixed,
    .ct-footer.sticky,
    [data-footer*="reveal"] {
        z-index: 1 !important;
    }
    
    .capogs-footer-spacer {
        max-height: 300px !important;
    }
}

/* ========================================
   КАРТОЧКА ТОВАРА
   ======================================== */

.capogs-wishlist-card {
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: none;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.capogs-wishlist-card.removing {
    opacity: 0;
    transform: translateY(16px);
}

/* ========================================
   КНОПКА УДАЛЕНИЯ
   ======================================== */

.capogs-remove-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
}

.capogs-add-to-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.capogs-add-to-wishlist .yith-wcwl-add-button {
    display: flex;
}

.capogs-add-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 204, 113, 0.95);
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.3s ease;
    color: #ffffff;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
}

.capogs-add-button svg {
    stroke: currentColor;
}

.capogs-add-button:hover,
.capogs-add-button:focus-visible {
    background: #27ae60;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.28);
    transform: rotate(90deg) scale(1.1);
}

.capogs-add-button.loading {
    opacity: 0.6;
    pointer-events: none;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.28);
}

.capogs-remove-button:hover {
    background: #e74c3c;
    transform: rotate(90deg) scale(1.1);
}

.capogs-wishlist-card:hover .capogs-remove-button {
    opacity: 1;
    pointer-events: auto;
}

.capogs-wishlist-card.missing:hover .capogs-add-button {
    opacity: 1;
    pointer-events: auto;
}

.capogs-add-button.loading {
    opacity: 0.6;
    pointer-events: none;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.28);
}

.capogs-remove-button svg {
    color: #e74c3c;
    transition: color 0.3s ease;
}

.capogs-remove-button:hover svg {
    color: #ffffff;
}

/* ========================================
   ИЗОБРАЖЕНИЕ ТОВАРА
   ======================================== */

.capogs-card-image {
    position: relative;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    background: var(--theme-palette-color-6);
    border: 1px solid var(--theme-border-color);
}

.capogs-card-image-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.capogs-card-image-grid.single-image {
    grid-template-columns: 1fr !important;
}

.capogs-card-image-grid .image-slot {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    padding-bottom: 100% !important;
    background: var(--theme-palette-color-5);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden !important;
}

.capogs-card-image-grid .image-slot img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.capogs-card-image-grid .image-slot.duplicate {
    opacity: 0.4;
}

.capogs-card-image-grid .image-slot.duplicate img {
    filter: grayscale(50%);
}

.capogs-card-image-grid .image-slot.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #f0f0f0;
    border-style: dashed;
}

.capogs-card-image-grid .image-slot.placeholder.failed {
    color: #aaaaaa;
    border-color: rgba(0, 0, 0, 0.1);
}

.capogs-card-image .missing-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e67e22;
    color: #ffffff;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    z-index: 5;
}

.capogs-card-image-grid .image-slot.placeholder.missing-placeholder {
    color: #b3b3b3;
    background: #fafafa;
    border-color: rgba(0, 0, 0, 0.12);
}

/* Бейдж статуса товара */
.capogs-stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.capogs-out-of-stock {
    background: rgba(231, 76, 60, 0.95);
    color: #ffffff;
}

/* ========================================
   КОНТЕНТ КАРТОЧКИ
   ======================================== */

.capogs-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}

/* Название товара */
.capogs-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 44px;
    color: var(--theme-text-color);
}

.capogs-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}

.capogs-card-title a:hover {
    color: var(--theme-link-hover-color);
}

.capogs-wishlist-card.missing {
    border: 1px dashed rgba(230, 126, 34, 0.6);
    background: #fff9f2;
    box-shadow: none;
}

.capogs-wishlist-card.missing .capogs-card-title a {
    color: #c0392b;
}

.capogs-wishlist-card.missing .capogs-card-title a:hover {
    color: #e74c3c;
}

/* Вариация товара */
.capogs-card-variation {
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.4;
    text-align: center;
}

/* Категория товара */
.capogs-card-category {
    font-size: 12px;
    color: #3498db;
    font-weight: 500;
    margin-top: 5px;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* Цена */
.capogs-card-price {
    font-size: 22px;
    font-weight: 700;
    color: #27ae60;
    margin-top: auto;
}

.capogs-card-price del {
    font-size: 16px;
    color: #95a5a6;
    margin-right: 8px;
    font-weight: 400;
}

.capogs-card-price ins {
    text-decoration: none;
}

/* Дата добавления */
.capogs-card-date {
    font-size: 12px;
    color: #95a5a6;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}

.capogs-card-date svg {
    flex-shrink: 0;
}

.capogs-wishlist-card.missing .capogs-card-date {
    color: #c0392b;
}

.capogs-wishlist-card.missing .capogs-card-actions a {
    background: #e67e22;
}

.capogs-wishlist-card.missing .capogs-card-actions a:hover {
    background: #d35400;
}

.missing-note {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #c0392b;
    text-align: center;
}

.missing-empty {
    padding: 40px;
    width: 100%;
    text-align: center;
    border: 1px dashed #e0e7ff;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    background: #ffffff;
}

/* ========================================
   ПУСТОЙ WISHLIST
   ======================================== */

.capogs-empty-wishlist {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 0;
    margin: 40px 0;
}

.capogs-empty-icon {
    margin-bottom: 30px;
}

.capogs-empty-icon svg {
    color: #bdc3c7;
    stroke-width: 1.5;
}

.capogs-empty-wishlist h3 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

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

.capogs-empty-wishlist .button {
    display: inline-block;
    padding: 14px 40px;
    background: #3498db;
    color: #ffffff;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.capogs-empty-wishlist .button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.3);
}

/* ========================================
   SQUARED STYLE PREFS
   ======================================== */

.capogs-collection-menu,
.capogs-collection-menu *,
.capogs-mega-menu,
.capogs-mega-menu *,
.capogs-items-view,
.capogs-items-view *,
.capogs-wishlist-grid,
.capogs-wishlist-grid *,
.capogs-wishlist-card,
.capogs-wishlist-card *,
.capogs-card-image,
.capogs-card-image *,
.capogs-breadcrumb,
.capogs-breadcrumb *,
.capogs-empty-wishlist,
.capogs-empty-wishlist *,
.capogs-menu-category,
.capogs-menu-category *,
.menu-level-1,
.menu-level-1 *,
.menu-level-2,
.menu-level-2 *,
.menu-level-3,
.menu-level-3 *,
.menu-level-4,
.menu-level-4 *,
.menu-level-5,
.menu-level-5 *,
.breadcrumb-left,
.breadcrumb-left *,
.breadcrumb-right,
.breadcrumb-right *,
.breadcrumb-text,
.breadcrumb-text *,
.back-to-menu-btn,
.back-to-menu-btn *,
.count-badge,
.count-badge *,
.capogs-empty-icon svg {
    border-radius: 0 !important;
}

/* ========================================
   PAGINATION (Пагинация)
   ======================================== */

.capogs-wishlist-pagination {
    margin-top: 50px;
    text-align: center;
    padding: 20px;
}

.capogs-wishlist-pagination .page-numbers {
    display: inline-block;
    padding: 10px 18px;
    margin: 0 5px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.capogs-wishlist-pagination .page-numbers:hover {
    background: #3498db;
    color: #ffffff;
    border-color: #3498db;
}

.capogs-wishlist-pagination .page-numbers.current {
    background: #3498db;
    color: #ffffff;
    border-color: #3498db;
}

/* ========================================
   АНИМАЦИИ
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.capogs-wishlist-card {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   СКРЫВАЕМ СТАРЫЙ СТАНДАРТНЫЙ ВИД
   ======================================== */

/* Скрываем старую таблицу */
table.wishlist_table.traditional,
.wishlist_table.wishlist_view.traditional,
table.shop_table.cart.wishlist_table {
    display: none !important;
}

/* Убираем заголовок и кнопки редактирования из старого шаблона */
.wishlist-title-container {
    display: none !important;
}

/* Скрываем YITH loading overlay */
.yith-wcwl-loading,
.blockUI,
.blockOverlay {
    display: none !important;
}

/* Показываем только наш новый контейнер */
.capogs-wishlist-container {
    display: block !important;
}

/* ========================================
   ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ
   ======================================== */

/* Красивый scrollbar для webkit браузеров */
.capogs-wishlist-container::-webkit-scrollbar {
    width: 10px;
}

.capogs-wishlist-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0;
}

.capogs-wishlist-container::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 0;
}

.capogs-wishlist-container::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Улучшение доступности для фокуса */
.capogs-wishlist-card:focus-within {
    outline: 3px solid #3498db;
    outline-offset: 3px;
}

/* Плавные переходы для всех интерактивных элементов */
a, button, .button {
    transition: all 0.3s ease;
}

/* ==== FIX: страны одной колонкой, без пустых дырок слева ==== */
.capogs-mega-menu .menu-level-2-container {
    display: flex;
    flex-direction: column;
    gap: 20px;      /* расстояние между странами */
}

/* каждая страна на всю ширину контейнера */
.capogs-mega-menu .menu-level-2 {
    width: 100%;
    margin-bottom: 10px;
}

