/* ==============================================
   RED FOX RENTAL — GLOBAL DESIGN SYSTEM
   ============================================== */

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* clip avoids the Chrome sticky bug caused by overflow-x:hidden on root */
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Shared sticky-header clearance for scroll targets + notched PWAs (#81/#83). */
:root {
    --rfr-appbar-base-height: 5rem;
    --rfr-appbar-offset: calc(var(--rfr-appbar-base-height) + env(safe-area-inset-top, 0px));
}

/* Keep section headings visible below the sticky MudAppBar (#81). */
html {
    scroll-padding-top: var(--rfr-appbar-offset);
}

section,
.rfr-section,
.rfr-section-title,
.rfr-hero,
.rfr-stats,
.rfr-cta {
    scroll-margin-top: var(--rfr-appbar-offset);
}

/* Apply insets to fixed chrome, not body — body padding leaves MudAppBar under the notch (#83). */
.mud-appbar {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.install-prompt-card {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    left: calc(16px + env(safe-area-inset-left, 0px)) !important;
    right: calc(16px + env(safe-area-inset-right, 0px)) !important;
}

h1:focus { outline: none; }

/* Ensure typography uses proper theme colors */
.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6,
.mud-typography-body1,
.mud-typography-subtitle1,
.mud-typography-subtitle2 {
    color: var(--mud-palette-text-primary);
}

.mud-typography-body2,
.mud-typography-caption {
    color: var(--mud-palette-text-secondary);
}

/* Disabled primary/success CTAs stay readable while still looking inactive (#84). */
.mud-button-filled:disabled,
.mud-button-filled.mud-disabled,
button.mud-button-root:disabled.mud-button-filled {
    opacity: 1 !important;
    color: var(--mud-palette-action-disabled) !important;
    background-color: var(--mud-palette-action-disabled-background) !important;
    box-shadow: none !important;
}

/* Breadcrumb styling - use primary color instead of default blue */
.mud-breadcrumbs li a,
.mud-breadcrumbs li .mud-link {
    color: var(--mud-palette-primary) !important;
}

.mud-breadcrumbs li a:hover,
.mud-breadcrumbs li .mud-link:hover {
    color: var(--mud-palette-primary-darken) !important;
    text-decoration: underline;
}

.mud-breadcrumbs .mud-breadcrumb-separator {
    color: var(--mud-palette-text-secondary);
}

.mud-breadcrumbs .mud-breadcrumb-item.mud-disabled {
    color: var(--mud-palette-text-primary);
}

/* ==============================================
   MUDBLAZOR OVERRIDES — BUTTONS
   ============================================== */
.mud-button-root {
    text-transform: none !important;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 150ms ease;
}

.mud-button-filled.mud-button-filled-primary {
    box-shadow: 0 1px 3px rgba(191, 78, 24, 0.15);
}

.mud-button-filled.mud-button-filled-primary:hover {
    box-shadow: 0 3px 10px rgba(191, 78, 24, 0.25);
    filter: brightness(1.05);
}

.mud-button-outlined {
    border-width: 1.5px !important;
}

/* ==============================================
   MUDBLAZOR OVERRIDES — CARDS
   ============================================== */
.mud-card {
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    background: var(--mud-palette-background);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

/* ==============================================
   MUDBLAZOR OVERRIDES — PAPER
   ============================================== */
.mud-paper:not(.mud-card):not(.mud-dialog):not(.mud-menu):not(.mud-popover-paper):not(.mud-appbar):not(.mud-drawer):not(.mud-picker):not(.mud-select-input) {
    border: 1px solid var(--mud-palette-lines-default);
}

/* ==============================================
   MUDBLAZOR OVERRIDES — INPUT
   ============================================== */
.mud-input-outlined .mud-input-outlined-border {
    transition: border-color 150ms ease;
}

/* ==============================================
   MUDBLAZOR OVERRIDES — CHIP
   ============================================== */
.mud-chip {
    font-weight: 500;
}

/* ==============================================
   MUDBLAZOR OVERRIDES — TABS (#93)
   Inactive MudTabs fall back to UA buttontext (near-black),
   which is near-invisible on the dark charcoal background.
   Pin inactive labels to theme secondary text (readable, muted);
   keep active on primary (already set by MudBlazor).
   ============================================== */
.mud-tab {
    color: var(--mud-palette-text-secondary);
}

.mud-tab.mud-tab-active {
    color: var(--mud-palette-primary);
}

.mud-tab.mud-disabled {
    color: var(--mud-palette-text-disabled);
}

/* ==============================================
   BRAND — Red fox mark (replaces generic paw icon)
   ============================================== */
.rfr-brand-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

.rfr-brand-logo--lg {
    width: 80px;
    height: 80px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    object-fit: contain;
}

.rfr-brand-logo--footer {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 0.5rem;
}

/* App bar brand (#82 reopen): never ellipsis-truncate; mark-only under ~400px. */
.rfr-brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.rfr-brand-text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Slightly smaller one-line wordmark when the bar is tight but still wide enough. */
@media (max-width: 600px) {
    .rfr-brand-text {
        font-size: 0.875rem;
    }
}

/* Fox mark only under ~400px — avoid "Red …" ellipsis from overcrowding. */
@media (max-width: 400px) {
    .rfr-brand-text {
        display: none;
    }

    .rfr-brand-link {
        gap: 0;
    }
}

/* Payment confirmation — brand primary, not generic green */
.payment-confirmation-page .payment-confirmation-header {
    border-bottom: 1px solid var(--mud-palette-lines-default);
    padding-bottom: 1rem;
}

.payment-confirmation-page .payment-confirmation-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.payment-confirmation-page .payment-confirmation-amount {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.payment-confirmation-page .payment-confirmation-card .mud-paper {
    background: var(--mud-palette-surface);
}

/* ==============================================
   LAYOUT
   ============================================== */
.mud-main-content {
    padding-bottom: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-background);
}

.mud-main-content > .mud-container {
    flex: 1;
}

/* ==============================================
   BLAZOR ERROR UI
   ============================================== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #333;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui a { color: #0066cc; }

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* ==============================================
   FOOTER
   ============================================== */
.rfr-footer {
    background: #1C1816;
    color: #A89888;
}

.rfr-footer-main {
    padding: 3rem 0 2rem;
}

.rfr-footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ECE6DC;
    margin-left: 0.5rem;
}

.rfr-footer-text {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #A89888;
    margin: 0;
}

.rfr-footer-heading {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ECE6DC;
    margin: 0 0 1rem;
}

.rfr-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rfr-footer-links a {
    color: #A89888;
    text-decoration: none;
    font-size: 0.8125rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: color 150ms ease;
}

.rfr-footer-links a:hover {
    color: #D47A4A;
}

.rfr-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.rfr-footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #A89888;
}

.rfr-footer-bottom {
    border-top: 1px solid rgba(236, 230, 220, 0.08);
    padding: 1rem 0;
}

.rfr-footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #7A6E64;
}

.rfr-footer-legal {
    display: flex;
    gap: 1.5rem;
}

.rfr-footer-contact-item a {
    color: inherit;
    text-decoration: none;
}

.rfr-footer-contact-item a:hover {
    color: #D47A4A;
    text-decoration: underline;
}

.rfr-footer-legal a {
    color: #7A6E64;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: color 150ms ease;
}

.rfr-footer-legal a:hover {
    color: #D47A4A;
}

@media (max-width: 600px) {
    .rfr-footer-bottom-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ==============================================
   LOADING PROGRESS
   ============================================== */
.loading-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 60vh;
    padding-top: 18vh;
    gap: 0.75rem;
}

.loading-shell-mark {
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: 0.25rem;
}

.loading-shell-hint {
    margin: 0.5rem 0 0;
    color: #5E5347;
    font-size: 0.95rem;
    font-weight: 500;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #E0DAD2;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #BF4E18;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: relative;
    text-align: center;
    font-weight: 600;
    color: #5E5347;
    min-height: 1.25rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

html.rfr-splash-dark .loading-shell-hint,
html.rfr-splash-dark .loading-progress-text {
    color: #D6D0C8;
}

html.rfr-splash-dark .loading-progress circle {
    stroke: #3F3A35;
}

html.rfr-splash-dark .loading-progress circle:last-child {
    stroke: #BF4E18;
}

.rfr-price-field .mud-input-numeric-spin,
.rfr-price-field .mud-numeric-up-down {
    align-self: stretch;
}

.rfr-price-field .mud-input-numeric-spin button,
.rfr-price-field .mud-numeric-up-down button,
.rfr-price-field .mud-input-adornment-end .mud-icon-button {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
}

.rfr-faq-header {
    text-transform: none !important;
    justify-content: space-between;
    min-height: 44px;
}

/* ==============================================
   AUTH PROMPT BOX
   ============================================== */
.rfr-auth-prompt {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-background) 92%) !important;
    border: 1px solid var(--mud-palette-primary) !important;
    border-radius: 8px;
}

/* ==============================================
   VALIDATION
   ============================================== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #2D7A47;
}

.invalid {
    outline: 1px solid #C4302B;
}

.validation-message {
    color: #C4302B;
}

/* Catalog cards: clamp description to whole lines so glyphs are not cut by the price row */
.equipment-detail-description {
    overflow: visible;
    max-height: none;
}

.equipment-card .equipment-description {
    color: var(--mud-palette-text-secondary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    padding-bottom: 0.125rem;
}

/* Equipment detail actions: stacked full-width buttons must not pick up
   sibling margin-left from mobile.css (RFR-26 crowding at ~390px). */
.rfr-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rfr-detail-actions .mud-button + .mud-button,
.rfr-detail-actions .mud-button-root + .mud-button-root {
    margin-left: 0 !important;
}

/* Light-theme hamburger: Book Now must be a readable/clickable label (#41 / RFR-7). */
.mud-drawer .mud-nav-link,
.mud-drawer .rfr-drawer-nav .mud-nav-link {
    color: var(--mud-palette-drawer-text) !important;
    align-items: center;
    overflow: visible;
    opacity: 1;
    text-decoration: none !important;
    border-left: 3px solid transparent;
    border-radius: 0;
}

.mud-drawer .mud-nav-link .mud-nav-link-text,
.mud-drawer .rfr-drawer-book-now .mud-nav-link-text {
    color: var(--mud-palette-drawer-text) !important;
    width: auto;
    max-width: none;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 500;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none !important;
}

.mud-drawer .mud-nav-link.active,
.mud-drawer .mud-nav-link.mud-nav-link-active,
.mud-drawer .mud-nav-link[aria-current="page"] {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent) !important;
    border-left-color: var(--mud-palette-primary);
}

.mud-drawer .mud-nav-link.active .mud-nav-link-text,
.mud-drawer .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
.mud-drawer .mud-nav-link[aria-current="page"] .mud-nav-link-text,
.mud-drawer .mud-nav-link.active .mud-nav-link-icon,
.mud-drawer .mud-nav-link.mud-nav-link-active .mud-nav-link-icon,
.mud-drawer .mud-nav-link[aria-current="page"] .mud-nav-link-icon {
    color: var(--mud-palette-primary) !important;
    font-weight: 600;
}

.mud-drawer .mud-nav-link .mud-nav-link-icon,
.mud-drawer .mud-nav-link .mud-icon-root,
.mud-drawer .mud-nav-link svg {
    color: var(--mud-palette-drawer-icon, var(--mud-palette-drawer-text)) !important;
    fill: currentColor;
    flex: 0 0 24px;
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    flex-shrink: 0;
}


/* ==============================================
   BOOKING — sticky summary (#77)
   Desktop: sticky right sidebar. Mobile: fixed bottom sheet.
   Breakpoint matches Bootstrap md (768px) used by visibility helpers.
   ============================================== */
.rfr-booking-layout {
    display: block;
    width: 100%;
}

.rfr-booking-main {
    min-width: 0;
}

/* Hide desktop aside on small screens; show fixed mobile sheet */
.rfr-booking-summary-aside {
    display: none;
}

.rfr-booking-summary-mobile {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    width: 100%;
    max-width: 100vw;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--mud-palette-background) 75%, transparent);
    pointer-events: none;
}

.rfr-booking-summary-mobile .rfr-booking-summary {
    pointer-events: auto;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
    max-height: min(70vh, 420px);
    overflow: auto;
    border-radius: 12px 12px 0 0;
}

/* Keep primary step CTAs above the mobile summary bar */
.rfr-booking-layout--sheet-collapsed {
    padding-bottom: 5.75rem;
}

.rfr-booking-layout--sheet-open {
    padding-bottom: min(72vh, 440px);
}

@media (min-width: 768px) {
    .rfr-booking-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
        gap: 1.25rem;
        align-items: start;
    }

    .rfr-booking-summary-aside {
        display: block;
        position: sticky;
        top: 5.5rem;
        z-index: 2;
        align-self: start;
        width: 100%;
        max-height: calc(100vh - 6rem);
        overflow: auto;
    }

    .rfr-booking-summary-mobile {
        display: none !important;
    }

    .rfr-booking-layout--sheet-collapsed,
    .rfr-booking-layout--sheet-open {
        padding-bottom: 0;
    }
}
