.afisha-page {
    background: var(--color-bg);
    overflow-x: hidden;
    max-width: 100%;
    min-width: 0;
}

.afisha-page__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px 16px;
    flex-shrink: 0;
}

.afisha-page__back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    padding: 0;
    color: var(--color-text);
}

.afisha-page__title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    flex: 1;
    margin: 0;
}

.afisha-page__search {
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
}

.afisha-page__search-group {
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.afisha-page__search-icon,
.afisha-page__search-input {
    background: transparent !important;
    color: var(--color-text);
    border-color: transparent !important;
}

.afisha-page__search-group--focused .form-control,
.afisha-page__search-group--focused .input-group-text {
    border-color: var(--color-primary) !important;
}

.afisha-page__search-input {
    font-size: 15px;
    padding-left: 8px;
    box-shadow: none !important;
}

.afisha-page__search-input:focus {
    box-shadow: none !important;
}

.afisha-page__tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px 12px;
    flex-shrink: 0;
}

.afisha-page__tab {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.afisha-page__tab--active {
    background: var(--color-primary-subtle);
    border-color: rgba(224, 122, 95, 0.3);
    color: var(--color-primary);
}

.afisha-page__segment {
    --seg-offset: 0;
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    height: 40px;
    padding: 4px;
    max-width: 100%;
    min-width: 0;
    margin-top: 12px;
    margin-bottom: 0;
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.afisha-page__segment-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 2);
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.35);
    transform: translateX(calc(var(--seg-offset) * 100%));
    transition: transform 0.28s ease-out;
    pointer-events: none;
}

.afisha-page__segment-item {
    position: relative;
    z-index: 1;
    flex: 1;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.afisha-page__segment-item--active {
    color: #fff;
}

.afisha-page__segment--dragging .afisha-page__segment-indicator {
    transition: none;
}

.afisha-page__sort {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.afisha-page__sort-btn {
    min-width: 0;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border-radius: var(--radius-pill);
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

.afisha-page__sort-btn--active {
    background: var(--color-primary-subtle);
    border-color: rgba(224, 122, 95, 0.3);
    color: var(--color-primary);
}

.afisha-page__viewport {
    overflow: hidden;
    touch-action: pan-y;
}

.afisha-page__track {
    display: flex;
    height: 100%;
    will-change: transform;
}

.afisha-page__panel {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
}

.afisha-page__list {
    padding: 0 20px 16px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.afisha-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    margin-bottom: 10px;
    width: 100%;
    text-align: left;
    color: var(--color-text);
    min-width: 0;
}

.afisha-card--static {
    margin-bottom: 0;
    box-shadow: var(--shadow-sm);
}

.afisha-card:active {
    opacity: 0.92;
}

.afisha-card__thumb {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(145deg, var(--color-afisha) 0%, #7b6fd4 55%, #e07a5f 100%);
}

.afisha-card__thumb-img-wrap {
    width: 100%;
    height: 100%;
}

.afisha-card__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.afisha-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
}

.afisha-card__body {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.afisha-card__badge {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-afisha);
    margin-bottom: 2px;
}

.afisha-card__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.afisha-card__sub {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
    flex: 1 1 auto;
    min-width: 0;
}

.afisha-card__sub-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.afisha-card__map-pin {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(91, 79, 199, 0.25);
    background: #efedfc;
    color: #5b4fc7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.afisha-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.afisha-tag--purple {
    background: var(--tag-purple-bg);
    color: var(--tag-purple-text);
}

.afisha-tag--amber {
    background: var(--tag-amber-bg);
    color: var(--tag-amber-text);
}

.afisha-tag--teal {
    background: var(--tag-teal-bg);
    color: var(--tag-teal-text);
}

.afisha-tag--rose {
    background: var(--tag-rose-bg);
    color: var(--tag-rose-text);
}

.afisha-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 4px;
}

.afisha-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 10px 0 16px;
}

.afisha-detail {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: var(--color-bg);
}

.afisha-detail__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 24px;
}

.afisha-detail__hero-wrap {
    padding: 16px 20px 0;
}

.afisha-detail__hero {
    position: relative;
    height: 200px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(145deg, var(--color-afisha) 0%, #7b6fd4 55%, #e07a5f 100%);
    flex-shrink: 0;
}

.afisha-detail__hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.afisha-detail__hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
}

.afisha-detail__back {
    position: absolute;
    top: 12px;
    left: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    padding: 0;
    color: var(--color-text);
}

.afisha-detail__body {
    padding: 20px 20px 0;
}

.afisha-detail__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin: 0;
    overflow-wrap: anywhere;
}

.afisha-detail__description {
    font-size: 15px;
    line-height: 1.45;
    color: var(--color-text-secondary);
    margin-top: 16px;
    white-space: pre-line;
}

.afisha-detail__description--html {
    white-space: normal;
}

.afisha-detail__description--html p {
    margin: 0 0 0.75rem;
}

.afisha-detail__description--html p:last-child {
    margin-bottom: 0;
}

.afisha-tag__emoji {
    margin-right: 4px;
}

.afisha-meta-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.afisha-detail__cta {
    margin-top: 16px;
    height: 54px;
    width: 100%;
    border: none;
    border-radius: 18px;
    background: var(--color-primary);
    box-shadow: 0 8px 24px rgba(224, 122, 95, 0.35);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
}

.afisha-detail__cta:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.afisha-load-more {
    height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.afisha-load-more:disabled {
    opacity: 0.6;
}
