/* Asosiy stil */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative;
    padding-bottom: 80px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #4cca11;
}

header img {
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
}

.menu-categories {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.menu-categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 10px 15px;
    border: none;
    background-color: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    transition: all 0.3s;
}

.category-btn.active {
    background-color: #8B0000;
    color: white;
}

.menu-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.menu-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    background-color: white;
    cursor: pointer;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.menu-item-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.menu-item-info {
    padding: 15px;
}

.menu-item h3 {
    margin: 0 0 5px;
    font-size: 1.1rem;
    color: #333;
}

.menu-item-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.price {
    font-weight: bold;
    color: #8B0000;
    font-size: 1.1rem;
}

.add-to-cart {
    background-color: #8B0000;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.add-to-cart:hover {
    background-color: #6d0000;
}

/* Korzinka tugmasi */
.cart-button-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

#view-cart-btn {
    background-color: #8B0000;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s;
}

#view-cart-btn:hover {
    transform: scale(1.1);
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff5722;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

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

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

/* Mahsulot modali */
.product-modal-content {
    max-width: 600px;
    padding: 0;
    overflow: hidden;
}

.product-modal-image-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.product-modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-info {
    padding: 20px;
}

.product-modal-info h2 {
    margin-top: 0;
    color: #8B0000;
    font-size: 1.5rem;
}

.product-modal-info p {
    color: #666;
    margin-bottom: 20px;
}

.product-modal-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background-color: #f5f5f5;
}

#product-quantity {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.product-modal-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #8B0000;
    margin-left: auto;
}

#add-to-cart-from-modal {
    background-color: #8B0000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}

#add-to-cart-from-modal:hover {
    background-color: #6d0000;
}

.back-to-menu {
    background-color: #f0f0f0;
    color: #333;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background-color 0.3s;
}

.back-to-menu:hover {
    background-color: #e0e0e0;
}

/* Korzinka modali */
#cart-modal .modal-content h2 {
    margin-top: 0;
    color: #8B0000;
}

.order-items {
    max-height: 50vh;
    overflow-y: auto;
    margin: 15px 0;
    padding-right: 10px;
}

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

.order-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-item-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.order-item-controls button:hover {
    background-color: #f5f5f5;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #eee;
}

#modal-submit-order {
    background-color: #8B0000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 20px;
    width: 100%;
    transition: background-color 0.3s;
}

#modal-submit-order:hover {
    background-color: #6d0000;
}

#modal-submit-order:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Muvaffaqiyatli modal */
#success-modal .modal-content {
    text-align: center;
}

#success-modal h2 {
    color: #4cca11;
}

/* Responsive */
@media (max-width: 600px) {
    .menu-items-container {
        grid-template-columns: 1fr;
    }
    
    .app-container {
        padding: 15px;
        padding-bottom: 80px;
    }
    
    .category-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .product-modal-image-container {
        height: 200px;
    }
    
    .product-modal-info h2 {
        font-size: 1.3rem;
    }
}