/*
 * Responsive Stylesheet
 * Handles responsive layout adaptations across mobile, tablet, and desktop viewports
 */

/* ==========================================================================
   1. SCREEN SIZES (MAX-WIDTH LEGACY HELPERS)
   ========================================================================== */

/* LG */
@media (max-width: 1200px) {
}

/* MD */
@media (max-width: 992px) {
    /* WP CLASSES */
    .alignleft {
        float: none !important;
    }
}

/* SM */
@media (max-width: 768px) {
    /* GENERAL */
    body {}

    .max-width-320 {
        max-width: 320px;
    }

    article p {
        padding-bottom: 15px;
    }
}

/* XS */
@media (max-width: 580px) {
}

/* ==========================================================================
   2. HORIZONTAL & LARGE SCREEN GRID LAYOUT
   ========================================================================== */

/* Mobile landscape header adjustment for low-height screens */
@media (orientation: landscape) and (max-height: 500px) {
    body.home {
        padding-top: calc(var(--header-height, 128px) + 25px);
        padding-bottom: 48px;
    }

    .qrfood-header-hero {
        min-height: 90px;
    }

    .qrfood-header-hero-content {
        padding: 8px 15px;
    }

    .qrfood-header-logo-wrap {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    h1.qrfood-header-store-name {
        font-size: 16px;
    }

    header nav {
        padding: 6px 0;
    }

    header nav ul {
        gap: 10px;
    }

    header nav a {
        font-size: 0.88em;
    }

    footer .buttons {
        height: 48px;
    }

    footer .buttons .button-cart {
        height: 48px;
    }

    .floating-call-waiter-btn {
        bottom: calc(48px + 10px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        padding: 5px 12px 5px 10px;
        font-size: 0.72em;
    }
}

/* Tablet portrait, phone landscape & medium screens: 2-column product grid */
@media (min-width: 600px), (orientation: landscape) and (min-width: 540px) {
    body.home {
        padding-top: calc(var(--header-height, 147px) + 20px);
        padding-bottom: max(120px, 45vh);
    }
    
    main.products {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    main.products h2 {
        grid-column: 1 / -1;
        margin: 0;
        padding: 0;
        scroll-margin-top: calc(var(--header-height, 147px) - 40px);
    }

    .qrfood-first-category-target {
        scroll-margin-top: calc(var(--header-height, 147px) - 40px);
    }

    main.products h2:not(:first-child) {
        padding-top: 15px;
    }

    .products .product {
        display: grid;
        grid-template-columns: 96px 1fr;
        column-gap: 14px;
        row-gap: 8px;
        padding: 14px;
        margin-bottom: 0;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        align-items: start;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                    box-shadow 0.2s ease,
                    border-color 0.2s ease;
    }

    .products .product:hover {
        transform: translateY(-2px);
        border-color: #cbd5e1;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }

    .products .product figure {
        width: 96px;
        min-width: 96px;
        height: 96px;
        border-radius: 8px;
        overflow: hidden;
        background-color: #f1f5f9;
    }

    .products .product figure img {
        transition: transform 0.25s ease;
    }

    .products .product:hover figure img {
        transform: scale(1.04);
    }

    .products .product .product-info {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
        min-height: 96px;
        gap: 4px;
    }

    .products .product .product-info h3 {
        font-size: 1.15em;
        line-height: 1.3;
        color: #1e293b;
        margin: 0;
        font-weight: 700;
    }

    .products .product .product-info .excerpt {
        font-size: 0.88em;
        line-height: 1.4;
        color: #64748b;
        margin: 2px 0 0 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .products .product .product-info .price {
        font-size: 1.1em;
        font-weight: 700;
        color: var(--default, #E50914);
        margin: auto 0 0 0;
        padding-top: 6px;
        line-height: 1.2;
    }
}

/* Desktop, laptops & tablet landscape: 3-column product grid */
@media (min-width: 1024px) {
    body.home {
        padding-top: calc( var(--header-height, 175px) + 10px );
    }

    .qrfood-header-hero-content {
        padding: 24px 30px;
    }

    .qrfood-header-logo-wrap {
        width: 76px;
        height: 76px;
        min-width: 76px;
    }

    h1.qrfood-header-store-name {
        font-size: 24px;
    }

    .qrfood-table-badge {
        font-size: 13px;
        padding: 4px 12px;
    }

    main.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .products .product {
        padding: 16px;
        grid-template-columns: 104px 1fr;
        column-gap: 16px;
    }

    .products .product figure {
        width: 104px;
        min-width: 104px;
        height: 104px;
    }

    .products .product .product-info {
        min-height: 104px;
    }

    .products .product .product-info h3 {
        font-size: 1.2em;
    }

    .products .product .product-info .excerpt {
        font-size: 0.9em;
        -webkit-line-clamp: 3;
    }
}

/* Extra wide monitors: 4-column product grid */
@media (min-width: 1500px) {
    main.products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }
}
