/* Добавьте в начало вашего CSS */
html, body {
    overscroll-behavior-y: contain;
    height: 100%;
    overflow-x: hidden;
}

body {
    position: relative;
    -webkit-overflow-scrolling: touch;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #e0f7fa, #e1bee7);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    overscroll-behavior-y: none;
    background: #ffe6e6;
    max-width: 1200px;
    padding: 15px; /* Уменьшено с 20px */
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin: 8px; /* Уменьшено с 10px */
}

.hero {
    text-align: center;
    padding: 8px; /* Уменьшено с 10px */
    background: #ffe6e6;
    border-radius: 8px;
}

.hero h1 {
    font-size: 18px; /* Уменьшено с 20px */
    color: #333;
    margin-bottom: 4px;
}

.stats-controls {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 10px; /* Уменьшено с 15px */
    margin: 8px 0; /* Уменьшено с 10px */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px; /* Уменьшено с 10px */
}

.stats-controls h2 {
    font-size: 1.2rem; /* Уменьшено с 1.4rem */
    color: #333;
    margin-bottom: 4px; /* Уменьшено с 5px */
    width: 100%;
    text-align: center;
}

.stats {
    display: flex;
    gap: 10px; /* Уменьшено с 15px */
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    min-width: 80px; /* Уменьшено с 100px */
}

.stat-number {
    display: block;
    font-size: 1.4rem; /* Уменьшено с 1.6rem */
    font-weight: 700;
    color: #667eea;
    margin-bottom: 3px; /* Уменьшено с 4px */
}

.stat-label {
    font-size: 0.7rem; /* Уменьшено с 0.75rem */
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px; /* Уменьшено с 8px */
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px; /* Уменьшено с 8px 16px */
    border-radius: 8px;
    font-size: 0.8rem; /* Уменьшено с 0.85rem */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.last-update {
    font-size: 0.7rem; /* Уменьшено с 0.75rem */
    color: #666;
    text-align: right;
}

.filters {
    margin: 8px 0; /* Уменьшено с 10px */
}

#filtersContent {
    display: none;
    flex-direction: column;
    gap: 4px; /* Уменьшено с 6px */
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.filters input, .filters select {
    flex: 1;
    padding: 6px; /* Уменьшено с 8px */
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 12px; /* Уменьшено с 13px */
    transition: border 0.2s;
}

.filters input:focus, .filters select:focus {
    border-color: #ff6b00;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.1);
}

.toggle-filters {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.submit-btn {
    padding: 6px 12px; /* Уменьшено с 8px 16px */
    background: linear-gradient(90deg, #ff6b00, #ff5252);
    color: #fff;
    font-size: 13px; /* Уменьшено с 14px */
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(255, 107, 0, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(90deg, #e55e00, #e53935);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 107, 0, 0.4);
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(255, 107, 0, 0.2);
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 15px 0;
    align-items: stretch;
}

.promo-card {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    position: relative;
}

.promo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.promo-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.promo-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.promo-card img {
    max-width: 80px;
    margin-bottom: 8px;
}

.promo-card .description {
    max-height: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
    color: #444;
}

.code {
    font-size: 16px;
    font-weight: bold;
    margin: 8px 0;
    color: #333;
}

.code button {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.code button:hover {
    background: #218838;
    transform: translateY(-1px);
}

.bonus-info {
    font-size: 14px;
    color: #28a745;
    font-weight: bold;
    margin: 5px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bonus-info.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.bonus-info::before {
    content: '🎁 ';
    font-size: 14px;
}

.expiry {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.expiry.expired {
    color: #ff6b6b;
    font-weight: 600;
}

.register-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 260px;
    min-height: 48px;
    padding: 12px 20px;
    background: linear-gradient(90deg, #ff4500, #ff8c00);
    color: #ffffff !important; /* Явно белый текст */
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    margin-top: 12px;
    z-index: 10;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.register-link::after {
    content: '→';
    font-size: 16px;
    font-weight: bold;
}

.register-link:hover {
    background: linear-gradient(90deg, #e03e00, #e07b00);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
}

.register-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.register-link:focus {
    outline: 2px solid #ff4500;
    outline-offset: 2px;
}

.ad {
    font-size: 9px;
    color: #666;
    line-height: 1.3;
    opacity: 0.8;
}

.top-offer {
    border: 2px solid #ffd700;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.top-offer::before {
    content: "⭐ Топ";
    position: absolute;
    top: 8px;
    right: 8px;
    background: #667eea;
    color: #fff;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.promo-card.travel-highlight {
    outline: 2px solid #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
    position: relative;
}

.promo-card.travel-highlight::after {
    content: "✈ Путешествия";
    position: absolute;
    left: 15px;
    top: -8px;
    background: #4caf50;
    color: #fff;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.faq {
    margin: 30px 0;
}

.faq h2 {
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.faq details {
    margin-bottom: 8px;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 8px;
}

.faq summary {
    font-size: 15px;
    color: #444;
    cursor: pointer;
}

.bonus {
    background: #ffe6e6;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.bonus h2 {
    font-size: 20px;
    color: #333;
}

.bonus form {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.bonus input {
    padding: 10px;
    flex: 1;
    max-width: 280px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.bonus button {
    padding: 10px 18px;
    background: linear-gradient(90deg, #ff6b00, #ff5252);
    color: #fff;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.bonus button:hover {
    background: linear-gradient(90deg, #e55e00, #e53935);
    transform: translateY(-1px);
}

.message {
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
    transition: opacity 0.3s ease;
}

.no-results {
    text-align: center;
    padding: 30px 15px;
    color: #666;
}

.no-results h3 {
    margin-bottom: 8px;
    color: #333;
}

.promo-ad-inline {
    display: none;
    text-align: center;
    margin: 12px 0;
}

.promo-ad-inline.ad-loaded {
    display: block;
}

.icon-refresh::before {
    content: "🔄";
}

.icon-refresh {
    font-style: normal;
}

.loading {
    text-align: center;
    padding: 30px 15px;
    color: #666;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.promo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    text-align: left;
}

.promo-header img {
    flex-shrink: 0;
    margin-bottom: 0;
}

.promo-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    line-height: 1.3;
}

.details-btn {
    background: linear-gradient(90deg, #ff6b00, #ff5252);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin: 12px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.details-btn:hover {
    background: linear-gradient(90deg, #e55e00, #e53935);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 107, 0, 0.3);
}

.details-btn:hover .details-icon {
    transform: scale(1.1) rotate(0deg);
}

.details-btn:focus {
    outline: 2px solid #ff6b00;
    outline-offset: 2px;
}

.details-btn[aria-expanded="true"] .details-icon {
    transform: scale(1.1) rotate(180deg);
}

.details-btn .details-icon {
    font-size: 0.9em;
    transition: transform 0.3s ease;
}

.details-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    overflow-y: auto;
    opacity: 0;
}

.details-content[style*="block"] {
    max-height: 400px;
    opacity: 1;
}

#lastUpdate {
    transition: opacity 0.3s ease;
}
#lastUpdate.updating {
    opacity: 0.5;
}

@media (max-width: 767px) {
    .container {
        max-width: 95%;
        padding: 10px; /* Уменьшено с 15px */
        margin: 6px; /* Уменьшено с 8px */
    }
    .hero {
        padding: 6px; /* Уменьшено с 8px */
    }
    .hero h1 {
        font-size: 16px; /* Уменьшено с 18px */
    }
    .stats-controls {
        padding: 8px; /* Уменьшено с 10px */
        margin: 6px 0; /* Уменьшено с 8px */
    }
    .stats-controls h2 {
        font-size: 1.1rem; /* Уменьшено с 1.2rem */
    }
    .stats {
        gap: 8px; /* Уменьшено с 10px */
        justify-content: center;
    }
    .stat-item {
        min-width: 70px; /* Уменьшено с 80px */
    }
    .stat-number {
        font-size: 1.3rem; /* Уменьшено с 1.4rem */
    }
    .stat-label {
        font-size: 0.65rem; /* Уменьшено с 0.7rem */
    }
    .controls {
        align-items: center;
        gap: 6px;
    }
    .refresh-btn {
        padding: 5px 10px; /* Уменьшено с 6px 12px */
        font-size: 0.75rem; /* Уменьшено с 0.8rem */
    }
    .last-update {
        font-size: 0.65rem; /* Уменьшено с 0.7rem */
    }
    .filters {
        margin: 6px 0; /* Уменьшено с 8px */
    }
    #filtersContent {
        padding: 8px; /* Уменьшено с 10px */
    }
    .filters input, .filters select {
        padding: 5px; /* Уменьшено с 6px */
        font-size: 11px; /* Уменьшено с 12px */
    }
    .submit-btn {
        padding: 5px 10px; /* Уменьшено с 6px 12px */
        font-size: 12px; /* Уменьшено с 13px */
    }
    .promo-grid {
        grid-template-columns: 1fr;
    }
    .top-offer::before {
        right: 8px;
        top: 8px;
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

@media (min-width: 768px) {
    .stats-controls {
        flex-wrap: nowrap;
    }
    .stats-controls h2 {
        width: auto;
        margin-right: 10px;
    }
    .stats {
        flex: 1;
    }
    .controls {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    .filters {
        margin: 10px 0;
    }
    #filtersContent {
        display: flex !important; /* Всегда видно на десктопах */
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        background: none;
        padding: 0;
        box-shadow: none;
    }
    .toggle-filters {
        display: none; /* Скрыть кнопку на десктопах */
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .promo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .promo-card {
        padding: 15px;
    }
}

@media (max-width: 400px) {
    .promo-card {
        padding: 12px;
        min-height: 260px;
    }
    .promo-header img {
        max-width: 70px;
    }
    .promo-header h3 {
        font-size: 15px;
    }
}

/* Добавьте в конец вашего CSS */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.clickable-card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Но кнопки и ссылки должны быть кликабельны */
.promo-card-content button,
.promo-card-content a,
.promo-card-footer * {
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

/* Визуальный индикатор кликабельности на мобильных */
@media (max-width: 767px) {
    .clickable-card {
        -webkit-tap-highlight-color: transparent;
    }
    
    .clickable-card:active {
        background-color: rgba(0, 0, 0, 0.03);
    }
}

/* Контент деталей тоже должен быть кликабельным */
.details-content {
    pointer-events: auto;
}