html, body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background-color: #f4f6f2;
    margin: 0;
    padding: 0;
}

.alufield-main-content {
    padding-bottom: calc(108px + env(safe-area-inset-bottom)) !important;
}

.pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: #ffffff;
    border-top: 1px solid #d7e0dc;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    min-height: 64px;
    height: calc(64px + env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.pwa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #51635e;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 2px;
    position: relative;
}

.pwa-nav-item.active {
    color: #12695e;
}

.pwa-nav-primary .pwa-nav-fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #12695e;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(18, 105, 94, 0.35);
    margin-top: -16px;
}

.pwa-nav-badge {
    position: absolute;
    top: 0;
    right: 22%;
    background: #b46a35;
    color: #ffffff;
    border-radius: 999px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    text-align: center;
}

.field-photo-preview {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #cfd8dc;
}

.field-photo-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #cfd8dc;
}

.hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8e1;
    bottom: 64px;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1300;
}

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

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

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

.loading-progress circle:last-child {
    stroke: #12695e;
    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: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "جاري التحميل...");
}

.perspective-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 520px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #cfd8dc;
    background: linear-gradient(180deg, #eef1ef 0%, #e1e6e3 75%, #c9d1cd 75%, #b9c3be 100%);
    user-select: none;
    touch-action: none;
}

.perspective-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.perspective-preconstruction-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(24, 59, 54, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(24, 59, 54, 0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}

.perspective-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.perspective-overlay-layer svg {
    width: 100%;
    height: 100%;
    display: block;
}

.perspective-handle {
    position: absolute;
    width: 28px;
    height: 28px;
    margin-left: -14px;
    margin-top: -14px;
    border-radius: 50%;
    background: #12695e;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    cursor: grab;
    touch-action: none;
    z-index: 10;
}

.perspective-handle:active {
    cursor: grabbing;
    transform: scale(1.15);
    background: #b46a35;
}

.perspective-customer-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(18, 105, 94, 0.92);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 12;
}

.swatch-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1.5px solid #cfd8dc;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    text-align: right;
}

.swatch-chip.selected {
    border-color: #12695e;
    box-shadow: 0 0 0 2px rgba(18, 105, 94, 0.18);
    background: #f2f8f6;
}

.swatch-chip.out-of-stock {
    border-color: #d32f2f;
    background: #fff5f5;
}

.swatch-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}
