:root {
    --red: #ff2d3e;
    --dark-bg: #1a1a1a;
    --gray-light: #f2f4f7;
    --text-dark: #333;
    --text-muted: #999;
    --border-color: #e0e0e0;
}

.basket {
    margin: 0 auto;
    padding-top: 60px;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
}

.basket__title {
    font-size: 64px; 
    line-height: 64px;
    color: #1C1C1C;
    font-weight: 500;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

/* Элемент корзины */
.basket-item {
    display: grid;
    /* Уточненная сетка: фото, инфо, цена, кол-во, площадь, итог, удалить */
    grid-template-columns: 80px 3fr 1fr 140px 100px 120px 40px;
    align-items: center;
    gap: 15px;
    background: #EDEDED;
    padding: 12px 30px;
    border-radius: 15px;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.basket-item:hover {
    transform: translateX(5px);
}

.basket-item__image img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    mix-blend-mode: multiply; /* Убирает белый фон у картинок на сером фоне */
}

.basket-item__info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.basket-item__name {
    font-size: 17px;
    line-height: 15px;
    color: #1C1C1C;
    line-height: 24px;
}

/* Иконка информации (i) */
.info-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.basket-item__price span bdi {
    color: #B40555;
    font-weight: 500;
    font-size: 20px;
    white-space: nowrap;
}

.basket-item__price span {
    color: #1C1C1C99;
    font-size: 18px;
    font-weight: 400;
}

/* Кастомный счетчик */
.counter {
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.counter__btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter__input {
    width: 54px;
    border: none;
    background: #fff;
    padding: 10px 5px;
    padding-left: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 20px;
    outline: none;
}

.basket-item__area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.basket-item__area .basket-item__area-value {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 64px;
    height: 44px;
    font-size: 20px;
    font-weight: 500;
    color: #1C1C1C;
    background: #FFFFFF;
    text-align: center;
}

.basket-item__area span {
    font-size: 18px;
    width: 69px;
    line-height: 24px;
    color: #1C1C1C99;
}

.basket-item__total {
    color: #FD1F2D;
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    text-align: right;
}

.basket-item__remove {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: 0.2s;
}

.basket-item__remove:hover {
    background: #fff;
    color: var(--red);
    border-color: var(--red);
}

/* Итоговая панель */
.basket__summary {
    text-align: right;
    margin: 40px 0;
    font-size: 20px;
    font-weight: 500;
    color: #1C1C1C;
    text-transform: lowercase;
}

.summary-value {
    color: #B40555;
    font-size: 30px;
    font-weight: 500;
    margin-left: 12px;
}

/* Стилизация формы */
.order-form {
    margin-bottom: 50px;
}

.order-form__title {
    text-align: center;
    font-size: 42px;
    color: #1C1C1C;
    line-height: 44px;
    font-weight: 500;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.order-form__subtitle {
    text-align: center;
    color: #1C1C1C99;
    font-size: 20px;
    line-height: 26px;
    margin-bottom: 24px;
}

.form-dark {
    background: #1C1C1C;
    padding: 40px 40px;
    border-radius: 16px;
    margin: 0 auto;
    text-align: left;
}

.form-dark p {
    color: #FFFFFF99;
    font-size: 14px;
    text-transform: lowercase;
}

.form-input {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #333;
    padding: 20px 0;
    color: #fff;
    font-size: 16px;
    margin-bottom: 30px;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-bottom: 1px solid #333;
}

.form-input::placeholder {
    color: #FFFFFF;
    font-size: 18px;
    text-transform: lowercase;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover, 
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important; /* Текст остается белым */
    transition: background-color 5000s ease-in-out 0s; /* Фон не меняется годами */
    box-shadow: inset 0 0 0 50px #1c1c1c !important; /* Цвет фона твоего сайта */
}

.btn-submit {
    margin-top: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 72px;
    width: 100%;
    background: #FD1F2D;
    color: #fff;
    border: none;
    padding: 22px;
    border-radius: 12px;
    font-size: 20px;
    line-height: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-submit:hover {
    opacity: 0.9;
    transform: scale(0.99);
}

.form-privacy {
    color: #FFFFFF99;
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
    line-height: 20px;
}

.form-privacy a {
    text-decoration: underline;
}


.woocommerce-cart-form__contents thead { display: none; }

/* Стилизация ссылки удаления */
.basket-item__remove a {
    text-decoration: none;
    color: #1C1C1C;
    font-size: 24px;
}

/* Кнопка обновления (скрытая или стилизованная) */
.basket__actions {
    margin-top: 20px;
    text-align: right;
}

.basket__actions .button {
    background: #f2f4f7;
    border: 1px solid #ccc;
    padding: 10px 20px;
    cursor: pointer;
}



/* Основной контейнер */
.woocommerce-message {
    background-color: #ffffff !important;
    border: none !important;
    border-left: 4px solid #4CAF50 !important; /* Зеленая полоска слева */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 20px 25px !important;
    border-radius: 8px;
    color: #333 !important;
    font-family: 'Inter', sans-serif; /* Поменяй на свой шрифт */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Кнопка "В корзину" (если она есть внутри сообщения) */
.woocommerce-message .button {
    background-color: #333 !important;
    color: #fff !important;
    border-radius: 5px !important;
    padding: 8px 15px !important;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    transition: 0.3s;
}

.woocommerce-message .button:hover {
    background-color: #555 !important;
}


/* ==========================================================
   АДАПТИВНАЯ ВЕРСИЯ КОРЗИНЫ (Desktop не затронут)
   ========================================================== */

@media (max-width: 1200px) {
    .basket__title {
        font-size: 48px;
        line-height: 52px;
    }
    
    .basket-item {
        /* Уплотняем колонки, чтобы всё влезло в ряд */
        grid-template-columns: 70px 2fr 1fr 120px 90px 100px 32px;
        padding: 12px 15px;
        gap: 10px;
    }

    .basket-item__name { font-size: 15px; }
    .basket-item__price, .basket-item__total { font-size: 18px; }


}

@media (max-width: 1024px) {
    .basket-item {
        /* Переходим на 2 строки для экономии места */
        grid-template-columns: 80px 1fr 1fr 1fr 40px;
        grid-template-areas: 
            "img info info price remove"
            "img counter area total remove";
        gap: 15px;
        padding: 20px;
    }

    .basket-item__image { grid-area: img; }
    .basket-item__info { grid-area: info; }
    .basket-item__price { grid-area: price; text-align: left; }
    .counter { grid-area: counter; }
    .basket-item__area { grid-area: area; justify-content: center; }
    .basket-item__total { grid-area: total; text-align: right; font-size: 20px; }
    .basket-item__remove { grid-area: remove; margin-left: auto; }

    .order-form__title { font-size: 34px; }
}

@media (max-width: 768px) {
    .basket { padding-top: 30px; }

    .basket__title {
        font-size: 32px;
        line-height: 36px;
        margin-bottom: 25px;
        text-align: center;
    }

    .basket-item {
        /* Компактный вид для смартфона */
        grid-template-columns: 60px 1fr 1fr 32px;
        grid-template-areas: 
            "img info info remove"
            "img price price price"
            "counter area total total";
        padding: 15px;
        background: #f7f7f7; /* Чуть светлее для чистоты */
    }

    .basket-item__total {
        text-align: right;
        font-size: 22px;
    }

    .basket__summary {
        text-align: center;
        font-size: 18px;
        border-top: 1px solid #ddd;
        padding-top: 20px;
    }

    .summary-value { font-size: 26px; }

    .form-dark { padding: 30px 20px; }
    
    .order-form__title { font-size: 28px; line-height: 32px; }
}

@media (max-width: 580px) {
    /* Серый фон карточки */
    .basket-item {
        grid-template-columns: 60px 1fr auto 90px !important;
        grid-template-areas: 
            "img info info remove" 
            "price price counter area"
            "total total total total" !important;
        background: #EDEDED !important;
        padding: 4px;
        border-radius: 12px;
        gap: 4px !important;
        align-items: center !important;
    }

    .basket-item__image img {
        background: #fff;
        border-radius: 10px;
        padding: 5px;
    }

    /* Название и i */
    .basket-item__info {
        display: flex;
        align-items: center;
        gap: 6px;
        grid-area: info;
    }

    .basket-item__price {
        padding: 12px 11px;
    }
    /* Цена (красная) */
    .basket-item__price span bdi {
        grid-area: price;
        color: #B40555 !important;
        font-weight: 400;
        font-size: 14px !important;
        line-height: 17px;
    }
    .basket-item__price span { color: #1C1C1C99; font-size: 14px; }

    /* БЕЛЫЕ ПЛАШКИ (Кол-во и Площадь) */
    .counter, .basket-item__area {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        background: transparent !important; /* Убираем фон с обертки */
        padding: 0 !important;
    }

    /* Белый квадрат для цифр */
    .counter__input, .basket-item__area-value {
        background: #FFFFFF !important;
        border-radius: 10px !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        line-height: 18px;
        color: #1C1C1C !important;
        border: none !important;
        padding: 0 !important;
        text-align: center !important;
    }

    /* Кнопки + и - отдельно (как на макете) */
    .counter__btn {
        background: none !important;
        font-size: 20px !important;
        padding: 0 8px !important;
    }

    /* Подписи (шт / м.кв) */
    .basket-item__area span, .counter::after {
        font-size: 14px;
        line-height: 17px;
        color: #1C1C1C99;
        margin-left: 8px;
    }

    /* ИТОГО С ПУНКТИРОМ */
    .basket-item__total {
        grid-area: total;
        display: flex !important;
        align-items: baseline; /* Выравнивание по базовой линии текста */
        justify-content: space-between;
        width: 100%;
        padding: 0px 12px;
        /* Убираем старую линию сверху, если она не нужна над блоком */
        border-top: none !important; 
        
        color: #FD1F2D !important;
        font-size: 20px !important;
        font-weight: 700 !important;
    }

    /* Настраиваем "итого" */
    .basket-item__total::before {
        content: "итого";
        font-size: 14px;
        color: #999;
        font-weight: 400;
        margin-right: 8px; /* Отступ до линии */
        order: 1;
    }

    /* Сама линия */
    .basket-item__total::after {
        content: "";
        flex: 1; /* Растягивает линию на всё свободное место */
        border-bottom: 1px dashed #CCC; /* Тот самый пунктир */
        margin-right: 8px; /* Отступ от линии до цены */
        order: 2;
        position: relative;
        top: -4px; /* Смещаем чуть вверх, чтобы линия была по центру текста */
    }

    .basket-item__total .woocommerce-Price-amount {
        order: 3;
        white-space: nowrap; /* Чтобы цена не переносилась */
    }
    
    /* Крестик удаления (белый кружок) */
    .basket-item__remove {
        background: #FFFFFF !important;
        border-radius: 50% !important;
        width: 32px !important;
        height: 32px !important;
        margin-right: 12px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .basket-item__area span, .counter::after {
        margin-left: 0;
    }
}

@media (max-width: 380px) {
    .basket-item__name {
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal; /* Разрешаем перенос на 2 строки вместо обрезания */
    }
}

/* Специально для узких смартфонов (360px и меньше) */
@media (max-width: 370px) {
    .basket__title {
        font-size: 26px; /* Уменьшаем главный заголовок */
        line-height: 30px;
        margin-bottom: 15px;
    }

    .basket-item {
        gap: 8px;
    }

    .basket-item__image img {
        width: 50px; /* Уменьшаем картинку товара */
        height: 50px;
    }

    .basket-item__name {
        font-size: 13px; /* Мелкий, но читаемый текст */
        line-height: 1.2;
    }

    /* Делаем плашки выбора (кол-во и площадь) чуть ниже, чтобы пальцам было проще */
    .basket-item__area, .counter {
        padding: 6px 10px;
        font-size: 13px;
    }

    .basket-item__area::before, .counter::before {
        font-size: 12px; /* Уменьшаем подписи "Площадь" и "Кол-во" */
    }

    .counter__input, .basket-item__area-value {
        width: 60px; /* Узкие поля ввода */
        height: 34px;
        font-size: 16px;
    }

    .counter__btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }

    .basket-item__price {
        font-size: 15px;
    }

    .basket-item__total {
        font-size: 18px; /* Итог карточки выделяем, но не перебарщиваем */
    }

    /* Форма заказа */
    .form-dark {
        padding: 20px 15px; /* Минимальные отступы в темном блоке */
    }

    .order-form__title {
        font-size: 22px;
        line-height: 26px;
    }

    .form-input {
        font-size: 15px;
        padding: 12px 0;
        margin-bottom: 20px;
    }

    .btn-submit {
        font-size: 16px;
        height: 56px; /* Кнопка пониже, чтобы не занимать весь экран */
    }

    .summary-value {
        font-size: 22px; /* Общий итог в самом низу */
    }
}