/* Custom Pagination Styles */
.custom-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
	 line-height: 0;
}

/* Контейнер результатів */
#products-results-container {
    position: relative;
}

/* Loading overlay с анимацией капли вина */
.products-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

/* Анимация капли вина */
.loading-spinner.wine-drop-animation {
    animation: wineDropRotate 2s ease-in-out infinite;
}

.loading-spinner.wine-drop-animation::before {
    content: "🍷";
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: wineDropPulse 1.5s ease-in-out infinite alternate;
}

@keyframes wineDropRotate {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes wineDropPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
}

/* Fallback для браузеров без эмодзи */
.loading-spinner.wine-drop-animation::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid #8B0000;
    border-top: 3px solid #FF6B6B;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
    display: none; /* Показывается только если эмодзи не поддерживается */
}

@supports not (-webkit-font-smoothing: antialiased) {
    .loading-spinner.wine-drop-animation::before {
        display: none;
    }
    .loading-spinner.wine-drop-animation::after {
        display: block;
    }
}

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

.page-arrow svg {
  display: block;
  width: 100%;
  height: 20px;
}

.page-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    color: var(--black, #000);
    text-decoration: none;
	 border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: monospace;
    line-height: 1;
	 box-sizing: border-box;
	 border: 1px solid #ffffff;
}

.page-arrow:hover {
    border: 1px solid var(--primary, #c80d22);
}

.page-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-arrow.disabled:hover {
    transform: none;
    color: var(--black, #000);
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border, #E5E5E5);
    background: white;
    color: var(--black, #000);
    text-decoration: none;
    border-radius: 8px;
	 font-family: 'VisueltPro';
    font-weight: 400;
    font-size: 18px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.page-number:hover {
    background: var(--primary, #c80d22);
    color: white;
    border-color: var(--primary, #c80d22);
}

.page-number.current {
    background: var(--primary, #c80d22);
    color: white;
    border-color: var(--primary, #c80d22);
    font-weight: 600;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: var(--gray-text, #888);
    font-size: 16px;
    font-weight: bold;
    padding: 0 4px;
}

/* Сообщения об ошибках */
.filter-error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #fcc;
}

/* Фильтры и активные теги */
.products-filters {
    margin-bottom: 30px;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-dropdown {
    position: relative;
}

.filter-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border, #E5E5E5);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'VisueltPro';
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-trigger:hover {
    border-color: var(--primary, #c80d22);
}

.filter-arrow {
    transition: transform 0.2s ease;
}

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

.filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    background: white;
    border: 1px solid var(--border, #E5E5E5);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    display: none;
    margin-top: 4px;
}

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

.filter-checkbox-item,
.filter-radio-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-checkbox-item:hover,
.filter-radio-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.filter-checkbox-item input,
.filter-radio-item input {
    margin-right: 8px;
}

.label-text {
    flex: 1;
    font-family: 'VisueltPro';
    font-size: 14px;
}

.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.active-filters-label {
    font-family: 'VisueltPro';
    font-size: 14px;
    color: var(--gray-text, #666);
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--primary, #c80d22);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-family: 'VisueltPro';
}

.remove-tag {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-all-filters {
    font-family: 'VisueltPro';
    font-size: 14px;
    color: var(--primary, #c80d22);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.clear-all-filters:hover {
    opacity: 0.7;
}

.no-products-found {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-text, #666);
}

.no-products-found p {
    font-family: 'VisueltPro';
    font-size: 16px;
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .custom-pagination {
        gap: 6px;
        margin: 30px 0;
    }
    
    .page-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .page-number {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }
    
    .page-ellipsis {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
    
    .loading-spinner.wine-drop-animation::before {
        font-size: 30px;
    }
    
    .filters-row {
        gap: 8px;
    }
    
    .filter-trigger {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .custom-pagination {
        gap: 4px;
    }
    
    .page-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .page-number {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }
    
    .page-ellipsis {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-spinner.wine-drop-animation::before {
        font-size: 25px;
    }
    
    .filters-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-trigger {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-dropdown-menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 300px;
        max-height: 70vh;
        overflow-y: auto;
    }
}