/* ============================================================
   MENU MOBILE RESPONSIVE - Centralized Mobile Styles
   Loaded after style.css to override mobile layout
   ============================================================ */

/* ====================
   MOBILE BREAKPOINT (<=991px)
   ==================== */
@media (max-width: 991px) {

    /* --- ROW GRID: Stack columns vertically --- */
    .row-grid {
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* --- LEFT SIDEBAR: Sticky category toggle bar --- */
    .left-sidebar {
        position: sticky !important;
        top: 58px !important;
        z-index: 100 !important;
        width: 100% !important;
        background: #fff !important;
        padding: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        height: auto !important;
        min-height: unset !important;
        max-height: none !important;
        overflow: visible !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid #eee !important;
        transition: none !important;
    }

    .left-sidebar.sidebar-sticky {
        position: sticky !important;
        top: 58px !important;
        left: auto !important;
        padding-top: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }

    /* Hide category search on mobile */
    .left-sidebar .heading-list {
        display: none !important;
    }

    /* Hide scroll container and its contents on mobile */
    .scroll-custom.nav-list {
        padding: 0 !important;
        overflow: visible !important;
    }

    .scroll-container {
        display: none !important;
    }

    .scroll-btn,
    .scroll-custom .scroll-btn,
    .nav-list .scroll-btn,
    button.scroll-btn {
        display: none !important;
    }

    /* Hide original scroll list entirely */
    .scroll-list {
        display: none !important;
    }

    /* Hide subcategory bar (no longer needed) */
    .mobile-subcategory-bar {
        display: none !important;
    }

    .nav-list.category_list {
        display: none !important;
    }

    /* ===== CATEGORY TOGGLE BUTTON ===== */
    .cat-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        background: linear-gradient(135deg, #fafbfc 0%, #f4f5f7 100%);
        border: none;
        border-bottom: 1px solid #e8e8e8;
        cursor: pointer;
        gap: 10px;
    }

    .cat-toggle-left {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
    }

    .cat-toggle-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        background: var(--color-default);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    }

    .cat-toggle-label {
        font-size: 16px;
        font-weight: 700;
        color: #1a1a1a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: 0.2px;
    }

    .cat-toggle-arrow {
        font-size: 14px;
        color: #999;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }

    .cat-toggle-btn.open {
        background: #fff;
    }

    .cat-toggle-btn.open .cat-toggle-arrow {
        transform: rotate(180deg);
        color: var(--color-default);
    }

    /* ===== CATEGORY DROPDOWN PANEL ===== */
    .cat-dropdown-panel {
        display: none;
        background: #fff;
        max-height: 60vh;
        overflow-y: auto;
        border-bottom: 2px solid var(--color-default);
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
        -webkit-overflow-scrolling: touch;
    }

    .cat-dropdown-panel.open {
        display: block;
    }

    .cat-dropdown-panel::-webkit-scrollbar {
        width: 3px;
    }

    .cat-dropdown-panel::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

    /* Search inside dropdown */
    .cat-drop-search {
        padding: 10px 14px;
        background: #f5f6f8;
        border-bottom: 1px solid #e8e8e8;
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .cat-drop-search-icon {
        color: #999;
        font-size: 14px;
        flex-shrink: 0;
    }

    .cat-drop-search-input {
        width: 100%;
        border: 1.5px solid #e0e2e6;
        border-radius: 10px;
        padding: 9px 14px;
        font-size: 14px;
        font-weight: 500;
        color: #333;
        background: #fff;
        outline: none;
        transition: border-color 0.2s ease;
    }

    .cat-drop-search-input::placeholder {
        color: #aaa;
        font-weight: 400;
    }

    .cat-drop-search-input:focus {
        border-color: var(--color-default);
        box-shadow: 0 0 0 3px rgba(240, 44, 0, 0.08);
    }

    /* Category list in dropdown */
    .cat-dropdown-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    /* --- Level 0: Top-level categories --- */
    .cat-drop-item {
        border-bottom: 1px solid #f0f0f0;
    }

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

    .cat-drop-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        font-size: 17px;
        font-weight: 700;
        color: #1a1a1a;
        text-decoration: none;
        cursor: pointer;
        transition: all 0.15s ease;
        letter-spacing: 0.3px;
        text-transform: capitalize;
    }

    .cat-drop-link:hover {
        background: #f5f7fa;
    }

    .cat-drop-link.selected {
        color: var(--color-default);
        background: linear-gradient(90deg, rgba(240,44,0,0.06) 0%, rgba(240,44,0,0.02) 100%);
        border-left: 3px solid var(--color-default);
        padding-left: 13px;
    }

    .cat-drop-link .cat-arrow {
        font-size: 11px;
        color: #ccc;
        transition: transform 0.3s ease;
        margin-left: 8px;
        flex-shrink: 0;
    }

    .cat-drop-item.expanded > .cat-drop-link .cat-arrow {
        transform: rotate(90deg);
        color: var(--color-default);
    }

    /* --- Level 1: Sub-categories --- */
    .cat-drop-children {
        display: none;
        list-style: none;
        padding: 0;
        margin: 0;
        background: #f8f9fb;
        border-top: 1px solid #eef0f2;
    }

    .cat-drop-item.expanded > .cat-drop-children {
        display: block;
    }

    .cat-drop-children .cat-drop-item {
        border-bottom: 1px solid #eef0f2;
    }

    .cat-drop-children .cat-drop-link {
        padding: 12px 16px 12px 24px;
        font-size: 15px;
        font-weight: 600;
        color: #444;
        text-transform: none;
        letter-spacing: 0.1px;
    }

    .cat-drop-children .cat-drop-link::before {
        content: '';
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #d0d5dd;
        margin-right: 10px;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }

    .cat-drop-children .cat-drop-link:hover::before {
        background: #999;
    }

    .cat-drop-children .cat-drop-link.selected {
        color: var(--color-default);
        background: linear-gradient(90deg, rgba(240,44,0,0.05) 0%, transparent 100%);
        border-left: 3px solid var(--color-default);
        padding-left: 21px;
    }

    .cat-drop-children .cat-drop-link.selected::before {
        background: var(--color-default);
        box-shadow: 0 0 0 2px rgba(240,44,0,0.15);
    }

    /* --- Level 2+: Sub-sub-categories --- */
    .cat-drop-children .cat-drop-children {
        background: #f2f3f6;
        border-top: 1px solid #e8eaed;
    }

    .cat-drop-children .cat-drop-children .cat-drop-item {
        border-bottom: 1px solid #e8eaed;
    }

    .cat-drop-children .cat-drop-children .cat-drop-link {
        padding-left: 44px;
        font-size: 14px;
        font-weight: 500;
        color: #666;
    }

    .cat-drop-children .cat-drop-children .cat-drop-link::before {
        width: 5px;
        height: 5px;
        background: #d8d8d8;
        border-radius: 2px;
    }

    .cat-drop-children .cat-drop-children .cat-drop-link.selected {
        color: var(--color-default);
        background: linear-gradient(90deg, rgba(240,44,0,0.04) 0%, transparent 100%);
        border-left: 3px solid var(--color-default);
        padding-left: 41px;
    }

    .cat-drop-children .cat-drop-children .cat-drop-link.selected::before {
        background: var(--color-default);
    }

    /* --- Level 3+: Even deeper nesting --- */
    .cat-drop-children .cat-drop-children .cat-drop-children {
        background: #eeeff2;
    }

    .cat-drop-children .cat-drop-children .cat-drop-children .cat-drop-link {
        padding-left: 62px;
        font-size: 13px;
        font-weight: 500;
        color: #777;
    }

    .cat-drop-children .cat-drop-children .cat-drop-children .cat-drop-link::before {
        width: 4px;
        height: 4px;
    }

    /* ===== OVERLAY behind dropdown ===== */
    .cat-dropdown-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99;
        backdrop-filter: blur(1px);
    }

    .cat-dropdown-overlay.open {
        display: block;
    }

    /* --- STARTERS CONTAINER: Full width product area --- */
    .starters-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 10px 0 !important;
        height: auto !important;
        min-height: unset !important;
        overflow-y: visible !important;
        margin-bottom: 90px !important;
        flex-basis: 100% !important;
    }

    /* Search & view toggle header */
    .heading-list-header {
        flex-wrap: wrap !important;
        padding: 8px !important;
        border-radius: 8px !important;
        gap: 8px !important;
    }

    .search-product {
        min-width: 100% !important;
    }

    .search-input {
        font-size: 13px !important;
        padding: 8px 14px !important;
    }

    /* Hide view toggle on mobile - default to grid */
    .view-toggle-row {
        display: none !important;
    }

    /* --- PRODUCT GRID: 2-column on mobile --- */
    .product_list .starters-content {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .product_list .starters-content-inner {
        width: 48% !important;
        flex: 0 0 48% !important;
    }

    .product_list .starters-content-inner .content-inner-box {
        flex-direction: column !important;
    }

    .product_list .starters-content-inner .content-inner-box .col-header-img {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 0 !important;
    }

    .product_list .starters-content-inner .content-inner-box .col-header-img img {
        width: 100% !important;
        height: 140px !important;
        object-fit: cover !important;
        border-radius: 8px 8px 0 0 !important;
    }

    .col-header .col-header-inner {
        padding: 8px !important;
    }

    .col-header .col-header-inner h5 {
        font-size: 13px !important;
        margin-bottom: 2px !important;
    }

    .col-header .col-header-inner h6 {
        font-size: 13px !important;
        color: var(--color-default) !important;
    }

    .col-header .col-header-inner p {
        font-size: 11px !important;
        -webkit-line-clamp: 2 !important;
        margin-bottom: 4px !important;
    }

    .header-bottom-content {
        height: auto !important;
    }

    .header-bottom-content img,
    .allerg-bottom-content img,
    .starters-content-inner .header-bottom-content img,
    .starters-content-inner .allerg-bottom-content img {
        width: 14px !important;
        height: 14px !important;
        object-fit: contain !important;
        border-radius: 0 !important;
        display: inline !important;
    }

    .allerg-bottom-content {
        height: auto !important;
    }

    .btn-plus {
        padding: 6px 10px !important;
        font-size: 12px !important;
        width: 100% !important;
    }

    /* Category section titles */
    .title-h2 {
        font-size: 1.1rem !important;
        padding: 8px 12px !important;
    }

    .sub-cat-title {
        font-size: 0.9rem !important;
        padding: 4px 12px !important;
    }

    .subsub-cat-title {
        font-size: 0.82rem !important;
        padding: 3px 10px !important;
    }

    .subcategory-block {
        margin-top: 10px !important;
    }

    .subsubcategory-block {
        margin-left: 6px !important;
        padding-left: 6px !important;
    }

    /* --- RIGHT SIDEBAR: Hidden on mobile (replaced by FAB) --- */
    .right-sidebar.right-sidebar-mob-hide {
        display: none !important;
    }

    /* --- OLD MOBILE SIDEBAR: Hidden (replaced by bottom sheet) --- */
    .sidebar-mob {
        display: none !important;
    }

    /* --- FLOATING CART BAR (FAB) --- */
    .mobile-cart-fab {
        position: fixed;
        bottom: 68px;
        left: 12px;
        right: 12px;
        z-index: 1050;
        background: var(--color-default);
        color: #fff;
        border-radius: 14px;
        padding: 12px 16px;
        display: none;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
        cursor: pointer;
        transition: transform 0.2s ease;
        gap: 10px;
    }

    .mobile-cart-fab:active {
        transform: scale(0.97);
    }

    .mobile-cart-fab .cart-fab-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-cart-fab .cart-fab-count {
        background: #fff;
        color: var(--color-default);
        border-radius: 8px;
        padding: 2px 10px;
        font-weight: 700;
        font-size: 14px;
        min-width: 28px;
        text-align: center;
    }

    .mobile-cart-fab .cart-fab-text {
        font-weight: 600;
        font-size: 14px;
    }

    .mobile-cart-fab .cart-fab-total {
        font-weight: 700;
        font-size: 15px;
        white-space: nowrap;
    }

    /* --- CART BOTTOM SHEET --- */
    .cart-sheet-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1060;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .cart-sheet-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .cart-bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1070;
        background: #fff;
        border-radius: 20px 20px 0 0;
        max-height: 82vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        padding: 0 0 env(safe-area-inset-bottom, 0);
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    }

    .cart-bottom-sheet.active {
        transform: translateY(0);
    }

    .cart-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px 12px;
        border-bottom: 1px solid #f0f0f0;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
        border-radius: 20px 20px 0 0;
    }

    .cart-sheet-handle {
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }

    .cart-sheet-title {
        font-size: 16px;
        font-weight: 700;
        color: #222;
        margin: 0;
    }

    .cart-sheet-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: #f1f3f5;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #666;
        transition: background 0.2s;
    }

    .cart-sheet-close:hover {
        background: #e0e0e0;
    }

    .cart-sheet-body {
        padding: 12px 16px 20px;
    }

    .cart-sheet-body .feature-box-content {
        padding: 10px 0;
        border-bottom: 1px solid #f5f5f5;
    }

    .cart-sheet-body .feature-box-inner {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    .cart-sheet-body .row-sub {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #eee;
    }

    .cart-sheet-body .row-total {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
    }

    .cart-sheet-body .row-total h4 {
        font-size: 13px;
        font-weight: 500;
        color: #555;
    }

    .cart-sheet-body .row-total:last-child h4,
    .cart-sheet-body .row-total:last-child p {
        font-weight: 700;
        color: #222;
        font-size: 15px;
    }

    .cart-sheet-footer {
        padding: 12px 16px 16px;
        border-top: 1px solid #f0f0f0;
        background: #fff;
        position: sticky;
        bottom: 0;
    }

    .cart-sheet-footer .btn {
        width: 100%;
        padding: 12px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 15px;
        margin-bottom: 8px;
    }

    .cart-sheet-footer .btn:last-child {
        margin-bottom: 0;
    }

    /* --- BOTTOM NAV CART BADGE --- */
    .bottom-nav-badge {
        position: absolute;
        top: -4px;
        right: 50%;
        transform: translateX(12px);
        background: var(--color-default);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 9px;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        line-height: 1;
    }

    .bottom-nav-badge.show {
        display: flex;
    }
}

/* ====================
   SMALL MOBILE (<=576px)
   ==================== */
@media (max-width: 576px) {
    .product_list .starters-content-inner {
        width: 47.5% !important;
        flex: 0 0 47.5% !important;
    }

    .product_list .starters-content-inner .content-inner-box .col-header-img img {
        height: 120px !important;
    }

    .col-header .col-header-inner h5 {
        font-size: 12px !important;
    }

    .col-header .col-header-inner h6 {
        font-size: 12px !important;
    }

    .btn-plus {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }

    .mobile-cart-fab {
        bottom: 64px;
        left: 8px;
        right: 8px;
        padding: 10px 14px;
        border-radius: 12px;
    }

    .mobile-cart-fab .cart-fab-text {
        font-size: 13px;
    }

    .mobile-cart-fab .cart-fab-total {
        font-size: 14px;
    }
}

/* ====================
   VERY SMALL MOBILE (<=375px)
   ==================== */
@media (max-width: 375px) {
    .product_list .starters-content-inner .content-inner-box .col-header-img img {
        height: 100px !important;
    }

    .col-header .col-header-inner {
        padding: 6px !important;
    }

    .col-header .col-header-inner h5,
    .col-header .col-header-inner h6 {
        font-size: 11px !important;
    }

    .cat-drop-link {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
}

/* ====================
   SERVE TYPE MODAL RESPONSIVE
   ==================== */
@media (max-width: 576px) {
    .modal-custom-serve-typ .row-custom {
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding: 0 8px !important;
        justify-content: center !important;
    }

    .modal-custom-serve-typ .clear.clear-mobile {
        width: 8px !important;
    }

    .modal-custom-serve-typ .label-service-box {
        min-width: 90px !important;
        padding: 12px 6px !important;
        flex: 1;
    }

    .modal-custom-serve-typ .service-icon svg {
        width: 40px !important;
        height: 40px !important;
    }

    .modal-custom-serve-typ .title-services {
        font-size: 11px !important;
    }

    .modal-custom-serve-typ .title-services b {
        font-size: 11px !important;
    }
}

/* ====================
   DESKTOP: Hide mobile-only elements
   ==================== */
@media (min-width: 992px) {
    .mobile-cart-fab,
    .cart-sheet-overlay,
    .cart-bottom-sheet,
    .mobile-subcategory-bar,
    .bottom-nav-badge,
    .cat-toggle-btn,
    .cat-dropdown-panel,
    .cat-dropdown-overlay {
        display: none !important;
    }
}
