/* Стили для страницы доставки */
.delivery-page {
    background-color: #ede6db;
    min-height: 100vh;
}

/* Hero секция */
.delivery-hero {
    background-image: url(../images/header__bg.jpg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding: 60px 0 100px;
    position: relative;
    margin-bottom: 60px;
}

.delivery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.delivery-hero .conteiner {
    position: relative;
    z-index: 1;
}

.delivery-hero-title {
    font-family: var(--font-display);
    font-size: 64px;
    text-align: center;
    color: #ffd500;
    margin-bottom: 20px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.delivery-hero-desc {
    text-align: center;
    color: #f5f5f5;
    font-size: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Кнопка назад */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 213, 0, 0.3);
    border-radius: 50px;
    color: #ffd500;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-button:hover {
    background: rgba(255, 213, 0, 0.9);
    color: #3e3125;
    transform: translateX(-3px);
}

/* Основной контейнер */
.delivery-container {
    max-width: 1400px;
    margin: 0 auto 80px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
}

/* Секция с блюдами (переиспользуем стили из banquet.css) */
.section-title {
    font-size: 32px;
    color: #3e3125;
    margin-bottom: 10px;
}

.section-desc {
    color: #666;
    margin-bottom: 30px;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.category-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid #3e3125;
    border-radius: 40px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    color: #3e3125;
}

.category-btn:hover,
.category-btn.active {
    background: #ffd500;
    border-color: #ffd500;
    color: #3e3125;
}

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

.dish-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: 0.3s;
}

.dish-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dish-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
}

.dish-info {
    padding: 16px;
}

.dish-name {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #3e3125;
}

.dish-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.dish-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dish-price {
    font-size: 20px;
    font-weight: 600;
    color: #ffd500;
}

.dish-price small {
    font-size: 11px;
    font-weight: normal;
    color: #999;
}

.add-to-cart-btn {
    background: #ffd500;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: 0.3s;
}

.add-to-cart-btn:hover {
    background: #e6c200;
    transform: scale(1.05);
}

/* Корзина и форма — на широком экране форма прокручивается отдельно от меню */
.order-section {
    position: sticky;
    top: 20px;
    height: fit-content;
}

@media (min-width: 1025px) {
    .delivery-container {
        align-items: start;
    }

    .dishes-section {
        min-width: 0;
    }

    .order-section {
        top: 80px;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .order-section .cart-container {
        flex-shrink: 0;
        margin-bottom: 16px;
    }

    .order-section .cart-items {
        max-height: 160px;
    }

    .order-section .order-form-container {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

.cart-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.cart-title {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffd500;
}

.cart-items {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
}

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

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

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
}

.cart-item-price {
    font-size: 12px;
    color: #ffd500;
}

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

.cart-item-qty {
    width: 30px;
    text-align: center;
    font-size: 14px;
}

.cart-item-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}

.cart-item-btn:hover {
    background: #ffd500;
}

.cart-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #ff4444;
    padding: 0 5px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid #eee;
    font-size: 18px;
    font-weight: 600;
}

.total-price {
    color: #ffd500;
    font-size: 24px;
}

/* Форма заказа */
.order-form-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-title {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffd500;
}

.delivery-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #3e3125;
}

.form-input,
.form-textarea {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    transition: 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #ffd500;
    box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.1);
}

.submit-btn {
    background: #ffd500;
    border: none;
    padding: 14px;
    border-radius: 40px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #e6c200;
    transform: scale(1.02);
}

/* Информационные блоки */
.delivery-info {
    margin-top: 10px;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9f6f0;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.info-icon {
    font-size: 16px;
}

/* Модальное окно */
.success-modal {
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 20px;
    background: white;
    animation: fadeIn 0.3s ease;
}

.success-container {
    padding: 40px;
    text-align: center;
    min-width: 320px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.success-container h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #3e3125;
}

.success-container p {
    color: #666;
    margin-bottom: 25px;
}

.success-btn {
    background: #ffd500;
    border: none;
    padding: 10px 30px;
    border-radius: 40px;
    font-family: inherit;
    cursor: pointer;
    font-size: 16px;
}

.success-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптив */
@media (max-width: 1024px) {
    .delivery-container {
        grid-template-columns: 1fr;
    }

    .order-section {
        position: static;
        height: auto;
        max-height: none;
        display: block;
        overflow: visible;
    }

    .order-section .order-form-container {
        overflow: visible;
        min-height: auto;
    }

    .order-section .cart-items {
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    .delivery-hero-title {
        font-size: 40px;
    }
    
    .delivery-hero-desc {
        font-size: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .back-button span {
        display: none;
    }
    
    .back-button {
        padding: 8px 12px;
    }
    
    .categories {
        gap: 8px;
    }
    
    .category-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .delivery-hero-title {
        font-size: clamp(26px, 8vw, 32px);
    }

    .delivery-container {
        padding: 0 12px;
    }
    
    .dishes-grid {
        grid-template-columns: 1fr;
    }
}