/* Основные стили */
.container-products {
      max-width: 800px;
      margin: 0 auto;
      padding: 0 1.25rem;
      margin-top: 5rem;
}

.container-products h1 {
      font-size: 2rem;
      text-align: center;
      color: #333;
      margin-bottom: 2.5rem;
}

h2 {
      font-size: 1.5rem;
      color: white;
      border-bottom: 1px solid var(--border-color);
      padding-bottom: 0.5rem;
      margin-bottom: 1.5rem;
}

/* Стили разделов */
.basket-sections {
      display: flex;
      flex-direction: column;
      gap: 2rem;
      margin-bottom: 3rem;
}

.basket-section {
      background-color: rgba(106, 111, 76, 0.5);
      border: 1px solid var(--border-color);
      padding: 1.8rem;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      width: 100%;
      backdrop-filter: blur(100px); /* Эффект матового стекла */
      border-radius: 9px; /* Небольшое скругление углов для лучшего эффекта */
}

.basket-section.free {
      border-top: 4px solid var(--light-olive);
}

.basket-section.paid {
      border-top: 4px solid var(--light-olive);
}

/* Стили списка товаров */
.product-list {
      list-style: none;
      margin-bottom: 2rem;
}

.product-item {
      padding: 1rem 1.5rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-radius: 12px;
      margin-bottom: 0.5rem;
      border: 1px solid rgba(255, 255, 255, 0.18);
      box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
      transition: all 0.3s ease;
}

.product-item:hover {
      background: rgba(255, 255, 255, 0.25);
      box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
}

.product-name {
      font-weight: 500;
      flex-grow: 1;
      color: white;
}

.product-price {
      color: white;
      margin-left: 1rem;
      white-space: nowrap;
}

/* Стили кнопок */
.remove-btn {
      background: none;
      border: none;
      color: white; /* Серо-голубой*/
      cursor: pointer;
      margin-left: 1rem;
      font-size: 0.9rem;
      transition: color 0.3s;
      margin-right: 1rem;
      box-shadow: 3px 5px 20px 0 rgba(118, 128, 93, 1);
      border-radius: 0.5rem;
      padding: 1em 1em;
}

.remove-btn:hover {
      color: var(--organic);
}

.btn {
      padding: 0.8rem 1.5rem;
      font-family: 'Playfair Display SC', serif;
      font-size: 1rem;
      cursor: pointer;
      transition: all 0.3s;
      border: none;
}

.btn-outline {
      background: transparent;
      border: 1px solid #DDC5A9;
      color: #333;
}

.btn-outline:hover {
      background-color: #f0f0f0;
}

.btn-primary {
      background-color: var(--organic); /* Основные кнопки */
      box-shadow: 3px 5px 20px 0 rgba(118, 128, 93, 1);
      color: white;
      text-decoration: none;
      border-radius: 0.5rem;
}

.btn-primary:hover {
       box-shadow: 0 2px var(--olive-green); /* Тень снизу при наведении */
       transform: translateY(-5px); /* Подъем вверх на 5 пикселей */
}

.btn-primary:active {
        transform: translateY(0);   /* Возвращает положение назад */
        box-shadow: none;           /* Убирает тень */
}

/* Дополнительные элементы */
.empty-basket {
      text-align: center;
      padding: 3rem 0;
      color: #666;
      font-style: italic;
}

.additional-links {
      display: flex;
      justify-content: center;
      gap: 2rem;
      margin-top: 3rem;
      flex-wrap: wrap;
}

.additional-links a {
      color: #333;
      text-decoration: none;
      transition: color 0.3s;
}

.additional-links a:hover {
      color: #EA631B;
}

/* Модальное окно */
.modal {
      display: none;
      position: fixed;
      z-index: 1000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
      background-color: #fff;
      margin: 10% auto;
      padding: 2rem;
      border: 1px solid var(--border-color);
      width: 80%;
      max-width: 600px;
      position: relative;
      border-radius: 8px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close {
      position: absolute;
      top: 1rem;
      right: 1rem;
      font-size: 1.5rem;
      font-weight: bold;
      color: #aaa;
      cursor: pointer;
}

.close:hover {
      color: #EA631B;
}

#modalProductName {
      color: #333;
      margin-bottom: 1rem;
}

#modalProductDescription {
      line-height: 1.6;
}

/* Мобильная версия (до 700px) */
@media (max-width: 700px) {
      .product-item {
            flex-direction: column;
            align-items: flex-start;
            gap: 1rem;
            padding: 1rem 0;
      }

      .product-name {
            width: 100%;
            margin-bottom: 0;
            margin-left: 1rem;
      }

      .product-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            width: 100%;
            padding: 0 1rem;
      }

      .remove-btn,
      .btn-primary {
            margin: 0;
            flex: 1;
            min-width: max-content;
            text-align: center;
      }

      .basket-section.paid .product-item {
            flex-direction: row;
            flex-wrap: wrap;
      }

      .basket-section.paid .product-name {
            width: 100%;
      }

      .basket-section.paid .product-price {
            margin-right: auto;
      }
}

/* Стили для корзины в стиле гуманистического минимализма */
.basket-section.cart {
    border-top: 2px solid var(--olive-green);
    background-color: rgba(237, 225, 210, 0.8);
    margin-top: 2rem;
    border-radius: 8px;
}

.cart-item {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    margin-bottom: 0.8rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--olive-green);
}

.cart-item-name {
    font-weight: 500;
    flex-grow: 1;
    color: white;
    font-size: 1rem;
    line-height: 1.4;
}

.cart-item-price {
    color: var(--accent-brown);
    margin: 0 1.2rem;
    white-space: nowrap;
    font-weight: 500;
    font-size: 1rem;
}

.remove-from-cart-btn {
    background: transparent;
    color: var(--text-color-light);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.remove-from-cart-btn:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    background: rgba(204, 124, 114, 0.05);
}

.remove-from-cart-btn:active {
    background: rgba(204, 124, 114, 0.1);
}

.total-price {
    text-align: right;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--accent-brown);
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

#purchase-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 1rem;
    font-size: 1.1rem;
    background: var(--olive-green);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#purchase-btn:hover {
    background: var(--organic);
    transform: translateY(-1px);
}

#purchase-btn:active {
    transform: translateY(0);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 700px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 1rem;
    }

    .cart-item-name {
        width: 100%;
        margin-bottom: 0.3rem;
    }

    .cart-item-price {
        margin: 0;
        margin-right: auto;
        order: -1;
    }

    .remove-from-cart-btn {
        align-self: flex-end;
        margin-top: 0.5rem;
    }

    .total-price {
        text-align: center;
        font-size: 1.1rem;
        margin: 1.2rem 0;
    }

    #purchase-btn {
        padding: 0.9rem;
        font-size: 1rem;
    }
}

/* Стиль для пустой корзины */
#empty-cart {
    color: var(--text-color-light);
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

/* Минимальные анимации */
@keyframes subtleFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-item {
    animation: subtleFadeIn 0.3s ease-out;
}

/* Фокус-состояния для доступности */
.remove-from-cart-btn:focus,
#purchase-btn:focus {
    outline: 2px solid var(--olive-green);
    outline-offset: 2px;
}

/* Состояние disabled */
#purchase-btn:disabled {
    background: var(--text-color-lighter);
    cursor: not-allowed;
    transform: none;
}

#purchase-btn:disabled:hover {
    background: var(--text-color-lighter);
    transform: none;
}


/* Стили для корзины в стиле гуманистического минимализма */
.basket-section.cart {
    border-top: 2px solid var(--organic);
    background-color: rgba(237, 225, 210, 0.5);
    margin-top: 3rem;
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(106, 111, 76, 0.1);
    box-shadow: 0 8px 32px rgba(106, 111, 76, 0.05);
}

.basket-section.cart h2 {
    color: var(--organic);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: 'Playfair Display SC', serif;
    letter-spacing: 0.5px;
}

.cart-item {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(106, 111, 76, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(106, 111, 76, 0.05);
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--organic);
    box-shadow: 0 4px 12px rgba(106, 111, 76, 0.1);
    transform: translateY(-1px);
}

.cart-item-name {
    font-weight: 500;
    flex-grow: 1;
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
}

.cart-item-price {
    color: var(--accent-brown);
    margin: 0 1.5rem;
    white-space: nowrap;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
}

.remove-from-cart-btn {
    background: transparent;
    color: var(--text-color-light);
    border: 1px solid rgba(106, 111, 76, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.remove-from-cart-btn:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    background: rgba(204, 124, 114, 0.05);
}

.remove-from-cart-btn:active {
    background: rgba(204, 124, 114, 0.1);
    transform: translateY(1px);
}

.total-price {
    text-align: center;
    font-weight: 500;
    color: var(--organic);
    margin: 2rem 0 1.5rem;
    padding: 1.3rem 0;
    border-top: 1px solid rgba(106, 111, 76, 0.2);
    font-family: 'Playfair Display SC', serif;
}

#total-amount {
    color: var(--accent-brown);
    font-weight: 600;
}

#purchase-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 1.2rem;
    font-size: 1.2rem;
    background: var(--organic);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#purchase-btn:hover {
    background: var(--olive-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 111, 76, 0.2);
}

#purchase-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(106, 111, 76, 0.1);
}

/* Стиль для пустой корзины */
#empty-cart {
    color: var(--text-color-light);
    font-style: italic;
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px dashed rgba(106, 111, 76, 0.3);
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
}

/* Минимальные анимации */
@keyframes subtleFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: subtleFadeIn 0.4s ease-out;
}

/* Фокус-состояния для доступности */
.remove-from-cart-btn:focus,
#purchase-btn:focus {
    outline: 2px solid var(--organic);
    outline-offset: 3px;
}

/* Состояние disabled */
#purchase-btn:disabled {
    background: var(--text-color-lighter);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#purchase-btn:disabled:hover {
    background: var(--text-color-lighter);
    transform: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 700px) {
    .basket-section.cart {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.2rem;
    }

    .cart-item-name {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }

    .cart-item-price {
        margin: 0;
        margin-right: auto;
        order: -1;
        font-size: 1rem;
    }

    .remove-from-cart-btn {
        align-self: stretch;
        margin-top: 0.5rem;
        text-align: center;
    }

    .total-price {
        font-size: 1.1rem;
        margin: 1.5rem 0;
        padding: 1rem 0;
    }

    #purchase-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Микро-интеракции */
.cart-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.remove-from-cart-btn {
    transition: all 0.2s ease;
}

#purchase-btn {
    transition: all 0.2s ease;
}

/* Эффект при добавлении товара */
@keyframes itemAdded {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.cart-item:last-child {
    animation: itemAdded 0.3s ease-out;
}