/* ============================================================
   АДАПТИВ — ЕДИНЫЙ БЛОК
   ============================================================ */

/* 1. Планшеты (до 1024px) */
@media (max-width: 1024px) {
    .fc-grid--4, .fc-how__steps, .fc-contacts__grid, .fc-stats { grid-template-columns: repeat(2, 1fr) !important; }
    .fc-delivery-grid, .fc-order-grid, .fc-about-advantages, .fc-tech__grid { grid-template-columns: 1fr !important; }
    .fc-works__grid--full { grid-template-columns: repeat(2, 1fr) !important; }
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}    .fc-shop-layout { grid-template-columns: 220px 1fr !important; gap: 24px !important; }
    .fc-product__top { grid-template-columns: 1fr !important; gap: 32px !important; }
    .fc-gallery__main { max-width: 480px !important; margin: 0 auto !important; }
    .fc-footer__grid { grid-template-columns: 1fr 1fr !important; gap: 40px !important; }
    .fc-cart-layout, .fc-checkout-layout { grid-template-columns: 1fr !important; }
    .fc-stats {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 колонки на планшетах */
    }
}

/* 2. Мобильные планшеты (до 900px) */
@media (max-width: 900px) {
    /* Header */
    .fc-header__top, .fc-header__nav, .fc-header__search, .fc-header__catalog-btn { display: none !important; }
    .fc-header__burger { display: flex !important; }
    .fc-header__main-inner { height: 64px !important; gap: 12px !important; padding: 0 16px !important; }
    .fc-header__logo img { max-height: 36px !important; width: auto !important; }
    
    /* Сетки */
    .fc-sale__grid { grid-template-columns: repeat(2, 1fr) !important; }
    .woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; }
    .fc-cart-side, .fc-checkout-side { position: static !important; }
    
    /* Наши работы */
    .fc-works__grid, .fc-works__grid--full { grid-template-columns: 1fr !important; gap: 20px !important; }
    
    /* Блог */
    .blog .site-main, .archive .site-main { grid-template-columns: 1fr !important; gap: 20px !important; padding: 24px 16px 56px !important; }
    .blog article .post-thumbnail img, .archive article .post-thumbnail img { height: 200px !important; }
    .blog article .entry-title, .archive article .entry-title { font-size: 1.15rem !important; min-height: auto !important; padding: 16px 20px 8px !important; }
    .blog article .entry-content, .archive article .entry-content { padding: 0 20px 16px !important; font-size: 14px !important; }

    /* Статья */
    .single-post .site-main, .single .site-main { display: block !important; padding: 32px 16px 60px !important; max-width: 100% !important; }
    .single-post .fc-single-post { padding: 24px 20px !important; }
    .single-post .fc-single-post__title { font-size: 1.4rem !important; text-align: left !important; }
    .single-post .fc-single-post__meta { text-align: left !important; }
    .single-post .fc-single-post__thumbnail { margin: 0 0 24px !important; }
}

/* 3. Телефоны (до 768px) */
@media (max-width: 768px) {
    .fc-products__more, 
.fc-sale__more, 
.fc-works__more {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 32px !important;
}
    table, th, td {
        white-space: normal !important;
        word-wrap: break-word !important;
        max-width: 100% !important;
    }
    .fc-section { padding: 56px 0 !important; }
    .fc-section-title { margin-bottom: 32px !important; }
    .fc-hero { height: 500px !important; }
    .fc-hero__title { font-size: 1.8rem !important; }
    .fc-hero__subtitle { font-size: 1rem !important; }
    .fc-hero__nav { width: 42px !important; height: 42px !important; }
    
    /* Сетки в столбик */
    .fc-grid--4, .fc-how__steps, .fc-contacts__grid, .fc-tech__grid, .fc-works__grid, .fc-works__grid--full, .fc-delivery-grid, .fc-order-grid, .fc-about-advantages, .fc-stats, .fc-sale__grid { grid-template-columns: 1fr !important; }
    .woocommerce ul.products { grid-template-columns: 1fr !important; }
    .fc-shop-layout { grid-template-columns: 1fr !important; }
    .fc-shop-sidebar { position: static !important; }
    .fc-shop-toolbar { flex-direction: column !important; align-items: stretch !important; }
    
    /* Карточка товара */
    .fc-tabs__panel { padding: 28px 20px !important; }
    .fc-product__cart .single_add_to_cart_button { min-width: 100% !important; }
    .fc-materials-table { display: block !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; }
    .fc-materials-table thead { display: none !important; }
    .fc-materials-table tr { display: block !important; background: #fff !important; border-radius: 12px !important; margin-bottom: 12px !important; padding: 16px 20px !important; box-shadow: 0 2px 12px rgba(10,42,94,.06) !important; }
    .fc-materials-table td { display: block !important; width: 100% !important; padding: 6px 0 !important; border: none !important; }
    .fc-materials-table td:first-child { font-size: 16px !important; padding-bottom: 8px !important; margin-bottom: 8px !important; border-bottom: 1px solid var(--fc-border) !important; }
    
    /* Корзина */
    .woocommerce-cart table.shop_table thead { display: none !important; }
    .woocommerce-cart table.shop_table tr { display: block !important; padding: 16px !important; border-bottom: 1px solid var(--fc-border) !important; }
    .woocommerce-cart table.shop_table td { display: flex !important; justify-content: space-between !important; align-items: center !important; border: none !important; padding: 8px 0 !important; }
    
    /* Чекаут */
    .fc-checkout-section { padding: 24px 20px !important; }
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper { display: block !important; }
    .woocommerce-checkout .form-row { width: 100% !important; float: none !important; margin-bottom: 16px !important; }
    
    /* Личный кабинет */
    .woocommerce-account .woocommerce-MyAccount-navigation, .woocommerce-account .woocommerce-MyAccount-content { width: 100% !important; float: none !important; margin-right: 0 !important; margin-bottom: 24px !important; }
    .fc-account-quick { grid-template-columns: repeat(2, 1fr) !important; }
    
    /* Отделы / Реквизиты */
    .fc-departments { grid-template-columns: 1fr !important; gap: 20px !important; }
    .fc-department { text-align: left !important; }
    .fc-department__email { display: block !important; width: 100% !important; text-align: center !important; box-sizing: border-box !important; }
    .fc-requisites__table th, .fc-requisites__table td { display: block !important; width: 100% !important; border-right: none !important; padding: 12px 20px !important; }
    .fc-requisites__table th { background: transparent !important; border-bottom: none !important; font-size: 12px !important; }
    .fc-requisites__table td { padding-top: 4px !important; padding-bottom: 16px !important; border-bottom: 1px solid var(--fc-border) !important; }

    /* Футер */
    .fc-footer__grid { grid-template-columns: 1fr !important; gap: 32px !important; }
    .fc-footer__bottom-inner { flex-direction: column !important; text-align: center !important; }
    .fc-footer__links { justify-content: center !important; flex-wrap: wrap !important; }
     .fc-sale-card {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Делаем картинку квадратной и аккуратной */
    .fc-sale-card__image {
        width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        padding: 20px !important;
    }

    /* Центрируем текст */
    .fc-sale-card__body {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        padding: 16px !important;
    }

    /* Прижимаем цену к низу */
    .fc-sale-card__title {
        margin-bottom: auto !important; /* Выталкивает цену вниз */
    }
    .fc-delivery-contacts__buttons {
        flex-direction: row !important;
        flex-wrap: wrap;
    }
    .fc-delivery-contacts__buttons .fc-btn {
        width: auto !important;
        min-width: 160px;
    }.fc-delivery-card {
        padding: 24px 20px !important;
    }
    .fc-delivery-card h3 {
        font-size: 1.15rem !important;
    }
    .fc-cta__buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
    .fc-cta__buttons .fc-btn {
        width: auto !important;
        min-width: 180px !important;
    }
     .fc-about-advantages {
        grid-template-columns: 1fr !important; /* 1 колонка на телефоне */
        gap: 16px !important;
    }
    .fc-about-adv {
        padding: 24px !important;
    }
    .fc-about-adv h3 {
        font-size: 1.1rem !important;
    }
    /* 1. Убираем горизонтальный скролл со страницы */
    body.woocommerce-cart {
        overflow-x: hidden !important;
    }

    /* 2. Прячем шапку таблицы (названия колонок) */
    .woocommerce-cart table.shop_table thead {
        display: none !important;
    }

    /* 3. Каждый товар превращаем в отдельную карточку */
    .woocommerce-cart table.shop_table tr.cart_item {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        position: relative !important;
        padding: 20px !important;
        margin-bottom: 16px !important;
        background: #fff !important;
        border-radius: var(--fc-radius) !important;
        box-shadow: var(--fc-shadow) !important;
        border: none !important;
    }

    /* Ячейки таблицы ведут себя как блоки */
    .woocommerce-cart table.shop_table td {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
    }

    /* Кнопка удаления (крестик) в правом верхнем углу */
    .woocommerce-cart table.shop_table td.product-remove {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        width: auto !important;
        z-index: 2 !important;
    }
    .woocommerce-cart table.shop_table td.product-remove a.remove {
        background: var(--fc-bg) !important;
        color: var(--fc-gray) !important;
        width: 30px !important;
        height: 30px !important;
        line-height: 30px !important;
    }
    .woocommerce-cart table.shop_table td.product-remove a.remove:hover {
        background: var(--fc-red) !important;
        color: #fff !important;
    }

    /* Картинка товара (слева) */
    .woocommerce-cart table.shop_table td.product-thumbnail {
        width: 80px !important;
        flex-shrink: 0 !important;
        margin-right: 16px !important;
    }
    .woocommerce-cart table.shop_table td.product-thumbnail img {
        width: 80px !important;
        height: 80px !important;
        border-radius: 10px !important;
        padding: 6px !important;
        border: 1px solid var(--fc-border) !important;
    }

    /* Название товара (справа от картинки) */
    .woocommerce-cart table.shop_table td.product-name {
        flex: 1 !important;
        width: calc(100% - 100px) !important;
        padding-right: 30px !important; /* Чтобы текст не наезжал на крестик */
        margin-bottom: 16px !important;
    }
    .woocommerce-cart table.shop_table td.product-name a {
        font-size: 15px !important;
        line-height: 1.4 !important;
        display: block !important;
    }

    /* Цена и количество (встают в ряд под названием) */
    .woocommerce-cart table.shop_table td.product-price,
    .woocommerce-cart table.shop_table td.product-quantity,
    .woocommerce-cart table.shop_table td.product-subtotal {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-top: 12px !important;
        border-top: 1px solid var(--fc-border) !important;
        margin-top: 12px !important;
    }

    /* Добавляем подписи полям (через content) */
    .woocommerce-cart table.shop_table td.product-price::before {
        content: "Цена:" !important;
        font-weight: 600 !important;
        color: var(--fc-gray) !important;
        font-size: 14px !important;
    }
    .woocommerce-cart table.shop_table td.product-quantity::before {
        content: "Количество:" !important;
        font-weight: 600 !important;
        color: var(--fc-gray) !important;
        font-size: 14px !important;
    }
    .woocommerce-cart table.shop_table td.product-subtotal::before {
        content: "Сумма:" !important;
        font-weight: 600 !important;
        color: var(--fc-gray) !important;
        font-size: 14px !important;
    }
    
    /* Прячем блок цены за штуку, чтобы не дублировался */
    .woocommerce-cart table.shop_table td.product-price {
        display: none !important; 
    }

    /* Поле ввода количества */
    .woocommerce-cart .quantity input.qty {
        width: 60px !important;
        height: 36px !important;
        border-radius: 8px !important;
        font-size: 14px !important;
    }

    /* 4. Блок с купоном и обновлением */
    .woocommerce-cart table.shop_table tr:not(.cart_item) {
        display: block !important;
        width: 100% !important;
        border: none !important;
        background: transparent !important;
    }
    
    .woocommerce-cart .coupon {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    .woocommerce-cart .coupon input[type="text"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        box-sizing: border-box !important;
    }

    /* Кнопки купона и обновления */
    .woocommerce-cart .coupon button,
    .woocommerce-cart button[name="update_cart"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px 20px !important;
        font-size: 14px !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* 5. Блок ИТОГО */
    .woocommerce-cart .cart_totals {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px 20px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
    
    .woocommerce-cart .cart_totals table.shop_table {
        display: table !important; /* Возвращаем табличное поведение для итогов */
        margin-bottom: 20px !important;
    }

    .woocommerce-cart .cart_totals .checkout-button {
        width: 100% !important;
        min-width: 0 !important;
        padding: 16px 20px !important;
        font-size: 16px !important;
        box-sizing: border-box !important;
    }
    /* 1. Возвращаем табличный вид для блока "Итого" */
    .woocommerce-cart .cart_totals table.shop_table {
        display: table !important; 
        width: 100% !important;
        margin-bottom: 24px !important;
    }
    
    .woocommerce-cart .cart_totals table.shop_table tbody,
    .woocommerce-cart .cart_totals table.shop_table tr {
        display: table-row !important;
    }

    .woocommerce-cart .cart_totals table.shop_table th,
    .woocommerce-cart .cart_totals table.shop_table td {
        display: table-cell !important;
        padding: 14px 0 !important;
        vertical-align: middle !important;
        border-bottom: 1px solid var(--fc-border) !important;
    }

    /* 2. Показываем названия строк (Подытог и Итого) */
    .woocommerce-cart .cart_totals table.shop_table th {
        text-align: left !important;
        font-weight: 500 !important;
        font-size: 14px !important;
        color: var(--fc-gray) !important;
    }

    .woocommerce-cart .cart_totals table.shop_table td {
        text-align: right !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        color: var(--fc-navy) !important;
        white-space: nowrap !important;
    }

    /* 3. Стилизуем строку "Итого" (последняя строка) */
    .woocommerce-cart .cart_totals .order-total th,
    .woocommerce-cart .cart_totals .order-total td {
        padding-top: 20px !important;
        border-bottom: none !important;
        font-family: var(--fc-font-head) !important;
        font-weight: 800 !important;
        font-size: 18px !important;
    }
    
    .woocommerce-cart .cart_totals .order-total td .amount {
        color: var(--fc-red) !important;
        font-size: 20px !important;
    }

    /* 4. Убираем дублирующие подписи из предыдущего кода, если они там были */
    .woocommerce-cart .cart_totals table.shop_table td::before {
        display: none !important;
        content: none !important;
    }
    .fc-thankyou__steps {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 32px !important;
        box-sizing: border-box !important;
    }

    /* 2. Заставляем каждую карточку занять 100% ширины */
    .fc-thankyou__step {
        display: flex !important;
        flex-direction: row !important; /* Цифра слева, текст справа */
        align-items: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important; /* Убивает жесткую ширину */
        box-sizing: border-box !important;
        padding: 20px !important;
        margin: 0 !important;
    }

    /* 3. Убираем жесткие размеры у цифры */
    

    /* 4. Фиксим текст внутри (чтобы не распирал карточку) */
    .fc-thankyou__step > div {
        flex: 1 !important;
        min-width: 0 !important;
        word-wrap: break-word !important;
    }

    .fc-thankyou__step strong {
        display: block !important;
        font-size: 15px !important;
        line-height: 1.4 !important;
        margin-bottom: 6px !important;
        color: var(--fc-navy) !important;
    }

    .fc-thankyou__step p {
        font-size: 14px !important;
        line-height: 1.5 !important;
        color: var(--fc-gray) !important;
        margin: 0 !important;
    }
    .fc-thankyou__step-num {
         /* Убираем flex-растяжение */
        flex: none !important; 
        
        /* Жестко фиксируем размеры */
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        
        /* Делаем круг */
        border-radius: 50% !important;
        
        /* Центрируем цифру внутри */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        
        /* Убираем внутренние отступы, которые тоже могут сплющивать */
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* На всякий случай фиксируем и сам родительский блок */
    .fc-thankyou__step {
        display: flex !important;
        align-items: flex-start !important;
        gap: 16px !important; /* Расстояние между цифрой и текстом */
    }
    .related.products ul.products {
        padding-bottom: 20px !important;
    }
    .woocommerce-account .woocommerce-MyAccount-navigation {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-bottom: 24px !important;
    }
    
    .fc-account-quick {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 колонки на телефоне */
        gap: 12px !important;
    }
    
    .fc-account-quick__item {
        padding: 20px 12px !important;
    }
     /* Шапка карточки перестраивается в 2 колонки */
    .fc-order-item__head {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        padding: 16px !important;
    }

    /* Тело карточки встает в столбик */
    .fc-order-item__body {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 16px !important;
    }

    /* Кнопка "Подробнее" растягивается на всю ширину */
    .fc-order-item__actions {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .fc-order-item__actions .fc-btn {
        width: 100% !important;
        text-align: center !important;
    }
}

/* 4. Маленькие телефоны (до 640px) */
@media (max-width: 640px) {
    .fc-header__logo img { max-height: 32px !important; }
    .fc-btn { padding: 12px 24px !important; font-size: 14px !important; }
    .fc-hero { height: 460px !important; }
    .fc-hero__title { font-size: 1.5rem !important; }
    .fc-account-quick { grid-template-columns: 1fr !important; }
    .related.products ul.products li.product { flex: 0 0 70% !important; min-width: 180px !important; }
    
    .fc-btn {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
    .fc-hero {
        height: 460px !important;
    }
    .fc-hero__title {
        font-size: 1.5rem !important;
    }
    .fc-header__logo img {
        max-height: 32px !important;
    }
    .fc-modal__dialog {
        padding: 24px 20px !important;
    }
    .fc-account-quick {
        grid-template-columns: 1fr !important;
    }
    .related.products ul.products li.product {
        flex: 0 0 70% !important;
        min-width: 180px !important;
    }
    .fc-delivery-contacts__buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
    .fc-delivery-contacts__buttons .fc-btn {
        width: auto !important;
        min-width: 180px !important;
    }
     .fc-stats {
        grid-template-columns: 1fr !important; /* 1 колонка на телефонах */
        gap: 16px !important;
        margin: 40px 0 !important;
    }
    .fc-stat {
        padding: 24px 16px !important;
    }
    .fc-stat__num {
        font-size: 2.2rem !important;
    }
     .fc-order-view__head {
        flex-direction: column !important;
    }
    
    .fc-order-view__addresses {
        grid-template-columns: 1fr !important; /* Адреса в столбик */
    }
    
    /* Таблицу на телефоне делаем прокручиваемой */
    .fc-order-view__table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    
    .fc-order-view__actions {
        flex-direction: column !important;
    }
    .fc-order-view__actions .fc-btn {
        width: 100% !important;
        text-align: center !important;
    }
    .fc-account-topbar {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 16px 20px !important;
    }
    
    .fc-account-logout {
        width: 100% !important;
        justify-content: center !important; /* Кнопка на всю ширину */
        margin-top: 8px !important;
    }
}