/* style.css - Оптимизирован для мобильных устройств */
:root {
    --primary-color: #FF6B35;
    --primary-dark: #E55A2B;
    --secondary-color: #2D3047;
    --accent-color: #FFD166;
    --light-color: #F8F9FA;
    --dark-color: #212529;
    --gray-color: #6C757D;
    --light-gray: #E9ECEF;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --box-shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark-color);
    background-color: #fafafa;
    line-height: 1.5;
    padding-bottom: 20px;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

/* Компактная Hero секция */
.hero-section {
    padding: 15px 0 20px;
    border-bottom: 1px solid var(--light-gray);
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
    margin-bottom: 15px;
}

.hero-title small {
    font-weight: 400;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 10px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    min-height: 120px;
}

.info-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.info-icon i {
    font-size: 1.2rem;
    color: white;
}

.info-text h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.info-text p {
    color: var(--gray-color);
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.3;
}

.info-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
}

.info-text a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Фиксирующаяся навигация */
.categories-nav {
    background: white;
    padding: 0;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.categories-nav.sticky {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.categories-scroll {
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

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

.category-list {
    display: flex;
    gap: 8px;
    padding: 0 5px;
    min-width: min-content;
}

.category-btn {
    padding: 10px 16px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 50px;
    color: var(--gray-color);
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.category-btn:hover {
    color: var(--primary-color);
    background-color: rgba(255, 107, 53, 0.05);
    border-color: rgba(255, 107, 53, 0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.category-btn i {
    font-size: 0.9rem;
}

/* Меню */
.menu-section {
    padding: 15px 0 20px;
}

.menu-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-gray);
}

.menu-title span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* СЕТКА ВСЕГДА 2 КОЛОНКИ ДЛЯ МОБИЛЬНЫХ */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Карточка блюда - оптимизирована для мобильных */
.menu-item {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.menu-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-lg);
}

.menu-item-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 150px;
}

.menu-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.menu-item:hover .menu-item-img {
    transform: scale(1.05);
}

.menu-item-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-color);
    color: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

.menu-item-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.menu-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 15px;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.menu-item-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Найдите и обновите стили для .add-to-cart-btn в style.css: */

.add-to-cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.add-to-cart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.add-to-cart-btn.added {
    background: linear-gradient(135deg, var(--secondary-color), #3a3d5c);
}

/* Убираем псевдоэлемент ::after и меняем иконку через content */
.add-to-cart-btn.added i::before {
    content: "\f00c" !important; /* Font Awesome check icon */
}

/* Для кнопки в модальном окне деталей: */
.add-to-cart-btn-lg {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.add-to-cart-btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.add-to-cart-btn-lg.added {
    background: linear-gradient(135deg, var(--secondary-color), #3a3d5c);
}

.add-to-cart-btn-lg.added i::before {
    content: "\f00c" !important;
}

/* Альтернативный вариант - без цифры, просто цветной индикатор */
.quantity-indicator-alt {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary-color);
    color: white;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    font-size: 0;
    border: 2px solid white;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Плавающая корзина */
.floating-cart-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.floating-cart-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.floating-cart-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.floating-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.floating-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.floating-cart-btn:hover::before {
    left: 100%;
}

.cart-badge {
    background: white;
    color: var(--primary-color);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.cart-price {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-left: 5px;
}

.cart-text {
    font-size: 0.95rem;
}

/* Кнопка "Наверх" */
.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(45, 48, 71, 0.3);
    z-index: 998;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: #3a3d5c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 48, 71, 0.4);
}

/* Full screen bottom modals */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translateY(100%);
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

#cartModal .modal-dialog,
#itemModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85vh;
}

#cartModal .modal-content,
#itemModal .modal-content {
    height: 100%;
    border-radius: 20px 20px 0 0;
    border: none;
    overflow: hidden;
}

/* Модальное окно корзины */
.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom: none;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.modal-title {
    font-weight: 600;
    font-size: 1.2rem;
    color: white;
}

.modal-body {
    padding: 0;
    height: calc(100% - 70px);
    overflow-y: auto;
}

.cart-content {
    padding: 20px;
    min-height: 100%;
}

.empty-cart {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.empty-cart-icon {
    width: 70px;
    height: 70px;
    background: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-cart-icon i {
    font-size: 1.8rem;
    color: var(--gray-color);
}

.empty-cart h6 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* ОБНОВЛЕННЫЙ ДИЗАЙН ЭЛЕМЕНТОВ КОРЗИНЫ */
.cart-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--light-gray);
    gap: 15px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.cart-item-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 10px;
    word-break: break-word;
}

.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.3rem;
    white-space: nowrap;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--light-gray);
    background: white;
    color: var(--gray-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    flex-shrink: 0;
}

.quantity-btn:hover {
    background: var(--light-gray);
    color: var(--secondary-color);
}

.cart-item-quantity {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-item-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.cart-summary {
    padding: 0 20px 20px;
    position: sticky;
    bottom: 0;
    background: white;
}

.cart-summary .alert {
    font-size: 0.85rem;
    padding: 10px;
    margin: 0;
}

/* Модальное окно деталей блюда */
.item-details {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.item-details-img {
    width: 100%;
    height: 40vh;
    object-fit: cover;
    flex-shrink: 0;
}

.item-details-content {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.item-details-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.item-details-description {
    color: var(--gray-color);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.item-details-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.item-details-footer {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding: 20px 0;
}

.add-to-cart-btn-lg {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.add-to-cart-btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.add-to-cart-btn-lg.added {
    background: linear-gradient(135deg, var(--secondary-color), #3a3d5c);
}

.add-to-cart-btn-lg .quantity-indicator {
    position: static !important;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
    font-size: 0.8rem;
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .category-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .menu-grid {
        gap: 10px;
    }
    
    .menu-item-img-wrapper {
        height: 130px;
    }
    
    .menu-item-content {
        padding: 12px;
    }
    
    .menu-item-title {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .menu-item-price {
        font-size: 1.1rem;
    }
    
    .add-to-cart-btn {
        width: 36px;
        height: 36px;
    }
    
    .floating-cart-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .scroll-top-btn {
        width: 40px;
        height: 40px;
        bottom: 15px;
        left: 15px;
    }
    
    .cart-item-img {
        width: 70px;
        height: 70px;
    }
    
    .item-details-img {
        height: 35vh;
    }
    
    .cart-item-price {
        font-size: 1.1rem;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
    }
}

/* Портретная ориентация */
@media (orientation: portrait) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Альбомная ориентация */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        padding: 10px 0 15px;
    }
    
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .info-item {
        padding: 10px 8px;
        min-height: 100px;
    }
    
    .menu-section {
        padding: 15px 0;
    }
    
    .menu-grid {
        gap: 10px;
    }
    
    .menu-item-img-wrapper {
        height: 120px;
    }
    
    #cartModal .modal-dialog,
    #itemModal .modal-dialog {
        height: 90vh;
    }
}

.menu-grid > .col-12 {
    grid-column: 1 / -1;
    width: 100%;
}