/* Общие стили для сайта */
* {
    margin: 0;
    padding: 0;
}

/* Подключаем шрифты*/
@font-face {
    font-family: 'Gilroy';
    src: url("../fonts/Gilroy-Semibold.ttf");
}

@font-face {
    font-family: 'Merriweather';
    src: url("../fonts/Merriweather-Black.ttf");
}

/*По умолчанию цвет, шрифт и фон */
body {
    background-color: #191411;
    font-family: 'Gilroy', 'san-serif';
    color: white;
}

.container {
    /* 1240, а не 1200: при border-box отступы по 20px вычитаются из max-width,
       поэтому при 1200 контентная область сузилась бы до 1160 и весь
       десктопный макет сместился бы. При 1240 контентная область остаётся
       ровно 1200. */
    max-width: 1240px;
    margin: 0 auto;
    padding-inline: 20px;
    box-sizing: border-box;
}

.button {
    border-radius: 8px;
    background: var(--unnamed, linear-gradient(135deg, #DA8023 0%, #E2B438 100%));
    width: 260px;
    max-width: 100%;
    height: 62px;
    padding: 20px;
    box-sizing: border-box;
    /*  центруем */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 0;
    /*убираем границу */
    cursor: pointer;
    /*убирем состояние фокуса - подсветку*/
    outline: none;
    /*стили для текста */
    font-size: 18px;
    color: #191411;
}

.button:hover {
    background: var(--unnamed, linear-gradient(135deg, #ac6115 0%, #9e7a19 100%));
}

.common-title {
    font-family: 'Merriweather', 'san-serif';
    font-size: clamp(28px, 5.5vw, 64px);
    /* было 80px — фиксированный line-height не переживает уменьшающийся
       font-size */
    line-height: 1.25;
    letter-spacing: 1.92px;
    text-transform: uppercase;
    text-align: center;
}

.main {
    overflow: hidden;
    background-image: url("../images/main_bg.png");
    background-position: top center;
    background-repeat: no-repeat;
}

.header {
    padding: 40px 0;
}

.header .container {
    display: flex;
    align-items: center;
}

.logo img {
    vertical-align: bottom;
    /*убрать лишний отступ снизу по умолчанию */
}

.menu {
    /* Не auto: у .currency уже есть margin-left: auto, и два авто-отступа
       поделили бы свободное место между собой, что сдвинуло бы меню на 21px
       влево на десктопе. 16vw достигает 191px при любой ширине окна ≥1194,
       поэтому на десктопе ничего не меняется, а в диапазоне 900-1240, где
       строке приходится сжиматься, значение уменьшается. */
    margin-left: clamp(24px, 16vw, 191px);
}

.menu-list {
    list-style: none;
    display: flex;

}

.menu-item {
    padding-right: clamp(24px, 7.1vw, 88px);
}

.menu-item a {
    font-size: 18px;
    color: #fff;
    /* убрать синий цвет по умолчанию для ссылок */
    text-decoration: none;
    /* убрать подчеркивание */
    cursor: pointer;
    /*рука, чтобы была понятно, при наведении, можно нажать */
}

/* подчеркивание при наведении, но только на ссылку, а не на элемент ссылки */
.menu-item a:hover {
    border-bottom: 2px solid white;
}

.currency {
    border-radius: 5px;
    border: 1px solid #FFF;
    width: 45px;
    height: 45px;
    padding: 6px;
    box-sizing: border-box;
    /* чтобы padding входил в уже установленные размеры*/
    cursor: pointer;
    text-align: center;
    line-height: 32px;
    margin-left: auto;
    /* примкнул к краю контейнера */
    user-select: none;
    /* автоматически не выделялся текст при кликании на элемент*/
}

.main-content {
    padding-top: 103px;
    padding-bottom: 199px;
}

.main-content .container {
    position: relative;
}

.main-info {
    max-width: 608px;
}

.main-small-info {
    border-radius: 100px;
    background: var(--d-3320-f, #D3320F);
    padding: 12px 16px;
    /*отображались padding */
    display: inline-block;
    /*стили для внутреннего текста */
    font-size: 18px;
}

.main-title {
    font-family: 'Merriweather', 'san-serif';
    font-size: clamp(40px, 9.7vw, 120px);
    font-weight: 900;
    line-height: 130%;
    letter-spacing: 3.6px;
    text-transform: uppercase;
    margin-bottom: 56px;
}

.main-text {
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.2;
    margin-bottom: 56px;
}

.main-image {
    position: absolute;
    /* поднять вверх, искусственно */
    top: -123px;
    left: calc(100% - 991px);
}

.why {
    background-image: url("../images/whybg.png");
    background-position: top center;
    /*картинка будет в оригинальном виде */
    background-size: initial;
    background-repeat: no-repeat;
    padding-bottom: 180px;
}

.why-items {
    margin-top: 60px;
    display: grid;
    gap: clamp(32px, 8.1vw, 100px);
    /* Ограничено 312px, а не 1fr: при 1fr три колонки растянулись бы до 333px
       в контентной области 1200px, и десктопный макет сместился бы. */
    grid-template-columns: repeat(auto-fit, minmax(260px, 312px));
    justify-content: center;
}

.why-item {
    /* чтоб все элементы были по центру*/
    text-align: center;
}

.why-item-title {
    font-size: 24px;
    line-height: 29px;
    padding: 24px 0;
    /* так как есть gap, то отступы не задаем */
}

.why-item-text {
    font-size: 16px;
    line-height: 140%;

}

.products {
    background-image: url("../images/burgers_bg.png");
    background-position: top center;
    background-size: 1400px;
    background-repeat: no-repeat;
    padding-bottom: 180px;

}

.products-items {
    display: grid;
    /* В контентной области 1200px это даёт ровно те 384px, на которые
       карточки были жёстко заданы раньше. Четырём колонкам понадобилось бы
       1272px, поэтому их остаётся три. min(300px, 100%) сохраняет нижний
       порог 300px на десктопе и при этом позволяет единственной колонке
       сжаться на самых узких телефонах (320px), где 300px плюс отступы
       контейнера иначе привели бы к переполнению. */
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 24px;
    margin-top: 60px;
}

.products-item {
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #353535;
    background: #211A16;
}

.products-item-image {
    height: 250px;
}

/* именно для картинки, а не группы */
.products-item-image img {
    max-width: 100%;
}

.products-item-title {
    font-size: 24px;
    line-height: 29px;
    padding: 24px 0;
}

.products-item-text {
    font-size: 16px;
    line-height: 140%;
    padding-bottom: 24px;
}

.products-item-extra {
    display: flex;
    justify-content: space-between;
    /* Без брейкпоинта: строка переносится сама, когда цена и кнопка
       перестают помещаться. */
    flex-wrap: wrap;
    gap: 16px;
}

.products-item-price {
    font-size: 32px;
    line-height: 39px;
    margin-bottom: 8px;

}

.products-item-weight {
    font-size: 16px;
    line-height: 18px;
    color: #757575
}

.button.product-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 19px clamp(16px, 5vw, 50px);
    width: 182px;
    max-width: 100%;
    height: 62px;
}

.button.product-button span:first-child {
    margin-right: 10px;
}

.order {
    background-image: url("../images/order-bg.png");
    background-position: top center;
    background-repeat: no-repeat;
    padding-bottom: 180px;
    overflow: hidden;
}

.order .container {
    position: relative;
}

.order-image {
    position: absolute;
    top: 0;
    right: calc(100% - 764px);
    z-index: -1;
}

.order-form {
    border-radius: 16px;
    border: 1px solid #353535;
    background: #211A16;
    max-width: 426px;
    /*  ширина 424, добавляем 2 на границы
    высоту не надо, содержимое само устанавливает*/
    margin-top: 60px;
    box-sizing: border-box;
    padding: 60px 40px;
    /* Карточка не прижата к правому краю: при 674px в контейнере 1200px
       остаётся отступ 100px. Один margin-left сдвинул бы её на 100px правее,
       чем она стоит сейчас, поэтому отступ задан явно. Ниже 900px оба
       значения становятся auto. */
    margin-left: auto;
    margin-right: 100px;
}

.order-form-text {
    font-size: 24px;
    line-height: 29px;
    text-align: center;
}

.order-form-inputs {
    display: flex;
    flex-direction: column;
    margin-top: 40px;
}

.order-form-input {
    background: linear-gradient(95.61deg, #DA8023 0%, #E2B438 100%);
    width: 100%;
    height: 62px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-form-input input {
    padding: 20px 10px;
    background: #211A16;
    border-radius: 8px;
    /* Не 100%: у родителя ширина 344px с градиентным фоном, и те 1px, что
       видны с каждой стороны — это градиентная рамка поля. Инпут на всю
       ширину перекрыл бы её, потому что background-clip здесь border-box, и
       прозрачная рамка показывает собственный фон этого элемента, а не фон
       родителя. */
    width: calc(100% - 2px);
    height: 59px;
    box-sizing: border-box;
    outline: none;
    border: 1px solid transparent;
    color: white;
}

.order-form-inputs .button {
    width: 100%;
    height: 62px;

}

footer {
    padding: 60px 0;
}

footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.right {
    font-size: 16px;
    line-height: 20px;
}

.burger {
    /* Скрыт на десктопе; включается в блоке 900px. */
    display: none;
    width: 45px;
    height: 45px;
    padding: 10px;
    box-sizing: border-box;
    margin-left: auto;
    background: transparent;
    border: 1px solid #FFF;
    border-radius: 5px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}

.burger-line {
    display: block;
    height: 2px;
    width: 100%;
    background: #FFF;
}

/* ── Ниже 900px шапка и хиро перестраиваются, а не просто сжимаются ── */
@media (max-width: 900px) {
    /* Обе декоративные картинки с бургерами позиционированы absolute
       относительно макета 1200px. Ниже этой ширины они становятся частью
       потока и масштабируются вместе с колонкой, поэтому еда остаётся
       видимой на телефоне, а не обрезается. У order-image был z-index: -1
       только для десктопного наложения на форму; на static-элемент z-index
       не действует, поэтому сбрасывать его отдельно не нужно. */
    .main-image,
    .order-image {
        position: static;
        max-width: 100%;
        height: auto;
    }

    .order-form {
        margin-left: auto;
        margin-right: auto;
    }

    .burger {
        display: flex;
        order: 2;
    }

    .currency {
        order: 3;
        margin-left: 16px;
    }

    .header .container {
        flex-wrap: wrap;
    }

    .menu {
        /* Панель на всю ширину под строкой шапки. order: 4 переносит её на
           вторую flex-строку, под логотип, бургер и валюту. */
        order: 4;
        display: none;
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
    }

    .menu.is-open {
        display: block;
    }

    .menu-list {
        flex-direction: column;
        gap: 20px;
    }

    .menu-item {
        padding-right: 0;
    }
}

/* ── Ниже 560px вертикальные отступы уменьшаются ── */
@media (max-width: 560px) {
    .why,
    .products,
    .order {
        padding-bottom: 80px;
    }

    .main-content {
        padding-top: 48px;
        padding-bottom: 96px;
    }

    .order-form {
        padding: 40px 24px;
    }
}
