/* Responsive layer: mobile styles stay in app.css; shared breakpoints live here.
   Brand assets and the purchased Modam font are supplied by the existing theme. */
.desktop-nav, .desktop-menu-title, .desktop-category-title, .desktop-cart-summary { display: none; }
.checkout-latin { font-family: inherit; }

@media (min-width: 768px) {
    body { background: #fffdf9; }
    .mobile-shell { width: 100%; max-width: 1280px; overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: #fffdf9; }
    .brand-bar { grid-template-columns: auto minmax(0, 1fr); gap: 24px; padding-inline: 32px; border-bottom: 1px solid #eee5dd; }
    .brand-logo { grid-column: 1; grid-row: 1; justify-self: start; }
    .brand-logo strong { font-size: 1.5rem; }
    .menu-toggle, .side-drawer, .drawer-backdrop { display: none; }
    .brand-spacer { display: none; }
    .desktop-nav { display: flex; grid-column: 2; grid-row: 1; justify-self: end; align-items: center; gap: 6px; }
    .desktop-nav a, .desktop-nav button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: #623619; font: inherit; font-size: .88rem; white-space: nowrap; text-decoration: none; }
    .desktop-nav .ui-icon { flex: 0 0 19px; width: 19px; height: 19px; stroke-width: 1.6; }
    .desktop-nav a:hover, .desktop-nav button:hover, .desktop-nav a.active { background: #f5ece3; color: #86491f; }
    .desktop-nav a:focus-visible, .desktop-nav button:focus-visible { outline: 2px solid #b77940; outline-offset: 3px; }
    .side-drawer { right: max(0px, calc((100vw - 1280px) / 2)); }
    .layout-content { background: #fffdf9; }
    .b2c-menu, .b2b-menu-v2 { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-content: start; padding: 24px 32px 112px; background: #fffdf9; }
    .b2c-menu .menu-hero, .b2b-customer-card, .desktop-menu-title, .menu-page > .menu-state, .b2b-menu-v2 > .menu-state, .order-message { grid-column: 1 / -1; }
    .b2c-menu .menu-hero { min-height: 220px; margin: 0; }
    .desktop-menu-title { display: block; margin: 0; color: #59351f; font-size: 1.4rem; }
    .b2c-menu .category-tabs, .b2b-category-tabs { position: sticky; top: 94px; display: flex; flex-direction: column; align-self: start; gap: 8px; max-height: calc(100dvh - 200px); overflow-y: auto; scrollbar-width: thin; padding: 16px; border: 1px solid #eee2d5; border-radius: 18px; background: #fffaf5; }
    .desktop-category-title { display: block; margin: 0 0 12px; font-size: 1.05rem; color: #59351f; }
    .b2c-menu .category-tab, .b2b-category { flex: none; display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 58px; padding: 8px; border-radius: 12px; font-size: .85rem; text-align: right; }
    .b2c-menu .category-image, .b2b-category > span { flex: 0 0 36px; width: 36px; height: 36px; box-shadow: none; }
    .b2c-menu .category-image img, .b2b-category img { width: 30px; height: 30px; }
    .b2b-category b { font-size: .85rem; }
    .b2c-menu .category-tab.active, .b2b-category.active { background: #b77940; color: white; }
    .b2c-menu .category-tab::after, .b2b-category::after { display: none; }
    .b2c-menu .product-list, .b2b-product-list { grid-column: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-content: start; background: transparent; }
    .b2c-menu .product-row { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 0; padding: 0 0 18px; overflow: hidden; border-radius: 18px; background: #fffdfa; }
    .b2c-menu .product-action { display: contents; }
    .b2c-menu .product-image { grid-column: 1; grid-row: 1; width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; }
    .b2c-menu .product-details { grid-column: 1; grid-row: 2; padding: 16px; }
    .b2c-menu .product-details h2 { font-size: 1.02rem; line-height: 1.8; overflow-wrap: anywhere; }
    .b2c-menu .product-latin-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; margin-bottom: 8px; }
    .b2c-menu .product-description { display: block; overflow: visible; font-size: .8rem; }
    .b2c-menu .price-line { flex-wrap: wrap; margin-top: 12px; }
    .b2c-menu .price-line strong { display: none; }
    .b2c-menu .price-line span { color: #703b1c; font-size: 1.05rem; }
    .b2c-menu .add-product, .b2c-menu .quantity-control { grid-row: 3; grid-column: 1; justify-self: center; margin: 0; }
    .b2c-menu .add-product { min-height: 42px; background: #86491f; border-radius: 22px; }
    .b2c-menu .add-product.unavailable { background: #b9aaa2; }
    .b2c-menu .quantity-control button, .b2c-menu .quantity-control span { height: 42px; }
    .b2b-product-card { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px; background: #fffdfa; }
    .b2b-product-image { width: 100%; height: auto; aspect-ratio: 1; }
    .b2b-product-info h2 { white-space: normal; line-height: 1.8; }
    .b2b-stock-control { display: flex; justify-content: space-between; flex-wrap: wrap; }

    /* All fixed action bars use the same desktop content width. */
    .order-bar, .b2b-order-bar, .review-action-bar, .checkout-actions, .confirmed-order-actions,
    .b2b-dashboard .dashboard-actions {
        right: max(32px, calc((100vw - 1280px) / 2 + 32px));
        left: max(32px, calc((100vw - 1280px) / 2 + 32px));
        bottom: 16px; padding: 12px 18px; border: 1px solid #eee2d5; border-radius: 16px;
        background: #fffdfaf5; box-shadow: 0 4px 22px #59351f12;
    }
    .b2c-menu .order-bar { justify-content: space-between; border: 1px solid #eee2d5; }
    .desktop-cart-summary { display: block; color: #623619; }
    .b2c-menu .submit-order, .b2b-order-bar button, .review-action-bar button, .confirmed-order-actions button { max-width: 320px; margin-inline-start: auto; min-height: 48px; }
    .checkout-actions, .b2b-dashboard .dashboard-actions { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: end; }

    .organization-login { max-width: 520px; margin-inline: auto; align-content: start; padding-top: 40px; background: transparent; }
    .consumer-checkout { max-width: 620px; margin-inline: auto; background: transparent; padding-top: 40px; padding-bottom: 120px; }
    .address-checkout, .payment-checkout { max-width: 960px; }
    .address-checkout .checkout-address-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .b2c-checkout, .order-review-page { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-content: start; align-items: start; gap: 24px; padding: 32px 32px 120px; background: #fffdf9; }
    .checkout-review-summary { position: sticky; top: 98px; padding: 20px; border: 1px solid #edddcf; border-radius: 18px; background: #fffaf5; }
    .checkout-review-summary .checkout-total { margin-top: 0; flex-wrap: wrap; gap: 12px; }
    .order-review-page .review-heading, .order-review-page .empty-order, .order-review-page .order-confirmation { grid-column: 1 / -1; }
    .order-review-page .order-summary { position: sticky; top: 98px; margin-top: 0; }
    .checkout-line, .review-line { background: #fff; }
    .checkout-line h2, .review-product-info h2 { white-space: normal; line-height: 1.8; }
    .my-orders-page, .confirmed-order-page { padding: 32px 32px 120px; background: #fffdf9; }
    .my-orders-list, .confirmed-order-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .confirmed-order-lines > h2, .confirmed-empty-lines { grid-column: 1 / -1; }
    .confirmed-order-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .my-orders-pager { max-width: 420px; margin-inline: auto; }
    .b2b-dashboard.b2b-dashboard { padding: 32px 32px 120px; }
    .b2b-dashboard .dashboard-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
    .b2b-dashboard .dashboard-latest { max-width: 760px; margin-inline: auto; }
    button:focus-visible, a:focus-visible { outline: 3px solid #b77940; outline-offset: 4px; }
}
@media (min-width: 1100px) {
    .b2c-menu, .b2b-menu-v2 { grid-template-columns: 210px minmax(0, 1fr); gap: 24px; }
    .b2c-menu .product-list, .b2b-product-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Keep checkout rows readable on tablets before introducing a summary column. */
@media (min-width: 768px) and (max-width: 1023px) {
    .b2c-checkout, .order-review-page { grid-template-columns: minmax(0, 1fr); }
    .checkout-review-summary, .order-review-page .order-summary { position: static; }
    .b2b-dashboard .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .payment-checkout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-content: start; align-items: start; gap: 20px; }
    .payment-checkout > .checkout-heading, .payment-checkout > .menu-state, .payment-checkout > .checkout-error { grid-column: 1 / -1; }
    .payment-checkout .invoice-items { grid-column: 1; grid-row: 2 / span 3; }
    .payment-checkout .payment-summary, .payment-checkout .invoice-result, .payment-checkout .payment-gateways { grid-column: 2; }
}

/* Compact horizontal navigation on tablet widths; keep the header one row tall. */
@media (min-width: 768px) and (max-width: 1023px) {
    .brand-bar { gap: 12px; padding-inline: 20px; }
    .brand-logo { gap: 7px; }
    .brand-logo strong { font-size: 1.1rem; }
    .desktop-nav { gap: 2px; }
    .desktop-nav a, .desktop-nav button { gap: 5px; padding-inline: 7px; font-size: .75rem; }
}
