/* ============================================
   PRODUCT MODAL - MOBILE ONLY (max-width: 768px)
   Dodo Pizza Style - Full Screen Modal with Swipe
   ============================================ */

@media (max-width: 768px) {
    
    /* ============================================
       MODAL CONTAINER - OVERLAY
       ============================================ */
    
    #customization-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9999;
        display: none;
        align-items: flex-end;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    #customization-modal.show {
        display: flex;
        opacity: 1;
    }
    
    /* ============================================
       MODAL CONTENT - FULL SCREEN SHEET
       ============================================ */
    
    #customization-modal .modal-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        background: #ffffff !important;
        will-change: transform;
    }
    
    #customization-modal.show .modal-content:not(.dragging) {
        transform: translateY(0) !important;
    }
    
    #customization-modal .modal-content.dragging {
        transition: none !important;
    }
    
    /* ============================================
       SWIPE INDICATOR (Handle)
       ============================================ */
    
    #customization-modal .modal-content::before {
        content: '';
        position: sticky;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: #D1D5DB;
        border-radius: 2px;
        z-index: 110;
        pointer-events: none;
        display: block;
        margin: 10px auto 6px;
        flex-shrink: 0;
    }
    
    /* ============================================
       SCROLL AREA
       ============================================ */
    
    #customization-modal .modal-scroll-area {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        min-height: 0 !important;
    }
    
    /* ============================================
       CLOSE BUTTON
       ============================================ */
    
    #customization-modal .close-button {
        position: absolute !important;
        top: 16px !important;
        right: 16px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 24px !important;
        line-height: 36px !important;
        text-align: center !important;
        cursor: pointer !important;
        color: #374151 !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border: none !important;
        border-radius: 50% !important;
        z-index: 120 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* ============================================
       IMAGE COLUMN - MOBILE
       ============================================ */
    
    #customization-modal .modal-image-col {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        padding: 10px !important;
        flex-shrink: 0 !important;
    }

    #customization-modal .modal-image-col img {
        width: auto !important;
        max-width: 90% !important;
        height: auto !important;
        max-height: 40vh !important;
        object-fit: contain !important;
        display: block !important;
    }
    
    /* ============================================
       DETAILS COLUMN
       ============================================ */
    
    #customization-modal .modal-details-col {
        display: block !important;
        padding: 0 16px 24px !important;
        overflow: visible !important;
    }
    
    /* ============================================
       HEADER
       ============================================ */
    
    #customization-modal .modal-header {
        position: relative !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 8px !important;
        padding: 0 !important;
    }
    
    #customization-modal .modal-header h3 {
        font-size: 20px !important;
        font-weight: 700 !important;
        margin: 0 !important;
        padding-right: 50px !important;
        line-height: 1.3 !important;
    }
    
    /* ============================================
       PRODUCT SUMMARY
       ============================================ */
    
    #customization-modal #product-summary {
        margin-bottom: 12px !important;
    }
    
    #customization-modal #product-summary > div {
        font-size: 14px !important;
        color: #6B7280 !important;
    }
    
    /* ============================================
       MODAL BODY
       ============================================ */
    
    #customization-modal .modal-body {
        flex: 1 1 auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #customization-modal .modal-body .description {
        font-size: 14px !important;
        color: #6B7280 !important;
        margin-bottom: 20px !important;
        line-height: 1.5 !important;
    }
    
    /* ============================================
       OPTIONS
       ============================================ */
    
    #customization-modal #options-container,
    #customization-modal #customization-form,
    #customization-modal form {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    #customization-modal .option-group {
        margin-bottom: 0 !important;
    }
    
    #customization-modal .option-group > label:first-child {
        font-weight: 600 !important;
        font-size: 15px !important;
        margin-bottom: 12px !important;
        display: block !important;
        color: #1F2937 !important;
    }
    
    #customization-modal .option-values-container {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    #customization-modal .option-label {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px 20px !important;
        border-radius: 24px !important;
        border: 2px solid #E5E7EB !important;
        background: #fff !important;
        font-weight: 500 !important;
        font-size: 15px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        min-height: 48px !important;
    }
    
    #customization-modal .option-radio {
        display: none !important;
    }
    
    #customization-modal .option-radio:checked + .option-label {
        background: linear-gradient(135deg, #C8102E 0%, #FF6B35 100%) !important;
        color: #fff !important;
        border-color: transparent !important;
    box-shadow: none;
    }
    
    #customization-modal .option-label.disabled {
        opacity: 0.4 !important;
        pointer-events: none !important;
    }
    
    /* ============================================
       FOOTER - FIXED AT BOTTOM
       ============================================ */
    
    #customization-modal .modal-footer {
        flex: 0 0 auto !important;
        position: relative !important;
        padding: 16px !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        margin: 0 !important;
        border-top: 1px solid #E5E7EB !important;
        background: #ffffff !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    #customization-modal .modal-footer button,
    #customization-modal .modal-footer .add-to-cart-btn,
    #customization-modal #add-to-cart-final {
        width: 100% !important;
        height: 56px !important;
        min-height: 56px !important;
        border-radius: 16px !important;
        background: linear-gradient(135deg, #C8102E 0%, #FF6B35 100%) !important;
        color: #ffffff !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        border: none !important;
        box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3) !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    #customization-modal .modal-footer button:disabled,
    #customization-modal #add-to-cart-final:disabled {
        background: #D1D5DB !important;
        box-shadow: none !important;
        color: #9CA3AF !important;
        cursor: not-allowed !important;
    }
    
    #customization-modal .modal-footer button:active:not(:disabled) {
        transform: scale(0.98) !important;
    }
    
    /* ============================================
       BODY SCROLL LOCK
       ============================================ */
    
    body.modal-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* ============================================
       DRAGGING STATE
       ============================================ */
    
    #customization-modal .modal-content.dragging {
        touch-action: none !important;
    }
    
    #customization-modal .modal-content.dragging .modal-scroll-area {
        overflow: hidden !important;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    #customization-modal,
    #customization-modal .modal-content {
        transition: none !important;
    }
}

/* ============================================
   SAFE AREA (iPhone X+)
   ============================================ */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        #customization-modal .modal-footer {
            padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
        }
    }
}

@media (max-width: 768px) {
    
    /* Контейнер навигации */
    .categories-nav,
    .categories-wrapper {
      position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    padding: 0;
    margin: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }
    
    /* Список категорий */
    .categories-list {
      display: flex;
    gap: 6px;
    padding: 6px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    }
    
    .categories-list::-webkit-scrollbar {
        display: none;
    }
    
    /* Элементы категорий - КОМПАКТНЫЕ */
    .categories-list a,
    .categories-list .category-item {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 10px;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        background: #F3F4F6;
        border-radius: 20px;
        text-decoration: none;
        white-space: nowrap;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        border: none;
        min-height: 36px;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Hover эффект */
    .categories-list a:hover {
        background: #FEE2E2;
        color: #C8102E;
    }
    
    /* Активная категория */
    .categories-list a.active {
        background: linear-gradient(135deg, #C8102E 0%, #FF6B35 100%);
        color: #ffffff;
        
    }
    
    /* Нажатие */
    .categories-list a:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Ещё меньше для маленьких экранов */
@media (max-width: 380px) {
    .categories-list a,
    .categories-list .category-item {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 32px;
        border-radius: 16px;
    }
    
    .categories-list {
        gap: 5px;
        padding: 0 10px;
    }
}








@media (max-width: 768px) {
    .category-bar-inner .logo-placeholder,
    .categories-list .logo-placeholder {
        display: none;
    }
  
  .cart-btn {
    box-shadow: none;
    margin-right: 15px;
  }
}

@media (max-width: 768px) {
    .sticky-categories,
    .category-menu.sticky-categories {
        padding: 4px 0 !important;
    }
    
  
  .sticky-categories .container, .sticky-categories .category-bar-inner {
  gap: 0px;
  
  }
  
  
    .sticky-categories .container,
    .sticky-categories .category-bar-inner {
        padding: 0px 0px !important;
    }
}

@media (max-width: 768px) {
    .cart-btn {
        position: relative;
    }
    
    .cart-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -40px;
        width: 40px;
        height: 100%;
        background: linear-gradient(to left, 
            rgba(255, 255, 255, 1) 0%, 
            rgba(255, 255, 255, 0) 100%
        );
        pointer-events: none;
    }
}


@media (max-width: 768px) { 

.category h3,
.menu-section h3,
.category-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
    padding: 14px 18px;
    background: #F9FAFB;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #F3F4F6;
}

.category h3::before,
.menu-section h3::before,
.category-title::before {
    content: '';
    width: 6px;
    height: 24px;
    background: linear-gradient(180deg, #C8102E, #FF6B35);
    border-radius: 3px;
    flex-shrink: 0;
}


  
  
}



.category h3::before,
.menu-section h3::before,
.category-title::before {
    content: '';
    width: 6px;
    height: 24px;
    background: linear-gradient(180deg, #C8102E, #FF6B35);
    border-radius: 3px;
    flex-shrink: 0;
}
