#mastersGrid,
#favoritesGrid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 12px !important;
    margin-top: 12px;
    align-items: stretch;
}

.masters-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 12px !important;
    margin-top: 12px;
    align-items: stretch;
}

@media (max-width: 480px) {
    #mastersGrid,
    #favoritesGrid,
    .masters-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
        gap: 10px !important;
    }
}

.master-card {
    display: flex;
    flex-direction: column;
    background: rgba(74, 10, 10, 0.6);
    border: 1px solid rgba(230, 200, 140, 0.3);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
}

.master-card-top {
    overflow: visible;
}

.master-card-top .master-photo {
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

.master-card:hover {
    background: rgba(74, 10, 10, 0.8);
    border-color: rgba(230, 200, 140, 0.45);
}

.master-photo {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    flex-shrink: 0;
    filter: brightness(1.05);
}

.master-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.master-top-badge {
    display: inline-flex;
    align-items: center;
    cursor: help;
    position: relative;
    z-index: 10;
}

.master-top-badge:hover::after {
    content: 'Топ мастер';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(58, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(230, 200, 140, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
}

.master-top-badge:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(230, 200, 140, 0.3);
    z-index: 10001;
}

.master-top-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(90%) sepia(15%) saturate(800%) hue-rotate(15deg) brightness(105%) contrast(95%);
}

.master-experience-badge {
    padding: 2px 8px;
    background: rgba(230, 200, 140, 0.15);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent);
    line-height: 1.3;
    white-space: nowrap;
    flex-shrink: 0;
}

.master-photo.placeholder {
    background: linear-gradient(135deg, rgba(230, 200, 140, 0.15) 0%, rgba(230, 200, 140, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.master-photo.placeholder::before {
    content: '';
    width: 48px;
    height: 48px;
    background: rgba(230, 200, 140, 0.2);
    border-radius: 50%;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

.master-content {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 6px;
    flex-shrink: 0;
}

.master-card-top .master-content {
    background: rgba(58, 5, 5, 0.4);
    border-radius: 0 0 14px 14px;
}

.master-name {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    min-width: 0;
}

.master-name-text {
    display: inline-block;
    max-width: calc(100% - 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.master-specialization {
    font-size: 0.86rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.master-district {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    line-height: 1.3;
}

.master-price {
    font-size: 0.92rem;
    color: var(--accent);
    font-weight: 600;
    line-height: 1.3;
}

/* Skeleton для карточек мастеров */
.master-card-skeleton {
    display: flex;
    flex-direction: column;
    background: rgba(74, 10, 10, 0.6);
    border: 1px solid rgba(230, 200, 140, 0.3);
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    position: relative;
    pointer-events: none;
    animation: skeleton-card-fade-in 0.3s ease-out;
}

@keyframes skeleton-card-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.master-card-skeleton-photo {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, rgba(230, 200, 140, 0.08) 25%, rgba(230, 200, 140, 0.15) 50%, rgba(230, 200, 140, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.master-card-skeleton-content {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 6px;
    flex-shrink: 0;
}

.master-card-skeleton-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.master-card-skeleton-name {
    height: 18px;
    width: 60%;
    background: linear-gradient(90deg, rgba(230, 200, 140, 0.08) 25%, rgba(230, 200, 140, 0.15) 50%, rgba(230, 200, 140, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.master-card-skeleton-badge {
    height: 18px;
    width: 50px;
    background: linear-gradient(90deg, rgba(230, 200, 140, 0.08) 25%, rgba(230, 200, 140, 0.15) 50%, rgba(230, 200, 140, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 10px;
}

.master-card-skeleton-specialization {
    height: 16px;
    width: 80%;
    background: linear-gradient(90deg, rgba(230, 200, 140, 0.08) 25%, rgba(230, 200, 140, 0.15) 50%, rgba(230, 200, 140, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.master-card-skeleton-district {
    height: 14px;
    width: 50%;
    background: linear-gradient(90deg, rgba(230, 200, 140, 0.08) 25%, rgba(230, 200, 140, 0.15) 50%, rgba(230, 200, 140, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.master-card-skeleton-price {
    height: 16px;
    width: 40%;
    background: linear-gradient(90deg, rgba(230, 200, 140, 0.08) 25%, rgba(230, 200, 140, 0.15) 50%, rgba(230, 200, 140, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-top: 2px;
}

/* Banners */
.banners-container {
    margin-bottom: 16px;
    width: 100%;
}

.banners-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
}

.banners-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.banners-track.single {
    transform: none !important;
}

.banner-item {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    aspect-ratio: 4 / 1;
    height: auto;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 14px;
    cursor: grab;
    transition: opacity 0.2s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.banner-item:active {
    cursor: grabbing;
}

.banner-item:hover {
    opacity: 0.9;
}

.banner-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    border: 1px solid rgba(230, 200, 140, 0.2);
    pointer-events: none;
}

.banners-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 0 16px;
}

.banner-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(230, 200, 140, 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.banner-indicator.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

.banner-indicator:hover {
    background: rgba(230, 200, 140, 0.5);
}

.banner-indicator.active:hover {
    background: var(--accent);
}

/* Banner Skeleton */
.banner-skeleton {
    width: 100%;
    aspect-ratio: 4 / 1;
    height: auto;
    background: linear-gradient(90deg, rgba(230, 200, 140, 0.08) 25%, rgba(230, 200, 140, 0.15) 50%, rgba(230, 200, 140, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 14px;
    border: 1px solid rgba(230, 200, 140, 0.3);
}

@media (max-width: 480px) {
    .banner-item {
        aspect-ratio: 4 / 1;
        height: auto;
    }
    
    .banner-skeleton {
        aspect-ratio: 4 / 1;
        height: auto;
    }
}
