/* General styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    overflow-x: hidden; /* Prevent horizontal scroll */
    padding-bottom: 70px; /* Чтобы контент не перекрывался кнопкой */
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

/* Modal container */
.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1001;
    width: 90%; /* Responsive width */
    max-width: 1200px; /* Set max width of modal */
    height: auto;
    max-height: 90%; /* Set max height of modal */
    overflow-y: auto; /* Add scroll if content is too long */
}

/* Form styles */
.form-container {
    max-width: 600px;
    margin: auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group select {
    width: 95%;
    padding: 10px;
    font-size: 1em;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.button {
    display: block;
    width: 95%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    font-size: 1.1em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}

.button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 0;
    padding: 0;
    margin-top: 20px;
}

/* Product item */
.product-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    max-width: 100%; /* Ensure items do not exceed container width */
}

.product-item img {
    width: 50%;
    height: auto;
}

.product-item h2 {
    font-size: 1em;
}

.product-item p {
    font-size: 0.5em;
}

/* Quantity controls */
.quantity-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px; /* Чтобы высота не прыгала при смене состояния */
}

/* Add button */
.add-button {
    background: #d4b310;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
}

.quantity-decrease, .quantity-increase {
    background: #d4b310;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.quantity-decrease {
    background: #dc3545;
}

/* Out of stock */
.out-of-stock {
    color: #999;
    font-style: italic;
    padding: 10px 20px;
    text-align: center;
    border: 1px dashed #ccc;
    border-radius: 4px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Buttons */
.view-order-button {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 9999;
    background: #28a745;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.submit-button {
    background-color: #FF8C00;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.3s, transform 0.2s ease-in-out;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.submit-button:hover {
    background-color: #FFA500;
    transform: scale(1.03);
}

.submit-button:active {
    transform: scale(0.97);
}

/* Order summary */
.order-summary {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    text-align: left;
}

.order-summary h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.order-items {
    list-style-type: none;
    padding: 0;
}

.order-items li {
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
}

.order-total {
    font-weight: bold;
}