/* Product Board - Global Styles */

/* Box-sizing reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Base body styles with iOS safe area support */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* 44px minimum touch target enforcement (Apple HIG / WCAG) */
.mud-icon-button,
.mud-button,
.mud-tab,
.mud-chip,
.mud-list-item {
    min-width: 44px;
    min-height: 44px;
}

/* Ensure bottom nav icons are centered in touch targets (mobile only) */
@media (max-width: 1279.98px) {
    .mud-appbar-fixed-bottom .mud-icon-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Blazor error UI - hidden by default */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Loading screen - removed by Blazor when app initializes */
#app-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

/* Prevent horizontal scroll on mobile */
html {
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color matching primary */
::selection {
    background-color: rgba(25, 118, 210, 0.2);
}

/* Product filter bar */
.product-filter-bar {
    padding: 8px 8px 0;
}

/* Product detail sticky footer */
.product-detail-footer {
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    z-index: 1200;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    padding: 8px 16px;
    display: flex;
    gap: 8px;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
