/* =============================================
MERGED MEDIA QUERIES
Breakpoints: 480px | 767px | 768px-1024px | 991px | 1025px-1399px | 1025px+ | 2560px+
============================================= */

/* ------------------------------------------
max-width: 480px (Extra Small / Mobile)
------------------------------------------ */
@media (max-width: 480px) {

    /* Stat cards */
    .stat-card {
        padding: 20px;
        min-width: 250px;
        max-width: 250px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }

    /* Layout grids */
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 1fr;
    }

    .order-status-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 1fr;
    }

    .statistics-overview {
        grid-template-columns: 1fr;
    }

    .stat-overview-item {
        flex-direction: column;
        text-align: center;
    }

    .profile-link-card {
        flex-wrap: wrap;
        gap: 15px;
        margin-top: 20px;
    }

    /* Navbar */
    .navbar-nav>li>a {
        padding: 5px 8px !important;
    }

    .main-header .sidebar-toggle {
        width: 38px !important;
        height: 38px !important;
        margin-right: 5px !important;
    }

    .navbar-nav>.user-menu .hidden-xs {
        display: none;
    }

    .main-header .logo .mini-logo img {
        max-height: 35px;
    }

    .icofont-globe,
    .icofont-bell-alt {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.1rem !important;
    }

    /* POS */
    .content-wrapper.pos-page {
        margin-left: 0 !important;
        margin-top: 3rem;
    }

    .pos-pageArea .navbar.navbar-static-top,
    .pos-pageArea .sidebar-collapse .main-header .navbar {
        margin-left: 0 !important;
    }

    .sidebar-collapse .main-footer {
        margin-left: 0 !important;
    }

    .productareas.pos-thumb-view {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .productareas.pos-grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        margin-left: 1px;
    }

    .productareas.pos-grid-view .singleProduct {
        min-height: 170px;
    }

    /* Item list search */
    .itemListTable .card-header .right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .itemListTable #search_items {
        width: 100% !important;
    }

    /* Category grid */
    .preview-item-square {
        width: 42px;
        height: 42px;
    }

    .preview-item-name {
        font-size: 0.75rem;
    }
}

/* ------------------------------------------
max-width: 0px–479px (phones only — 1-col grid override)
------------------------------------------ */
@media (min-width: 0px) and (max-width: 479px) {
    .productareas.pos-thumb-view {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

/* ------------------------------------------
min-width: 481px and max-width: 767px (Small Mobile)
------------------------------------------ */
@media (min-width: 481px) and (max-width: 767px) {
    .productareas.pos-thumb-view {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .productareas.pos-grid-view {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ------------------------------------------
max-width: 767px (Mobile / Small)
------------------------------------------ */
@media (max-width: 767px) {

    /* Dashboard layout */
    .profile-header-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        flex-direction: row;
        gap: 10px;
    }

    .package-header {
        flex-direction: column;
        text-align: center;
    }

    .package-stats {
        flex-direction: column;
    }

    .package-info {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .order-details {
        width: 100%;
        justify-content: space-between;
    }

    .revenue-stats {
        flex-direction: column;
        gap: 15px;
    }

    .card-wrapper {
        overflow: hidden;
        height: 150px;
        overflow-x: auto;
        display: flex;
        flex-direction: row;
    }

    .order-status-grid {
        overflow-x: auto;
        height: 179px;
    }

    .profile-link-card.mb-5 {
        margin-top: 20px;
    }

    /* Utility */
    .xs-row-reverse {
        flex-direction: row-reverse;
    }

    .xs-column-reverse {
        flex-direction: column-reverse;
    }

    .xs-d-flex {
        display: flex;
    }

    /* Navbar & header */
    .userDashboard .content-wrapper,
    .adminDashboard .content-wrapper {
        margin-left: 0 !important;
    }

    .userDashboard .main-header,
    .adminDashboard .main-header {
        margin-left: 0 !important;
    }

    .navLink span {
        display: none !important;
    }

    .navbar-nav>li {
        padding: 0 2px !important;
    }

    .navbar-nav>li>a {
        padding: 8px 10px !important;
    }

    .sidebar-collapse .main-footer {
        margin-left: 0 !important;
    }

    /* POS */
    .content-wrapper.pos-page {
        margin-left: 0 !important;
        margin-top: 3rem;
    }

    .pos-pageArea .navbar.navbar-static-top,
    .pos-pageArea .sidebar-collapse .main-header .navbar {
        margin-left: 0 !important;
    }

    .pos-pageArea .shopLogo {
        display: none !important;
    }

    .posArea {
        flex-direction: column;
    }

    .posArea .col-md-4,
    .posArea .col-md-8,
    .posArea .col-sm-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100%;
        padding-left: 5px;
        padding-right: 5px;
    }

    .posArea .card {
        overflow: visible;
    }

    .posArea .card-content {
        overflow: visible;
    }

    .productareas {
        gap: 6px;
        overflow: visible;
    }

    .singleProduct {
        margin: 3px 2px 6px;
    }

    .productareas.pos-thumb-view {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .productareas.pos-thumb-view .singleProduct {
        margin: 0 !important;
    }

    .posViewToggleRow {
        margin-bottom: 6px;
    }

    .menuItemList ul {
        flex-wrap: wrap;
        gap: 5px;
    }

    .menuItemList ul li a {
        padding: 5px 10px;
        font-size: 12px;
    }

    .cartActionArea ul li a {
        padding: 8px 8px;
        font-size: 11px;
    }

    .cartActionArea ul li a i {
        font-size: 14px;
    }

    .cartActionArea ul li a span:last-child {
        font-size: 9px;
    }

    .itemSearch.custom-fields {
        margin-bottom: 8px;
    }

    .posArea .card-header {
        flex-wrap: wrap;
    }

    .categoryList.posheader {
        flex-direction: column;
        gap: 5px;
    }

    .posCatList {
        flex-wrap: wrap;
        gap: 4px;
    }

    .menu-card {
        min-height: auto;
    }

    .cartFooter .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Category grid */
    .cat-items-preview {
        padding: 15px;
        gap: 15px;
    }

    .preview-item-square {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }

    .preview-item-name {
        font-size: 0.8rem;
    }

    /* Footer */
    .main-footer {
        margin-left: 0 !important;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .shortMenu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .card-header.border-none.flex_between {
        flex-direction: column;
    }

    .itemListTable .card-header .right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .itemListTable #search_items {
        width: 100% !important;
    }

    /* Order & Reservation Dashboard Responsiveness */
    .reservation-card-grid {
        grid-template-columns: 1fr !important;
    }

    .filter-grid {
        grid-template-columns: 1fr !important;
    }

    .reservation-dashboard-wrapper .right-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .reservation-dashboard-wrapper .right-actions .btn {
        margin-right: 0 !important;
    }

    .reservation-header-modern {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
        border-radius: 12px;
    }

    .reservation-header-modern .left {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 5px;
        display: flex;
        align-items: center;
    }

    .reservation-header-modern .right-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .reservation-header-modern .right-actions .btn {
        flex: 1 1 calc(50% - 8px);
        margin: 0 !important;
        text-align: center;
        justify-content: center;
        padding: 12px 10px;
        font-size: 13px;
    }

    /* Info Box Scroll on Mobile */
    .info-box-row {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        padding-bottom: 10px !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 20px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        gap: 15px !important;
    }

    .info-box-row [class*="col-"] {
        flex: 0 0 280px !important;
        max-width: 280px !important;
        padding: 0 !important;
    }

    .info-box-row::-webkit-scrollbar {
        height: 4px;
    }

    .info-box-row::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 10px;
    }

    /* Modern Table on Mobile */
    .modern-table-list thead {
        display: none;
    }

    .modern-table-list tbody tr {
        display: block;
        margin-bottom: 20px;
        border-radius: 12px !important;
    }

    .modern-table-list tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        text-align: left;
    }

    .modern-table-list tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        display: block;
        color: var(--color-light);
        margin-right: 15px;
    }

    .modern-table-list .uid-modern,
    .modern-table-list .customer-info-list,
    .modern-table-list .order-type-info,
    .modern-table-list .order-summary-list,
    .modern-table-list .status-cell-inline {
        text-align: right;
        display: block;
    }

    .modern-table-list .avatar-sm {
        display: none !important;
    }
}

/*----------------------------------------------
 end 320px small devices 
----------------------------------------------*/


/* ------------------------------------------
max-width: 991px (Tablet — Navbar)
------------------------------------------ */
@media (max-width: 991px) {

    .main-header {
        height: auto !important;
        position: relative !important;
        display: block !important;
        background: #fff !important;
        width: 100% !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
    }

    .theme-dark .main-header {
        background: #1a202c !important;
    }

    .main-header .logo {
        width: 100% !important;
        clear: both;
        display: flex !important;
        align-items: center;
        justify-content: center;
        height: 60px !important;
        border-bottom: 1px solid var(--border-color, #f1f1f1) !important;
        background: transparent !important;
        float: none !important;
    }

    .main-header .navbar {
        margin-left: 0 !important;
        padding: 0 10px;
        min-height: 60px;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        float: none !important;
        position: relative !important;
        border: none !important;
        background: transparent !important;
    }

    .rightMenuBar {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0;
    }

    .navbar-custom-menu {
        margin-left: auto !important;
        display: flex !important;
        align-items: center !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        max-width: 65%;
    }

    .navbar-custom-menu .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar-custom-menu .navbar-nav>li {
        flex-shrink: 0;
        display: flex !important;
        align-items: center !important;
    }

    .table-ajax-notification,
    .ajax-notification,
    .notifications-menu {
        display: flex !important;
        align-items: center !important;
        position: relative !important;
        float: none !important;
    }

    .main-sidebar {
        padding-top: 120px !important;
    }

    .main-footer {
        margin-left: 0 !important;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .shortMenu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ------------------------------------------
min-width: 768px and max-width: 1024px (Tablet Landscape)
------------------------------------------ */
@media (min-width: 768px) and (max-width: 1024px) {
    .posArea .col-md-4 {
        max-width: 35%;
        flex: 0 0 35%;
    }

    .posArea .col-md-8 {
        max-width: 65%;
        flex: 0 0 65%;
    }

    .productareas {
        gap: 6px;
    }

    .singleProduct {
        margin: 3px 4px 6px;
    }

    .posViewToggleRow {
        margin-bottom: 6px;
    }

    .productareas.pos-thumb-view {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .productareas.pos-thumb-view .singleProduct {
        padding: 8px !important;
    }

    .productareas.pos-grid-view {
        grid-template-columns: repeat(3, 1fr) !important;
        margin-left: 2px;
    }

    .productareas.pos-grid-view .singleProduct {
        min-height: 155px;
    }

    /* Order & Reservation Dashboard Responsiveness */
    .reservation-card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ------------------------------------------
min-width: 1025px and max-width: 1399px (Laptop)
------------------------------------------ */
@media (min-width: 1025px) and (max-width: 1399px) {
    .productareas.pos-thumb-view {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* ------------------------------------------
min-width: 1025px (Desktop+)
------------------------------------------ */
@media (min-width: 1025px) {
    .productareas.pos-grid-view {
        grid-template-columns: repeat(6, 1fr) !important;
        margin-left: 1px;
    }

    .productareas.pos-grid-view .singleProduct {
        min-height: 170px;
    }

    .productareas.pos-thumb-view {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* ------------------------------------------
min-width: 1200px (Large Desktop)
------------------------------------------ */
@media (min-width: 1200px) {
    .preview-item-square {
        width: 45px;
        height: 45px;
    }
}

/* ------------------------------------------
min-width: 2560px (Ultra Wide)
------------------------------------------ */
@media (min-width: 2560px) {
    .productareas.pos-grid-view {
        grid-template-columns: repeat(8, 1fr) !important;
        margin-left: 1px;
    }

    .productareas.pos-thumb-view {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    .categoryListArea .category-card-wrapper {
        width: 16.66666667% !important;
        float: left;
    }
}