/*==================================================
        RESPONSIVE DESIGN SYSTEM (MOBILE & TABLET)
==================================================*/

/* Tablet & Smaller Laptops (<= 1200px) */
@media (max-width: 1200px) {
    .container {
        width: 94%;
    }
    .header {
        padding: 0 40px;
    }
}

/* Tablet & Mobile (<= 992px) */
@media (max-width: 992px) {
    .header {
        height: 70px;
        padding: 0 20px;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        background: #18181b;
        border: 1px solid #34343a;
        border-radius: 12px;
        color: #ffffff;
        font-size: 20px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .menu-toggle:hover {
        background: var(--accent, #d62828);
        border-color: var(--accent, #d62828);
    }

    /* Mobile Dropdown Navigation */
    .header nav {
        display: none !important;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #141416;
        border-bottom: 2px solid var(--accent, #d62828);
        flex-direction: column;
        align-items: stretch;
        padding: 20px 24px;
        gap: 8px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.85);
        z-index: 9999;
    }

    .header nav.active {
        display: flex !important;
        animation: navSlideDown 0.25s ease forwards;
    }

    .header nav a {
        padding: 12px 14px;
        font-size: 15px;
        font-weight: 600;
        color: #ffffff;
        border-radius: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .header nav a:hover,
    .header nav a.active {
        background: rgba(214, 40, 40, 0.15);
        color: #ff595e;
    }

    .header nav a::after {
        display: none;
    }

    /* Hero Section */
    .hero {
        min-height: auto;
        padding: 110px 6% 60px;
        display: flex;
        flex-direction: column-reverse;
        gap: 40px;
        text-align: center;
    }

    .hero-desc {
        margin: 0 auto 30px;
    }

    .hero-btn {
        justify-content: center;
    }

    .hero-right {
        display: flex;
        justify-content: center;
    }

    .hero-right img {
        max-width: 300px;
        margin: 0 auto;
    }

    /* Menu Layout & Mobile Bottom-Sheet Cart (CRITICAL #3) */
    .menu-layout {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    .cart-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        height: auto !important;
        background: #18181b !important;
        border: 1px solid #34343a !important;
        border-bottom: none !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 18px 20px 32px !important;
        box-shadow: 0 -10px 45px rgba(0, 0, 0, 0.85) !important;
        z-index: 10001 !important;
        transform: translateY(105%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
        margin-top: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .cart-panel.drawer-open {
        transform: translateY(0) !important;
    }

    /* About Section */
    .about-home {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .about-image img {
        margin: 0 auto;
        max-height: 350px;
    }

    /* Footer */
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
    }
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
    .section {
        padding: 60px 4%;
    }

    .section-title h2 {
        font-size: 26px;
    }

    .logo img {
        width: 44px;
        height: 44px;
    }

    .logo span {
        font-size: 22px;
    }

    .logo span::after {
        width: 32px;
        height: 2.5px;
        margin-top: 4px;
    }

    .user-box span {
        display: none;
    }

    .user-box i {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

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

    .hero-title {
        font-size: 38px;
    }

    .hero-btn {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .hero-btn .btn {
        width: 100%;
        text-align: center;
        padding: 14px;
    }

    .menu-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin: 24px 0 16px;
    }

    .menu-toolbar .search-wrap,
    .menu-toolbar .category-select-wrap,
    .menu-toolbar input,
    .menu-toolbar select {
        width: 100%;
        min-width: unset;
    }

    .category-chips-container {
        margin: 0 0 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    .product-card {
        border-radius: 16px !important;
    }

    .product-card .product-image {
        width: 100%;
        aspect-ratio: 4 / 3;
        height: auto !important;
    }

    .product-card img {
        width: 100%;
        height: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }

    .product-content {
        padding: 12px 12px 14px !important;
    }

    .product-content h3 {
        font-size: 14px !important;
        min-height: 38px !important;
        line-height: 1.35 !important;
        margin-bottom: 4px !important;
    }

    .product-content p {
        font-size: 11.5px !important;
        height: 32px !important;
        margin-bottom: 8px !important;
        line-height: 1.4 !important;
    }

    .product-footer {
        padding-top: 8px !important;
    }

    .product-price {
        font-size: 15px !important;
    }

    .add-cart {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

    /* Floating Mobile Cart Bar */
    .mobile-cart-bar {
        position: fixed;
        bottom: 16px;
        left: 16px;
        right: 16px;
        background: #18181b;
        border: 2px solid var(--accent, #d62828);
        border-radius: 18px;
        padding: 12px 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.75), 0 0 20px rgba(214, 40, 40, 0.25);
        z-index: 999;
        backdrop-filter: blur(14px);
        animation: popUpMobile 0.3s ease;
    }

    .mobile-cart-info {
        display: flex;
        flex-direction: column;
    }

    .mobile-cart-count {
        font-size: 12px;
        color: #b5b5b5;
        font-weight: 600;
    }

    .mobile-cart-total {
        font-size: 17px;
        font-weight: 800;
        color: #ff595e;
    }

    .mobile-cart-btn {
        background: var(--accent, #d62828);
        color: #ffffff;
        padding: 10px 18px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 14px;
        border: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
}

/* Small Phones (<= 350px) */
@media (max-width: 350px) {
    .header {
        padding: 0 14px;
    }

    .logo span {
        font-size: 19px;
    }

    .hero-title {
        font-size: 30px;
    }

    .hero-right img {
        max-width: 220px;
    }

    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .qr-modal-card {
        padding: 24px 16px !important;
        border-radius: 20px !important;
    }

    .cart-panel {
        padding: 20px 16px;
    }

    #tableInfoBanner {
        font-size: 0.82rem !important;
        padding: 0.45rem 1rem !important;
    }
}

@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popUpMobile {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}