/* Общий фон страницы, темная тема и блокировка горизонтального скролла */
.delivery-body {
    background-color: #2B2B2B !important;
    color: #ffffff;
    overflow-x: hidden !important;
}

/* Принудительный шрифт Gilroy для всего блока */
.delivery-nav-container,
.delivery-page-content,
.delivery-nav-container *,
.delivery-page-content * {
    font-family: 'Gilroy', sans-serif !important;
}

/* Контейнер навигации (100% ширины экрана без смещения и скролла) */
.delivery-nav-container {
    position: sticky;
    top: 98px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: #1F1F1F;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 99;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Обертка навигации */
.delivery-nav-slider {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-wrap: wrap; 
    overflow-x: visible;
    justify-content: flex-start;
    gap: 10px;
    padding: 20px 30px;
    box-sizing: border-box;
}

.delivery-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #333333;
    color: #cccccc;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.delivery-nav-item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.delivery-nav-item:hover {
    background: #444444;
    color: #ffffff;
}

/* Активный пункт меню */
.delivery-nav-item.active {
    background: #F8E604 !important;
    color: #2B2B2B !important;
}

/* Контент и сетка (ширина товаров 1200px) */
.delivery-page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

.delivery-category-section {
    margin-bottom: 50px;
    scroll-margin-top: 160px;
}

.delivery-category-heading {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ffffff;
    border-bottom: 2px solid #3d3d3d;
    padding-bottom: 10px;
}

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

/* Карточка товара */
.delivery-product-card {
    position: relative; 
    background: #464646;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    padding: 15px;
}

.delivery-product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.delivery-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    background: #333333;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    font-size: 14px;
}

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

.delivery-product-title {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-align: left;
}

.delivery-product-weight {
    font-size: 13px;
    color: #cccccc;
    font-weight: 500;
    text-align: left;
}

.delivery-product-desc {
    font-size: 16px;
    color: #dddddd;
    line-height: 1.4;
    text-align: left;
}

.delivery-product-footer {
    margin-top: auto; 
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-product-price {
    font-size: 18px;
    font-weight: 600;
    color: #F8E604;
    margin-left: auto;
}

.delivery-quantity-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
}

.delivery-qty-btn {
    background: #555555;
    border: none;
    border-radius: 4px !important;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #ffffff;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delivery-qty-btn:hover, .delivery-qty-btn:focus {
    background: #F8E604 !important;
    color: #2B2B2B !important;
}

.delivery-qty-input {
    width: 36px;
    height: 32px;
    border: 1px solid #555555;
    border-radius: 4px;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    font-family: 'Gilroy', sans-serif !important;
    padding: 0;
    -moz-appearance: textfield;
}

.delivery-qty-input::-webkit-outer-spin-button,
.delivery-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.delivery-product-btn {
    background: #F8E604 !important;
    color: #2B2B2B !important;
    border: none !important;
    padding: 10px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    text-decoration: none !important;
    transition: background 0.2s !important;
    box-shadow: none !important;
}

.delivery-product-btn:hover {
    background: #d8c603 !important;
}

.delivery-product-btn.added,
.delivery-product-btn:active {
    background: #c5b402 !important;
    color: #2B2B2B !important;
}

.delivery-product-card .added_to_cart {
    display: none !important;
}

.delivery-product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: red;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.delivery-price-qty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

/* ==========================================================
   АДАПТИВ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (экраны до 768px)
   ========================================================== */
@media (max-width: 768px) {
    .delivery-nav-slider {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x; /* <--- КРИТИЧЕСКИ ВАЖНО для скролла пальцем на мобилках */
        scrollbar-width: none;
        justify-content: flex-start !important;
    }

    .delivery-nav-slider::-webkit-scrollbar {
        display: none;
    }

    /* Возвращаем полноценный отступ (20px) по бокам для контента */
    .delivery-page-content {
        padding: 0 20px 30px 20px;
    }

    /* Товары на мобильных: ровно 2 карточки в ряд */
    .delivery-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .delivery-product-card {
        padding: 10px;
        gap: 8px;
    }

    .delivery-category-heading {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .delivery-product-title {
        font-size: 18px;
    }

    .delivery-product-weight,
    .delivery-product-desc {
        font-size: 14px;
    }

    .delivery-product-price {
        font-size: 14px;
        font-weight: 600;
    }

    .delivery-qty-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .delivery-qty-input {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .delivery-product-btn {
        padding: 8px 8px !important;
        font-size: 16px !important;
    }

    .delivery-product-badge {
        top: 8px;
        left: 8px;
        font-size: 12px;
        padding: 3px 6px;
    }
}

/* Обертка переключателя */
.delivery-page-switcher-wrapper {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    gap: 15px;
}

/* Красивая кнопка-вкладка */
.delivery-page-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: #222222;
    border: 1px solid #333333;
    border-radius: 10px 10px 0 0;
    color: #fff;
    text-decoration: none !important;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Gilroy', sans-serif !important;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Иконки внутри вкладок */
.delivery-page-tab svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    transition: stroke 0.25s ease;
    flex-shrink: 0;
}

/* Эффект при наведении */
.delivery-page-tab:hover {
    background: #2c2c2c;
    border-color: #444444;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Активная страница — премиальный желтый вид с мягким свечением */
.delivery-page-tab.active {
    background: #F8E604 !important;
    border-color: #F8E604 !important;
    color: #2B2B2B !important;
    box-shadow: 0 6px 25px rgba(248, 230, 4, 0.3);
    transform: translateY(-2px);
}

.delivery-page-tab.active svg {
    stroke: #2B2B2B !important;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .delivery-page-switcher-wrapper {
        padding-right: 20px !important;
        gap: 5px;
    }
    
    .delivery-page-tab {
        padding: 12px 10px;
        font-size: 18px;
        border-radius: 12px 12px 0 0;
    }

    .delivery-page-tab svg {
        width: 18px;
        height: 18px;
    }
}