/* ==========================================================================
   SX-Y Connector - Frontend Core
   ========================================================================== */

/* --- Базовые переменные и фоллбеки --- */
:root {
    --sxy-primary-bg: var(--sx-y-header-bg, #4a5568);
    --sxy-primary-text: var(--sx-y-header-text, #ffffff);
    --sxy-accent-color: var(--sx-y-price-text, #e53e3e);
    
    --sxy-text-main: #2d3748;
    --sxy-text-muted: #718096;
    --sxy-border: #e2e8f0;
    --sxy-surface: #ffffff;
    --sxy-surface-hover: #f7fafc;
}

/* --- Общие контейнеры и типографика --- */
.sx-y-services-container, .sx-y-category-services-container, .sx-y-categories-container {
    margin: 32px 0; font-family: inherit;
}
.sx-y-services-title, .sx-y-category-services-title, .sx-y-categories-title {
    margin-bottom: 24px; font-size: 24px; font-weight: 700; color: var(--sxy-text-main); line-height: 1.2;
}

/* --- Состояния и Ошибки --- */
.sx-y-no-services, .sx-y-error {
    padding: 32px; text-align: center; background: var(--sxy-surface-hover);
    border: 1px dashed var(--sxy-border); border-radius: 12px; color: var(--sxy-text-muted);
}
.sx-y-error { background: #fff5f5; border-color: #feb2b2; color: #c53030; }
.sx-y-loading-state { display: flex; flex-direction: column; align-items: center; padding: 48px 20px; color: var(--sxy-text-muted); }
.sx-y-spinner {
    width: 36px; height: 36px; border: 3px solid var(--sxy-border);
    border-top: 3px solid var(--sxy-primary-bg); border-radius: 50%;
    animation: sx-y-spin 0.8s linear infinite; margin-bottom: 16px;
}
@keyframes sx-y-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.sx-y-spin { animation: sx-y-spin 1s linear infinite; }

/* --- Глобальные Кнопки --- */
a.sx-y-btn-book, a.sx-y-btn-book-outline {
    text-decoration: none !important; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sx-y-btn-book-outline {
    background: transparent; color: var(--sxy-primary-bg); border: 1px solid var(--sxy-primary-bg);
    border-radius: 6px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.sx-y-btn-book-outline:hover { background: var(--sxy-primary-bg); color: var(--sxy-primary-text); }
.sx-y-btn-book .dashicons, .sx-y-btn-book-outline .dashicons { font-size: 14px; width: 14px; height: 14px; line-height: 14px; margin-top: 1px; opacity: 0.8; }

/* --- Live-Поиск --- */
.sx-y-live-search-wrapper { 
    position: relative; margin: 0 0 16px 0; width: 100%; max-width: 100%;
}
.sx-y-search-icon { 
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%); 
    color: var(--sxy-text-muted); width: 20px; height: 20px;
    transition: color 0.3s ease; z-index: 2; pointer-events: none;
}
.sx-y-live-search-wrapper:focus-within .sx-y-search-icon {
    color: var(--sxy-primary-bg); 
}
.sx-y-live-search-input {
    width: 100%; padding: 16px 20px 16px 48px !important; border: none !important;
    border-radius: 12px !important; background: var(--sxy-surface) !important; 
    color: var(--sxy-text-main) !important; font-size: 16px !important; font-weight: 500 !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03) !important;
}
.sx-y-live-search-input::placeholder { color: var(--sxy-text-muted); font-weight: 400; }
.sx-y-live-search-input:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04) !important; }
.sx-y-live-search-input:focus {
    outline: none !important; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}

/* --- Глобальные Фильтры --- */
.sx-y-filters-wrapper { 
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; justify-content: center; 
}
.sx-y-filter-btn {
    background: var(--sxy-surface); border: 1px solid var(--sxy-border); color: var(--sxy-text-main);
    padding: 10px 24px; border-radius: 40px; font-size: 14px; font-weight: 600; cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.sx-y-filter-btn:hover { 
    border-color: var(--sxy-primary-bg); color: var(--sxy-primary-bg); 
    box-shadow: 0 6px 12px rgba(0,0,0,0.05); transform: translateY(-1px);
}
.sx-y-filter-btn.active {
    background: var(--sxy-primary-bg); border-color: var(--sxy-primary-bg); 
    color: var(--sxy-primary-text); /* Защита от сливания текста с фоном */
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

@media (max-width: 768px) {
    .sx-y-filters-wrapper {
        flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
        padding-bottom: 8px; margin-bottom: 24px;
        -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none;
    }
    .sx-y-filters-wrapper::-webkit-scrollbar { display: none; }
}