/* ==========================================================
   HƯƠNG VIỆT — Mobile Responsive Overrides
   ONLY mobile styles — does NOT modify Desktop layout
   ========================================================== */

/* ── MOBILE BURGER BUTTON (hidden on desktop) ── */
.mobile-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(0,0,0,.1));
    background: transparent;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}

.mobile-burger:hover {
    background: var(--accent, rgba(0,0,0,.05));
}

/* ── MOBILE DRAWER (hidden by default) ── */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    pointer-events: none;
}

.mobile-drawer.open {
    visibility: visible;
    pointer-events: auto;
}

.mobile-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background .3s ease;
}

.mobile-drawer.open .mobile-drawer-overlay {
    background: rgba(0, 0, 0, .5);
}

.mobile-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--card, #fff);
    box-shadow: -4px 0 24px rgba(0, 0, 0, .15);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-drawer.open .mobile-drawer-panel {
    transform: translateX(0);
}

/* Dark variant for landing page */
.mobile-drawer-panel--dark {
    background: #1a1814;
}

.mobile-drawer-panel--dark .mobile-drawer-link {
    color: #f0ebe3;
}

.mobile-drawer-panel--dark .mobile-drawer-link:hover,
.mobile-drawer-panel--dark .mobile-drawer-link.active {
    background: rgba(232, 160, 32, .12);
    color: #e8a020;
}

.mobile-drawer-panel--dark .mobile-drawer-divider {
    border-color: rgba(255, 255, 255, .08);
}

.mobile-drawer-panel--dark .mobile-drawer-cta {
    background: #e8a020;
    color: #000;
}

.mobile-drawer-panel--dark .mobile-drawer-cta:hover {
    background: #c07c0a;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, rgba(0,0,0,.1));
    flex-shrink: 0;
}

.mobile-drawer-header .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-drawer-header .nav-brand-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.mobile-drawer-header .nav-brand span {
    display: inline !important;
    font-size: 14px;
    font-weight: 600;
}

.mobile-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted-fg, #717182);
    transition: background .15s;
}

.mobile-drawer-close:hover {
    background: var(--accent, rgba(0,0,0,.05));
}

.mobile-drawer-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--primary, #030213);
    text-decoration: none;
    transition: all .15s;
}

.mobile-drawer-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.mobile-drawer-link:hover {
    background: var(--accent, #f3f3f5);
}

.mobile-drawer-link.active {
    background: var(--primary, #030213);
    color: var(--primary-fg, #fff);
}

.mobile-drawer-divider {
    height: 1px;
    background: var(--border, rgba(0,0,0,.1));
    margin: 8px 16px;
}

.mobile-drawer-cta {
    background: var(--primary, #030213);
    color: var(--primary-fg, #fff) !important;
    justify-content: center;
    margin-top: 4px;
    border-radius: 10px;
    font-weight: 600;
}

.mobile-drawer-cta:hover {
    opacity: .9;
}

/* =====================================================
   TABLET  (max-width: 768px)
   ===================================================== */
@media (max-width: 768px) {

    /* ── SHOW MOBILE BURGER ON MOBILE ── */
    .mobile-burger {
        display: flex;
    }

    /* ── LANDING PAGE — Navbar ── */
    .navbar {
        padding: 0 16px;
        height: 60px;
    }

    .navbar .nav-links,
    .navbar .nav-actions {
        display: none !important;
    }

    .navbar .nav-burger {
        display: flex;
    }

    .nav-logo-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .nav-logo-text {
        font-size: 13px;
    }

    .nav-logo-text span {
        font-size: 9px;
    }

    /* ── CUSTOMER / USER / PUBLIC — Navbar ── */
    .top-navbar .nav-inner {
        padding: 0 12px;
        height: 52px;
    }

    .top-navbar .nav-links {
        display: none !important;
    }

    /* ── LANDING — Hero Section ── */
    .hero-content {
        padding: 0 16px;
        padding-top: 72px;
        max-width: 100%;
    }

    .hero-label {
        font-size: 10px;
        padding: 4px 12px;
        margin-bottom: 16px;
    }

    .hero-desc {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .hero-cta {
        gap: 10px;
    }

    .hero-cta .btn-primary,
    .hero-cta .btn-outline {
        padding: 12px 20px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        position: static;
        margin-top: 32px;
        justify-content: flex-start;
        gap: 24px;
    }

    .hero-stat-num {
        font-size: 24px;
    }

    /* ── LANDING — Sections ── */
    section {
        padding: 48px 16px;
    }

    .section-head {
        margin-bottom: 32px;
    }

    .section-subtitle {
        font-size: 14px;
    }

    /* ── LANDING — Promo Grid ── */
    .promo-grid {
        grid-template-columns: 1fr;
    }

    .promo-card {
        min-height: 220px;
    }

    .promo-title {
        font-size: 18px;
    }

    .promo-card-body {
        padding: 20px;
    }

    /* ── LANDING — About ── */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-img-main {
        height: 280px;
    }

    .about-img-sub {
        display: none;
    }

    .about-badge {
        left: 12px;
        top: 12px;
        padding: 14px 18px;
    }

    .about-badge-num {
        font-size: 28px;
    }

    /* ── LANDING — CTA ── */
    .cta-section {
        padding: 48px 16px;
    }

    .cta-form {
        flex-direction: column;
    }

    .cta-input {
        min-width: auto;
        width: 100%;
    }

    /* ── LANDING — Footer ── */
    .footer {
        padding: 40px 16px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    /* ── LANDING — Ticker ── */
    .ticker-item {
        padding: 8px 20px;
        gap: 12px;
    }

    .ticker-item img {
        width: 48px;
        height: 48px;
    }

    .ticker-item-name {
        font-size: 13px;
    }

    /* ── LANDING — Menu Grid ── */
    .menu-section .menu-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .menu-card-img {
        height: 140px;
    }

    .menu-card-body {
        padding: 12px;
    }

    .menu-card-title {
        font-size: 14px;
    }

    .menu-card-price {
        font-size: 15px;
    }

    .menu-card-desc {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .menu-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .menu-tabs::-webkit-scrollbar {
        display: none;
    }

    .menu-tab {
        padding: 8px 16px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .view-all-wrap {
        margin-top: 32px;
    }


    /* ── CUSTOMER PAGE — Content ── */
    .page-content {
        padding: 1rem 0.75rem;
    }

    .page-hero h1 {
        font-size: 1.25rem;
    }

    .page-hero p {
        font-size: 0.875rem;
    }

    /* ── CUSTOMER — Forms ── */
    .form-card {
        padding: 1.25rem 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-card input,
    .form-card select,
    .form-card textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    /* ── CUSTOMER — Timeline ── */
    .timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .timeline::before {
        top: 0;
        bottom: 0;
        left: 1.125rem;
        right: auto;
        width: 3px;
        height: auto;
    }

    .timeline-step {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .timeline-dot {
        margin: 0;
        flex-shrink: 0;
    }

    /* ── CUSTOMER — Detail Grid ── */
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* ── CUSTOMER — Booking Status Table ── */
    .data-table {
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .data-table tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px 16px;
    }

    .data-table tbody tr:hover {
        background: var(--card);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border);
        font-size: 0.875rem;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--muted-fg);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex-shrink: 0;
        margin-right: 12px;
    }

    /* ── CUSTOMER — Menu Grid ── */
    .customer-page .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cat-tabs {
        display: flex;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
    }

    .cat-tabs::-webkit-scrollbar {
        display: none;
    }

    .cat-tab {
        flex-shrink: 0;
        font-size: 0.8125rem;
    }

    /* ── CUSTOMER — Auth/Login ── */
    .auth-wrapper {
        padding: 0 8px;
    }

    .auth-card {
        padding: 1.25rem 1rem;
    }

    .demo-grid {
        grid-template-columns: 1fr;
    }

    /* ── USER THEME (theme.css) — Navbar ── */
    .l-customer-topbar .topbar-inner {
        padding: 0 12px;
        height: 52px;
    }

    .l-customer-topbar .brand-text {
        display: none;
    }

    .l-customer-topbar .nav-menu {
        gap: 4px;
    }

    .l-customer-topbar .nav-item {
        padding: 8px;
        font-size: 0;
        gap: 0;
    }

    .l-customer-topbar .nav-item i {
        font-size: 16px;
    }

    .l-customer-topbar .nav-item .nav-label {
        display: none;
    }

    .l-customer-main {
        padding: 16px 12px;
    }

    /* ── USER THEME — Tabs ── */
    .tabs-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs-container::-webkit-scrollbar {
        display: none;
    }

    .tabs-wrap {
        flex-shrink: 0;
    }

    .tab {
        font-size: 12px;
        padding: 6px 10px;
        flex-shrink: 0;
    }

    /* ── ADMIN / STAFF / CASHIER — Shell ── */
    /* sidebar already collapses via admin.css @1024px */

    .topbar {
        padding: 0 12px;
        height: 52px;
    }

    .topbar-title {
        font-size: 13px;
    }

    .topbar-right .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .topbar-right .badge-role {
        display: none;
    }

    .content {
        padding: 0.75rem;
    }

    /* ── ADMIN — Page Header ── */
    .page-header {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 1rem;
    }

    .page-header-left h2 {
        font-size: 16px;
    }

    /* ── ADMIN — Tables (horizontal scroll) ── */
    .table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-card-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .admin-table {
        min-width: 600px;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* ── ADMIN — KPI Grid ── */
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .kpi-card {
        padding: 14px;
        gap: 10px;
    }

    .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .kpi-value {
        font-size: 18px;
    }

    .kpi-label {
        font-size: 11px;
    }

    /* ── ADMIN — Charts ── */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 16px;
    }

    /* ── ADMIN — Form ── */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-control {
        font-size: 16px; /* prevent iOS zoom */
    }

    /* ── ADMIN — Search ── */
    .search-input {
        min-width: 120px;
        font-size: 14px;
    }

    /* ── ADMIN — Modal ── */
    .modal {
        max-width: calc(100vw - 24px);
        margin: 0 12px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    /* ── ADMIN — Buttons ── */
    .btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
    }

    .btn-sm {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 36px;
    }

    /* ── STAFF — Table Map Grid ── */
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .table-tile {
        padding: 10px 8px;
    }

    .table-tile-name {
        font-size: 13px;
    }

    .table-tile-cap {
        font-size: 10px;
    }

    /* ── CASHIER — Checkout ── */
    .payment-grid {
        grid-template-columns: 1fr !important;
    }

    .payment-methods {
        flex-wrap: wrap;
    }

    .method-btn {
        min-width: calc(50% - 5px);
        padding: 12px 8px;
        font-size: 12px;
    }

    .money-breakdown {
        padding: 1rem;
    }

    .breakdown-row {
        font-size: 13px;
    }

    .breakdown-row.total {
        font-size: 16px;
    }

    .breakdown-row.total span:first-child {
        font-size: 14px;
    }

    /* ── QR Card ── */
    .qr-card {
        padding: 20px 16px;
    }

    .qr-image-wrapper img {
        width: 180px;
        height: 180px;
    }

    .transfer-content-value {
        font-size: 16px;
    }

    .transfer-amount-value {
        font-size: 20px;
    }

    /* ── STAFF — Order Editor ── */
    .order-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── CUSTOMER — Stat Grid ── */
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    /* ── CUSTOMER — Modals ── */
    .modal-card {
        max-width: calc(100vw - 24px);
    }

    .modal-overlay {
        padding: 0.5rem;
    }
}


/* =====================================================
   SMALL MOBILE  (max-width: 480px)
   ===================================================== */
@media (max-width: 480px) {

    /* ── Landing — Menu Grid single col ── */
    .menu-section .menu-grid {
        grid-template-columns: 1fr;
    }

    .menu-card-img {
        height: 180px;
    }

    .menu-card-body {
        padding: 14px;
    }

    /* ── KPI Grid single col ── */
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    /* ── Stat Grid single col ── */
    .stat-grid {
        grid-template-columns: 1fr;
    }

    /* ── Smaller hero title ── */
    .hero-title {
        font-size: 30px;
    }

    /* ── Payment Methods stack ── */
    .payment-methods {
        gap: 8px;
    }

    .method-btn {
        min-width: 100%;
        flex-direction: row;
        justify-content: center;
        padding: 14px 12px;
    }

    /* ── Table grid 2-col ── */
    .table-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Admin table force smaller ── */
    .admin-table {
        min-width: 500px;
    }

    /* ── Buttons full width in forms ── */
    .form-card .btn,
    .traditional-payment .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Landing — Float book button ── */
    .float-book {
        bottom: 16px;
        padding: 12px 28px;
        font-size: 13px;
    }

    /* ── Detail Grid ── */
    .detail-grid {
        padding: 1rem;
    }

    /* ── Demo box/tags ── */
    .demo-tags {
        gap: 6px;
    }

    .demo-tag {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* ── Info/Note boxes ── */
    .info-box,
    .note-box {
        padding: 0.75rem 1rem;
    }

    .info-box ul,
    .note-box ul {
        font-size: 0.75rem;
    }
}


/* =====================================================
   GLOBAL MOBILE TOUCH IMPROVEMENTS
   ===================================================== */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover transforms on touch devices — they cause sticky hover */
    .menu-card:hover {
        transform: none;
    }

    .table-tile:hover {
        transform: none;
    }

    .table-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Active states for better touch feedback */
    .btn:active {
        transform: scale(0.97);
    }

    .nav-link:active,
    .nav-item:active,
    .method-btn:active,
    .cat-tab:active,
    .tab:active,
    .menu-tab:active {
        opacity: 0.7;
    }
}
