/* ============================================
   RESPONSIVE.CSS - Главная страница
   Только адаптация размеров и расположения
   ============================================ */

/* ===== ТЕЛЕФОНЫ (макс. 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .search-wrap .clear-btn {
        display: none !important;
    }

    .search-wrap .clear-btn.visible {
        display: flex !important;
    }

    .suggestions {
        max-height: 200px;
    }

    .suggestion-item { 
        padding: 8px 12px;
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    .suggestion-item .category-tag {
        font-size: 0.55rem;
        padding: 1px 6px;
    }

    /* Hero - убираем карточки на телефонах */
    .hero {
        padding: 12px 0 20px;
    }

    .hero-inner {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-left {
        text-align: center;
        width: 100%;
    }

    .hero-tagline {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    .hero-sub {
        font-size: 0.85rem;
        margin-top: 4px;
    }

    .hero-right {
        display: none;
    }

    /* Категории */
    .categories {
        margin: 12px 0 4px;
    }

    .category-item {
        border-radius: 12px;
        margin-bottom: 6px;
    }

    .category-header {
        padding: 12px 14px;
    }

    .category-header .label {
        font-size: 0.85rem;
    }

    .category-header .count {
        font-size: 0.65rem;
        padding: 1px 10px;
    }

    .category-header .chevron {
        font-size: 0.6rem;
    }

    .category-tools-inner {
        padding: 0 14px;
    }

    .category-tools-inner > * {
        padding: 2px 0 14px 0;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .tool-card {
        padding: 10px 12px;
        gap: 10px;
        border-radius: 10px;
    }

    .tool-card .icon {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .tool-card .icon svg {
        width: 14px;
        height: 14px;
    }

    .tool-card .info h4 {
        font-size: 0.8rem;
    }

    .tool-card .info p {
        font-size: 0.7rem;
    }

    .tool-card .arrow {
        font-size: 0.65rem;
    }

    /* Поиск */
    .search-results-header {
        padding: 6px 0 12px;
        margin-bottom: 12px;
    }

    .search-results-header .result-count {
        font-size: 0.8rem;
    }

    .no-results {
        padding: 30px 16px 20px;
    }

    .no-results .icon {
        font-size: 1.8rem;
    }

    .no-results p {
        font-size: 0.85rem;
    }

    /* Футер */
    footer {
        margin-top: 30px;
        padding: 24px 0 14px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 14px;
    }

    .footer-brand-col {
        max-width: 100%;
        text-align: center;
    }

    .footer-brand {
        font-size: 1.1rem;
    }

    .footer-desc {
        font-size: 0.78rem;
    }

    .footer-col {
        text-align: center;
    }

    .footer-col h5 {
        font-size: 0.6rem;
        margin-bottom: 8px;
    }

    .footer-col ul li {
        margin-bottom: 5px;
    }

    .footer-col ul li a {
        font-size: 0.78rem;
    }

    .social-links li a {
        justify-content: center;
    }

    .footer-bottom {
        font-size: 0.68rem;
        padding-top: 14px;
    }
}

/* ===== ТЕЛЕФОНЫ (481px - 768px) - планшеты ===== */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    /* Хедер - лого слева, поиск справа */
    .header-inner {
        flex-wrap: nowrap;
        gap: 16px;
    }

    .logo {
        font-size: 1.4rem;
        flex-shrink: 0;
    }

    .search-wrap {
        max-width: 280px;
        min-width: 140px;
        flex: 1;
    }

    .search-wrap input {
        font-size: 0.88rem;
        padding: 8px 14px;
    }

    /* Крестик - скрыт по умолчанию */
    .search-wrap .clear-btn {
        display: none !important;
    }

    .search-wrap .clear-btn.visible {
        display: flex !important;
    }

    .hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .hero-right {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        margin-left: 0;
    }

    /* Карточки на планшетах оставляем, но уменьшаем */
    .card-stack {
        width: 120px;
        height: 120px;
        transform: translateX(0);
    }

    .card-stack .card {
        padding: 16px;
        border-radius: 18px;
    }

    .card-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 6px;
    }

    .card-title {
        font-size: 0.75rem;
    }

    .hero-tagline {
        font-size: 1.4rem;
    }

    .hero-sub {
        font-size: 0.9rem;
    }

    .tools-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-brand-col {
        max-width: 100%;
    }

    .footer-desc {
        font-size: 0.8rem;
    }
}

/* ===== ПЛАНШЕТЫ (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 32px;
        max-width: 960px;
    }

    .header-inner {
        gap: 20px;
    }

    .logo {
        font-size: 1.4rem;
    }

    .search-wrap {
        max-width: 320px;
    }

    .hero-tagline {
        font-size: 1.5rem;
    }

    .card-stack {
        width: 150px;
        height: 150px;
        transform: translateX(-40px);
    }

    .tools-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .footer-inner {
        grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
        gap: 30px;
    }
}

/* ===== БОЛЬШИЕ ПЛАНШЕТЫ (1025px - 1200px) ===== */
@media (min-width: 1025px) and (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }

    .card-stack {
        transform: translateX(-50px);
    }
}

/* ===== УЛУЧШЕНИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    /* Увеличенные области касания */
    .category-header {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .tool-card {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .suggestion-item {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .search-wrap input {
        -webkit-appearance: none;
        appearance: none;
    }

    .category-header .right {
        min-height: 36px;
        min-width: 36px;
        justify-content: flex-end;
    }

    /* Крестик - скрыт по умолчанию, показывается только при наличии текста */
    .clear-btn {
        min-height: 36px;
        min-width: 36px;
        display: none !important;
        align-items: center;
        justify-content: center;
    }

    .clear-btn.visible {
        display: flex !important;
    }

    /* Улучшение скролла */
    .suggestions {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Запрет масштабирования текста */
    body {
        -webkit-text-size-adjust: 100%;
    }

    /* Убираем горизонтальный скролл */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }

    .container {
        max-width: 100%;
    }
}

/* ===== АНИМАЦИИ НА МОБИЛЬНЫХ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .card-stack .card {
        transition: none !important;
    }

    .category-tools-wrapper {
        transition: none !important;
    }

    .tool-card {
        transition: none !important;
    }
}

/* ===== АЛЬБОМНАЯ ОРИЕНТАЦИЯ ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-inner {
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }

    .hero-left {
        text-align: left;
        flex: 1;
    }

    .hero-right {
        flex-shrink: 0;
        width: auto;
    }

    /* Карточки показываем только в альбомной ориентации */
    .hero-right {
        display: flex;
    }

    .card-stack {
        width: 90px;
        height: 90px;
        transform: translateX(0);
    }

    .card-stack .card {
        padding: 10px;
        border-radius: 14px;
    }

    .card-icon {
        width: 22px;
        height: 22px;
        margin-bottom: 4px;
    }

    .card-title {
        font-size: 0.6rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .hero-sub {
        font-size: 0.8rem;
    }

    .header-inner {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .logo {
        font-size: 1.1rem;
        text-align: left;
    }

    .search-wrap {
        max-width: 180px;
    }

    .search-wrap input {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    /* Крестик в альбомной ориентации */
    .search-wrap .clear-btn {
        display: none !important;
    }

    .search-wrap .clear-btn.visible {
        display: flex !important;
    }

    .tools-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .tool-card {
        padding: 6px 8px;
        gap: 8px;
    }

    .tool-card .info p {
        display: none;
    }

    .tool-card .icon {
        width: 24px;
        height: 24px;
    }

    .tool-card .icon svg {
        width: 12px;
        height: 12px;
    }

    .tool-card .info h4 {
        font-size: 0.7rem;
    }
}

/* ===== ПОРТРЕТНАЯ ОРИЕНТАЦИЯ НА ПЛАНШЕТАХ ===== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .tools-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .hero-tagline {
        font-size: 1.5rem;
    }
}