/* 
 * Premium Customizer Design System
 * Based on PitchPrint Style Aesthetic
 */

:root {
    --p-gold: #f9c31f;
    --p-gold-dark: #d4af37;
    --p-gold-light: #f1d592;
    --p-bg-light: #fdfcf8;
    --p-bg-panel: #ffffff;
    --p-border: rgba(249, 195, 31, 0.15);
    --p-text-main: #1a1a1a;
    --p-text-muted: #64748b;
    --p-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --p-font-display: 'Inter', sans-serif;
    --p-font-serif: 'Playfair Display', serif;
}

/* Customizer Main Container */
.premium-customizer {
    display: flex;
    flex-direction: column;
    height: 850px;
    max-width: 1400px;
    margin: 40px auto;
    background: var(--p-bg-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.1);
    position: relative;
    font-family: var(--p-font-display);
    border: 1px solid var(--p-border);
}

/* Header */
.pc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: #fff;
    border-bottom: 1px solid var(--p-border);
    z-index: 10;
}

.pc-header h1 {
    font-family: var(--p-font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--p-text-main);
    letter-spacing: -0.02em;
}

/* Main Layout */
.pc-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Panels container — Fix 1: prevent collapse on mid-width desktops */
.pc-panels-container {
    min-width: 230px;
}

/* Vertical Icon Sidebar */
.pc-sidebar {
    width: 80px;
    background: #fff;
    border-right: 1px solid var(--p-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    gap: 30px;
    z-index: 20;
}

.pc-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    color: var(--p-text-muted);
    transition: all 0.3s ease;
    position: relative;
}

.pc-tool-btn i {
    font-size: 1.6rem;
}

.pc-tool-btn span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pc-tool-btn:hover {
    color: var(--p-gold);
}

.pc-tool-btn.active {
    color: var(--p-gold);
}

.pc-tool-btn.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 30px;
    background: var(--p-gold);
    border-radius: 3px 0 0 3px;
}

/* Expanded Panels */
.pc-panel {
    width: 320px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--p-border);
    padding: 25px;
    overflow-y: auto;
    z-index: 15;
    display: none;
    animation: pcSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pc-panel.active {
    display: block;
}

@keyframes pcSlideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.pc-panel h3 {
    font-family: var(--p-font-serif);
    font-size: 1.35rem;
    margin-bottom: 20px;
    color: var(--p-text-main);
    border-bottom: 1px solid var(--p-border);
    padding-bottom: 12px;
}

/* Normal Preview (Frame View) Styles */
.pc-preview-stage {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1500px;
    padding: 20px;
}

.frame-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.15);
    padding: 1px; /* Ensure border is visible */
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
}

.frame-border {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: content-box !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(0,0,0,0.1);
    line-height: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mount-board {
    background: #ffffff;
    padding: 40px; /* Default matting */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.art-print {
    position: relative;
    background: #fdfcf8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#previewImage {
    max-width: none !important; /* Managed by JS transforms */
    position: relative;
    z-index: 1;
}

.frame-border.no-frame {
    border: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Central Preview Area Adjustments */
.pc-preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--p-bg-light);
    background-image: radial-gradient(rgba(249, 195, 31, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Wall Preview (Fabric.js Implementation) */
.wall-preview-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1200 / 750;    /* matches Fabric canvas ratio exactly */
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
}

/* Fabric injects .canvas-container wrapping the <canvas> — make it fill the stage */
.wall-preview-stage .canvas-container {
    width: 100% !important;
    height: 100% !important;
    box-shadow: none;
    margin: 0;
}
.wall-preview-stage .canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.wall-controls {
    margin-top: 15px;
    display: flex;
    gap: 15px;
}

.wall-placeholder i {
    font-size: 32px;
    margin-bottom: 5px;
    opacity: 0.5;
}

/* Effects Overlays */
.wall-effect-overlay, .wall-gloss-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.wall-gloss-overlay {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wall-effect-overlay.matte {
    backdrop-filter: contrast(0.9) brightness(1.1);
    background: rgba(255,255,255,0.05);
}

.wall-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 25px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 100;
}

.wall-controls .control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wall-controls label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--p-text-muted);
}

.preview-toggle-container {
    display: flex;
    gap: 2px;
    background: #eee;
    padding: 4px;
    border-radius: 100px;
    margin-top: 20px;
}

.toggle-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--p-text-muted);
}

.toggle-btn.active {
    background: #fff;
    color: var(--p-text-main);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}


.pc-floating-controls {
    position: relative;
    /* Changed from absolute to allow stacking */
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 10px 24px;
    border-radius: 100px;
    border: 1px solid var(--p-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    z-index: 10;
    cursor: grab;
    /* Indicate draggable */
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    user-select: none;
}

.pc-floating-controls:active {
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

/* 0.6s Smooth Transitions for Frame Elements */
#framePreview,
.frame-border,
.mount-board,
.art-print,
#frameOverlay {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mount-board {
    background: #ffffff;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.art-print {
    position: relative;
    overflow: hidden; /* Prevent photo overflow */
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3/4; /* Default for 15x20 */
    min-height: 300px;
    background: #fdfcf8;
}

#previewImage {
    z-index: 1; /* Lowest layer */
}

#frameOverlay {
    z-index: 10; /* Above photo */
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.pc-flow-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--p-text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pc-flow-btn:hover {
    background: var(--p-gold);
    color: #fff;
}

.divider {
    width: 1px;
    height: 20px;
    background: var(--p-border);
    margin: 0 5px;
}

/* Footer Action Bar */
.pc-footer {
    height: 100px;
    background: #fff;
    border-top: 1px solid var(--p-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 30;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.02);
}

.pc-price-box {
    display: flex;
    flex-direction: column;
}

.pc-price-box .total-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--p-text-muted);
    letter-spacing: 0.1em;
}

.pc-price-box .price {
    font-family: var(--p-font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--p-text-main);
}

.pc-shipping-info {
    font-size: 12px;
    color: var(--p-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.pc-add-btn {
    background: linear-gradient(135deg, var(--p-gold) 0%, var(--p-gold-dark) 100%);
    color: #fff;
    padding: 16px 40px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(249, 195, 31, 0.25);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.pc-add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(249, 195, 31, 0.35);
}

.pc-add-btn i {
    font-size: 1.4rem;
}

/* Option Groups & UI Elements */
.pc-option-group {
    margin-bottom: 25px;
}

.pc-option-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--p-text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

/* Grids */
.pc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pc-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pc-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Buttons & Inputs */
.pc-btn-outline {
    background: var(--p-bg-light);
    border: 1px solid var(--p-border);
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--p-text-main);
}

.pc-btn-outline:hover,
.pc-btn-outline.active {
    background: #fff;
    border-color: var(--p-gold);
    box-shadow: 0 4px 12px rgba(249, 195, 31, 0.1);
}

.pc-btn-outline i {
    color: var(--p-gold);
}

/* Range Slider Styling */
.pc-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 5px;
}

.pc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid var(--p-gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Selection Cards (Sizes/Frames) */
.pc-select-card {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pc-select-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.pc-select-card.active {
    border-color: var(--p-gold);
    background: #fffef5;
}

.pc-select-card .dim {
    font-family: var(--p-font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.pc-select-card .meta {
    font-size: 10px;
    color: var(--p-text-muted);
}

/* Frame Swatches */
.pc-frame-swatch {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pc-frame-swatch:hover {
    border-color: var(--p-border);
}

.pc-frame-swatch.active {
    border-color: var(--p-gold);
    box-shadow: 0 0 0 2px var(--p-gold-light);
}

/* Color Presets */
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: var(--p-gold);
    transform: scale(1.1);
}

/* Floating Quality Indicator */
.pc-quality-indicator {
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    padding: 10px 15px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--p-shadow);
    border: 1px solid var(--p-border);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
}

.q-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.q-good {
    background: #10b981;
}

.q-warn {
    background: #f59e0b;
}

.q-error {
    background: #ef4444;
}

/* Responsive Adjustments */
@media (max-width: 1px) {
    .premium-customizer {
        height: auto;
        flex-direction: column;
    }

    .pc-body {
        flex-direction: column;
    }

    .pc-sidebar {
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0 20px;
        justify-content: space-around;
        gap: 0;
        border-right: none;
        border-bottom: 1px solid var(--p-border);
    }

    .pc-tool-btn.active::after {
        width: 30px;
        height: 3px;
        bottom: 0;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 3px 3px 0 0;
    }

    #previewImage {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        z-index: 1;
    }

    .pc-panel {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--p-border);
    }

    .pc-preview-area {
        min-height: 400px;
        padding: 40px;
    }
}

/* ── Frame Carousel ── */
.frame-carousel {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    user-select: none;
}

.frame-arrow-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--p-border);
    background: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--p-text-main);
}

.frame-arrow-btn:hover {
    background: var(--p-gold);
    color: #fff;
    border-color: var(--p-gold);
}

.frame-carousel-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.frame-preview-thumb {
    width: 90px;
    height: 70px;
    border-radius: 8px;
    border: 1px solid var(--p-border);
    overflow: hidden;
    background: #f5f5f5;
    transition: all 0.3s ease;
}

.frame-carousel-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--p-text-main);
    text-align: center;
}

/* ── Text Overlay Fix (always visible above image + frame) ── */
#textOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100 !important;
    cursor: grab !important;
    user-select: none;
    pointer-events: auto !important;
    min-width: 60px;
    text-align: center;
    word-break: break-word;
    transition: color 0.15s ease, font-size 0.15s ease, transform 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

#textOverlay:active {
    cursor: grabbing !important;
}

/* ── Upload Quality Warning Dialog ── */
.upload-quality-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-quality-box {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
    text-align: center;
    animation: qualityBoxIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qualityBoxIn {
    from {
        transform: scale(0.88) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.upload-quality-box .uq-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.upload-quality-box h3 {
    font-family: var(--p-font-serif);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.upload-quality-box p {
    font-size: 0.92rem;
    color: var(--p-text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.upload-quality-box .uq-rec {
    background: #fdfbe8;
    border: 1px solid #f9c31f;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    margin: 14px 0 24px;
    color: #7a5a00;
    font-weight: 600;
}

.upload-quality-box .uq-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.uq-continue-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.uq-continue-btn:hover {
    background: #333;
}

.uq-cancel-btn {
    background: rgba(255,255,255,0.15);
    color: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.uq-cancel-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(197,160,89,0.5);
}

/* ── Glass cancel button (reusable) ─────────────────────────── */
.glass-btn-cancel {
    background: rgba(255,255,255,0.12) !important;
    color: #c0392b !important;
    border: 1.5px solid rgba(192,57,43,0.25) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 2px 10px rgba(192,57,43,0.08) !important;
    transition: background 0.2s, border-color 0.2s !important;
}
.glass-btn-cancel:hover {
    background: rgba(192,57,43,0.09) !important;
    border-color: rgba(192,57,43,0.5) !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   UPLOAD PANEL — STATE B (image loaded)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Loaded card — thumbnail + meta */
.upload-loaded-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(197,160,89,0.25);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.upload-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(197,160,89,0.4);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.upload-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-thumb-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26,26,26,0.72);
    backdrop-filter: blur(4px);
    color: #a8d5a2;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 4px;
}

.upload-thumb-badge i {
    font-size: 0.7rem;
}

.upload-loaded-meta {
    flex: 1;
    min-width: 0;
}

.upload-filename {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--p-text-main, #1a1a1a);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-filedims {
    font-size: 0.72rem;
    color: var(--p-text-muted, #64748b);
    margin: 0;
}

/* Action row — Change / Remove */
.upload-loaded-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.pc-btn-upload-change {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(197,160,89,0.5);
    background: rgba(197,160,89,0.08);
    color: var(--p-gold-dark, #d4af37);
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    letter-spacing: 0.01em;
}
.pc-btn-upload-change:hover {
    background: rgba(197,160,89,0.18);
    border-color: rgba(197,160,89,0.8);
}
.pc-btn-upload-change i { font-size: 1.1rem; }

.pc-btn-upload-remove {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
}
.pc-btn-upload-remove i { font-size: 1.1rem; }

/* Adjust Image → button */
.pc-btn-upload-edit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.02em;
    margin-bottom: 14px;
    transition: opacity 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.pc-btn-upload-edit:hover { opacity: 0.88; }
.pc-btn-upload-edit i { font-size: 1.1rem; color: var(--p-gold, #f9c31f); }

/* Quality card (replaces old plain white box) */
.upload-quality-card {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(197,160,89,0.2);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 4px;
}
.upload-quality-card h4 {
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--p-gold-dark, #d4af37);
}
.upload-quality-card p {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #555;
    margin: 0 0 8px;
}
.upload-quality-stats {
    display: flex;
    gap: 14px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #444;
}

/* Global Loader Overlay (Requirement 5) */
.pc-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.pc-loader-overlay.active {
    display: flex;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #eee;
    border-top: 5px solid var(--p-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loader-label {
    font-weight: 700;
    color: var(--p-text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}