/**
 * ==============================================
 * PREMIUM МОБИЛЬНАЯ АДАПТАЦИЯ
 * Интернет-магазин тюнинга квадроциклов
 * ==============================================
 *
 * ВАЖНО:
 * Этот файл не просто "уменьшает блоки",
 * а сохраняет премиальное ощущение на планшетах и телефонах.
 *
 * Основные принципы:
 * 1. Уменьшаем плотность
 * 2. Сохраняем иерархию
 * 3. Оставляем красивый ритм отступов
 * 4. Не даём карточкам превращаться в "дешёвую мобильную ленту"
 *
 * ==============================================
 */


/* ============================================== */
/* LAPTOP / <= 1200px */
/* ============================================== */
@media (max-width: 1200px) {
    .container {
        max-width: 1040px;
        padding: 0 22px;
    }

    .hero-title {
        font-size: 4.2rem;
    }

    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
        gap: 20px;
    }

    .catalog-layout {
        grid-template-columns: 280px 1fr;
        gap: 24px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================== */
/* TABLET LANDSCAPE / <= 992px */
/* ============================================== */
@media (max-width: 992px) {
    .container {
        max-width: 760px;
        padding: 0 20px;
    }

    .section-padding {
        padding: 82px 0;
    }

    .desktop-nav {
        display: none;
    }

    .burger-menu {
        display: flex;
    }

    .logo-text {
        font-size: 15px;
        letter-spacing: 0.18em;
    }

    .mega-menu {
        display: none;
    }

    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }

    .footer-grid .footer-col:first-child {
        grid-column: 1 / -1;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        bottom: 0;
        width: 340px;
        height: 100vh;
        border-radius: 0;
        background: rgba(14,14,14,0.98);
        z-index: 1001;
        transition: left 0.32s ease;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: 0 14px 60px rgba(0,0,0,0.45);
    }

    .catalog-sidebar.active {
        left: 0;
    }

    .sidebar-header {
        padding: 18px 20px;
        background: rgba(18,18,18,0.96);
        position: sticky;
        top: 0;
        z-index: 10;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    }

    .sidebar-content {
        padding: 18px;
        overflow-y: auto;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-close {
        display: flex;
    }

    .filter-toggle {
        display: inline-flex;
    }

    .filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.72);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 1000;
    }

    .filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .catalog-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cart-summary,
    .checkout-summary {
        position: static;
        max-width: 540px;
        margin: 0 auto;
        width: 100%;
    }

    .about-grid,
    .contacts-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================== */
/* MOBILE / <= 768px */
/* ============================================== */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 16px;
    }

    body {
        padding-bottom: 72px;
        font-size: 15px;
    }

    .section-padding {
        padding: 62px 0;
    }

    .section-title {
        padding-bottom: 14px;
        margin-bottom: 1rem;
    }

    .section-title::before {
        width: 84px;
    }

    .section-title::after {
        width: 48px;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2.4rem;
    }

    .site-header {
        height: 64px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .logo-text {
        display: none;
    }

    .header-right {
        gap: 10px;
    }

    .header-icon {
        width: 40px;
        height: 40px;
    }

    .cart-badge {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }

    .mobile-menu-overlay {
        align-items: flex-start;
        padding-top: 84px;
    }

    .mobile-menu-content {
        width: 100%;
        max-width: 100%;
        padding: 0 20px;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .breadcrumbs {
        margin-top: 64px;
        padding: 14px 0;
    }

    .breadcrumbs-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .breadcrumbs-list::-webkit-scrollbar {
        display: none;
    }

    .breadcrumbs-list li {
        white-space: nowrap;
        font-size: 12px;
    }

    .hero-section {
        min-height: 560px;
        height: auto;
        padding: 110px 0 70px;
    }

    .hero-title {
        font-size: 2.75rem;
        line-height: 1.02;
    }

    .hero-subtitle {
        font-size: 11px;
        letter-spacing: 0.22em;
        margin-bottom: 18px;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 32px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .scroll-indicator {
        display: none;
    }

    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .brand-card {
        padding: 22px 16px;
        border-radius: 20px;
    }

    .brand-logo-wrapper {
        width: 78px;
        height: 78px;
        margin-bottom: 14px;
        border-radius: 18px;
    }

    .brand-name {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .brand-count {
        font-size: 12px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 20px 14px;
        border-radius: 18px;
    }

    .category-icon-wrapper svg {
        width: 32px;
        height: 32px;
    }

    .category-name {
        font-size: 14px;
    }

    .category-count {
        font-size: 11px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-item {
        display: flex;
        align-items: center;
        gap: 14px;
        text-align: left;
        padding: 18px 16px;
        border-radius: 20px;
    }

    .feature-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .feature-icon svg {
        width: 34px;
        height: 34px;
    }

    .feature-title {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .feature-description {
        font-size: 13px;
    }

    .catalog-header {
        padding: 34px 0 28px;
    }

    .catalog-title {
        font-size: 1.85rem;
    }

    .catalog-total {
        font-size: 14px;
    }

  .catalog-toolbar {
        position: sticky;
        top: 0;
        z-index: 350;
        margin-bottom: 14px;
        padding: 8px 10px;
        border-radius: 0 0 14px 14px;
        background: rgba(10,10,10,0.97);
        border-bottom: 1px solid rgba(255,255,255,0.06);
        box-shadow: 0 8px 20px rgba(0,0,0,0.16);
    }

    .toolbar-left {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .filter-toggle {
        min-height: 40px;
        padding: 8px 12px;
    }

   
	
    

    .sort-select {
        flex: 1;
    }

    .sort-select select {
        width: 100%;
        font-size: 13px;
        padding: 10px 36px 10px 12px;
		min-height: 40px;
    }

    .view-toggle {
        display: none;
    }

    .catalog-sidebar {
        width: 300px;
    }

    .filter-title {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .filter-options {
        max-height: 180px;
    }

    .filter-checkbox {
        font-size: 13px;
    }

    .price-input {
        padding: 9px 10px;
        font-size: 13px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-card {
        max-width: 100%;
        border-radius: 20px;
    }

    .product-image-wrapper {
        aspect-ratio: 4 / 3;
    }

    .product-info {
        padding: 18px;
    }

    .product-meta {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .product-title {
        font-size: 15px;
        min-height: 40px;
        margin-bottom: 10px;
    }

    .product-price {
        font-size: 18px;
    }

    .product-old-price {
        font-size: 12px;
    }

    .product-actions {
        gap: 8px;
    }

    .product-actions .btn {
        padding: 8px 10px;
        font-size: 10px;
        min-height: 38px;
    }

    .product-badge {
        top: 10px;
        left: 10px;
        font-size: 9px;
        padding: 5px 9px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination a,
    .pagination span {
        min-width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .skeleton-loader {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 92px 1fr;
        gap: 14px;
        padding: 16px;
        border-radius: 18px;
    }

    .cart-item-image {
        width: 92px;
        height: 92px;
    }

    .cart-item-title {
        font-size: 15px;
    }

    .cart-item-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cart-item-quantity {
        width: 100%;
        justify-content: space-between;
    }

    .cart-item-total {
        font-size: 18px;
        align-self: flex-end;
    }

    .summary-card,
    .checkout-form {
        padding: 20px;
        border-radius: 20px;
    }

    .summary-title {
        font-size: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 14px;
        padding: 12px 14px;
        border-radius: 14px;
    }

    .radio-label {
        padding: 14px;
        border-radius: 16px;
    }

    .radio-text strong {
        font-size: 14px;
    }

    .radio-text small {
        font-size: 11px;
    }

    .checkout-submit-mobile {
        display: block;
    }

    .checkout-summary .btn {
        display: none;
    }

    .thankyou-content {
        padding: 34px 20px;
    }

    .thankyou-title {
        font-size: 26px;
    }

    .order-number {
        font-size: 18px;
        padding: 10px 16px;
    }

    .thankyou-actions {
        flex-direction: column;
        gap: 10px;
    }

    .thankyou-info {
        padding: 20px;
    }

    .about-hero-title {
        font-size: 2.1rem;
    }

    .about-hero-subtitle {
        font-size: 1rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .contacts-info,
    .contacts-form {
        padding: 24px 18px;
    }

    .info-item {
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

    .info-icon {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .info-content h3 {
        font-size: 14px;
    }

    .info-content a,
    .info-content p {
        font-size: 14px;
    }

    .map-section iframe {
        height: 260px;
    }

    .site-footer {
        padding: 46px 0 20px;
    }

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

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

    .footer-legal a {
        justify-content: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .footer-links li {
        margin: 0;
    }

    .footer-contacts {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

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

    .back-to-top {
        right: 16px;
        bottom: 86px;
        width: 46px;
        height: 46px;
    }

    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 84px;
        width: auto;
        transform: none;
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }
}


/* ============================================== */
/* SMALL MOBILE / <= 480px */
/* ============================================== */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .section-padding {
        padding: 50px 0;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .brands-grid {
        grid-template-columns: 1fr;
    }

    .brand-card {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 14px;
        padding: 16px;
    }

    .brand-logo-wrapper {
        width: 64px;
        height: 64px;
        margin: 0;
        flex-shrink: 0;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 14px;
        padding: 16px;
    }

    .category-icon-wrapper {
        margin-bottom: 0;
    }

    .catalog-sidebar {
        width: 100%;
    }

    .filter-options {
        max-height: 160px;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
    }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-item-image {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        max-width: none;
    }

    .cart-item-actions {
        width: 100%;
    }

    .cart-item-total {
        align-self: center;
    }

    .radio-label {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-item {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .footer-contacts li {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .pagination a,
    .pagination span {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
    }
}


/* ============================================== */
/* TOUCH-УСТРОЙСТВА */
/* ============================================== */
/**
 * На touch-устройствах увеличиваем tappable-areas
 * и убираем лишние hover-эффекты.
 */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .header-icon,
    .filter-checkbox,
    .radio-label,
    .bottom-nav-item,
    .quantity-btn,
    .cart-item-remove,
    .table-action,
    .pagination a,
    .social-link {
        min-height: 44px;
        min-width: 44px;
    }

    .product-card:hover,
    .brand-card:hover,
    .category-card:hover,
    .btn:hover {
        transform: none;
    }

    .btn-primary:hover {
        background: linear-gradient(135deg, var(--accent), #ff7a49);
    }

    .dropdown:hover .mega-menu {
        opacity: 0;
        visibility: hidden;
    }

    .mega-menu {
        display: none;
    }

    .image-zoom-lens,
    .image-zoom-result {
        display: none !important;
    }
}


/* ============================================== */
/* DARK MODE SUPPORT */
/* ============================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #090909;
        --bg-secondary: #101010;
        --bg-card-solid: #181818;
        --text-primary: #ffffff;
        --text-secondary: #b2b2b2;
    }
}

/* ============================================== */
/* FIX: MOBILE CHECKOUT / FORMS ANTI-ZOOM */
/* ============================================== */
/**
 * На мобильных браузерах поля с font-size < 16px часто вызывают zoom.
 * После фокуса страница может "разъезжаться" и вести себя неаккуратно.
 *
 * Решение:
 * - задаём минимум 16px для полей
 * - стабилизируем layout при focus
 */
@media (max-width: 768px) {
    .checkout-form .form-input,
    .checkout-form .form-select,
    .checkout-form .form-textarea,
    .contacts-form .form-input,
    .contacts-form .form-select,
    .contacts-form .form-textarea,
    .feedback-form .form-input,
    .feedback-form .form-textarea,
    .search-overlay-input {
        font-size: 16px !important;
        line-height: 1.4;
    }

    .checkout-layout,
    .checkout-form,
    .checkout-summary,
    .summary-card {
        min-width: 0;
        max-width: 100%;
    }

    .checkout-form {
        overflow: hidden;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .checkout-form .form-input:focus,
    .checkout-form .form-select:focus,
    .checkout-form .form-textarea:focus {
        transform: none !important;
        zoom: 1;
    }

    body {
        -webkit-text-size-adjust: 100%;
    }
}

/* ==============================================
   PRODUCT CARDS - MOBILE PREMIUM TUNING
   Версия: 1.0.0
   Назначение:
   1. Адаптация унифицированных карточек на мобильных
   ============================================== */

@media (max-width: 768px) {
    .product-card {
        border-radius: 22px;
    }

    .product-image-wrapper {
        aspect-ratio: 4 / 3;
    }

    .product-image {
        padding: 14px;
    }

    .product-info {
        padding: 16px 16px 15px;
    }

    .product-meta {
        margin-bottom: 6px;
        font-size: 10px;
        min-height: 16px;
    }

    .product-title {
        min-height: 40px;
        font-size: 15px;
        line-height: 1.35;
        margin-bottom: 10px;
    }

    .product-price {
        font-size: 19px;
    }

    .product-old-price {
        font-size: 12px;
    }

    .product-price-wrapper {
        margin-bottom: 12px;
    }

    .product-actions {
        gap: 8px;
    }

    .product-actions .btn {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 10px;
    }

    .product-badge {
        top: 10px;
        left: 10px;
        padding: 6px 9px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
    }

    .product-title {
        min-height: 0;
    }
}