
@font-face {
    font-family: 'Red Hat Text';
    src: url('assets/fonts/static/RedHatText-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Red Hat Text';
    src: url('assets/fonts/static/RedHatText-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Red Hat Text';
    src: url('assets/fonts/static/RedHatText-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Red Hat Text', sans-serif;
    background-color: #fcf8f3;
    padding: 40px 50px;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* Левая часть (десерты) */
.products-section {
    flex: 3;
}

.products-section h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 700;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image-wrapper {
    position: relative;
}

.product-img {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    object-fit: cover;
}

.product-img.in-cart {
    box-shadow: 0 0 0 2px hsl(14, 86%, 42%);
    border-radius: 10px;
}

.add-to-cart {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 75px); /* чтобы не вылезала за края */
    z-index: 2;
    margin-top: 15px;
    background: white;
    border: 1px solid hsl(14, 27%, 47%);
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;

}

.add-to-cart img {
    vertical-align: middle;
    margin-right: 10px;
}

.add-to-cart:hover {
    border-color: hsl(14, 86%, 42%);
    color: hsl(14, 86%, 42%);
}

.product-control {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 75px); /* чтобы не вылезала за края */
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    padding: 8px 16px;
    border-radius: 25px;
    background: hsl(14, 86%, 42%);
    font-weight: 500;
}

.decrease-qty,
.increase-qty {
    color: white;
    background: hsl(14, 86%, 42%);
    border: solid white 1px;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.decrease-qty:hover,
.increase-qty:hover {
    background: hsl(14, 83%, 33%);
}

.item-qty {
    font-weight: bold;
    color: white;
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.product-info {
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
}

.product-category {
    font-size: 0.85rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-name {
    font-size: clamp(16px, 0.90rem, 20px);
    font-weight: 600;
    margin: 8px 0;
}

.product-price {
    color: hsl(14, 86%, 42%);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Правая часть (корзина) */
.cart-section {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
}

.cart-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: hsl(14, 86%, 42%);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cart-item-title {
    font-weight: 600;
}

.cart-item-details {
    display: flex;
    gap: 5px;
    font-size: 0.85rem;
    color: #8b8181;
}

.cart-item-quantity {
    color: hsl(14, 86%, 42%);
    font-weight: bold;
    padding-right: 5px;
}

.cart-item-price {
    color: #242424;
    font-weight: 600;
}

.remove-item {
    background: none;
    border: none;  
    cursor: pointer;
    color: #999;
    padding: 0 5px;
}

.icon-remove {
    border: 1.5px solid #d19f9f;
    border-radius: 50%;
    width: 13px;
}

.remove-item:hover .icon-remove {
    filter: brightness(0.5);
}

.cart-footer {
    display: block;
}

.cart-footer.hidden-footer {
    display: none;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.cart-notification {
    background-color: #fcf8f3;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.90rem;
}

.icon-carbon {
    width: 20px;
    margin-right: 5px;
}

.confirm-btn {
    width: 100%;
    background: hsl(14, 86%, 42%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-btn:hover {
    background: hsl(14, 83%, 33%);
}

.icon-empty {
    display: block;
    margin: 40px auto 0 auto;
    width: 80px;
    height: auto;
}

.empty-cart-message {
    text-align: center;
    color: #999;
    padding: 30px 0;
}

/* Модальное окно */
.modal-hidden {
    display: none;
}

.modal-show {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: start;
    gap: 10px;
    max-height: 90vh;
    overflow-y: auto;
}

.icon-confirm {
    width: 3rem;
    padding-bottom: 10px;
}

.modal-content h2 {
    font-size: 2rem;
}

.modal-content p {
    padding-bottom: 20px;
}

.modal-list {
    background-color: #fcf8f3;
    border-radius: 8px;
    display: grid;
    grid-auto-rows: 1fr;
    justify-items: stretch; /* растянуть содержимое по горизонтали */
}

.modal-item {
    display: grid;
    grid-template-columns: auto 1fr auto;  /* 3 колонки */
    grid-template-rows: auto auto;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.modal-item-img {
    grid-row: span 2;  /* занимает обе строки */
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 8px;
}

.modal-item-name {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    font-weight: bold;
    font-size: small;
    text-align: start;
    padding: 0 10px 0 10px;
}

.modal-item-info {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    display: flex;
    flex-direction: row;
    text-align: left;
    font-size: 0.85rem;
    gap: 10px;
}

.modal-item-quantity{
    color: hsl(14, 86%, 42%);
    font-weight: bold;
    padding: 0 10px;
}

.modal-item-price {
    color: #8b8181;
}

.modal-item-total {
    grid-row: span 2;
    font-weight: bold;
}

.modal-total {
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.modal-total p {
    font-weight: 400;
    padding: 0;
    align-self: center;
    font-size: 1.1rem;
}

.modal-total strong {
    align-self: center;
    font-size: 1.5rem;
}

.modal-close {
    font-size: 1rem;
    width: 100%;
    background: hsl(14, 86%, 42%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

footer {
  padding: 20px 0 0 0;
}

.attribution { font-size: 0.6875rem; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }


@media (max-width: 1000px) {
    .products-section {
        flex: 2;
    }
}

@media (max-width: 700px) {
    .container {
        flex-direction: column;
    }

    .cart-section {
        position: static;
        width: 100%;
        order: 2;
    }

    .products-section {
        order: 1;
        width: 100%;
        flex: none;
    }

    /* Модалка на мобильных — внизу*/
    .modal-show {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        margin: 0;
        padding: 20px;
    }

    /* Карточки не приклеиваются к левому краю */
    .products-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: center;
}

    .product-card {
    margin: 0 auto;
    width: 100%;
    }

}

