/* Product Customizer Editor v3 — Light mode, Chamevo-inspired */
:root {
    --pc-primary: #4f46e5;
    --pc-primary-hover: #4338ca;
    --pc-primary-light: rgba(79, 70, 229, 0.08);
    --pc-bg: #ffffff;
    --pc-bg-canvas: #f5f5f5;
    --pc-bg-panel: #ffffff;
    --pc-bg-hover: #f8fafc;
    --pc-text: #1e293b;
    --pc-text-muted: #64748b;
    --pc-text-dim: #94a3b8;
    --pc-border: #e2e8f0;
    --pc-border-light: #f1f5f9;
    --pc-success: #22c55e;
    --pc-danger: #ef4444;
    --pc-radius: 8px;
    --pc-radius-sm: 6px;
    --pc-transition: 0.15s ease;
    --pc-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --pc-nav-width: 64px;
    --pc-panel-width: 380px;
    --pc-bottom-height: 64px;
}

/* ─── Overlay ─── */
.pc-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--pc-bg);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    color: var(--pc-text);
    font-size: 13px;
    line-height: 1.5;
}

.pc-editor-overlay * { box-sizing: border-box; }
/* Reset WordPress admin button styles — only for bare buttons without component classes */
.pc-editor-overlay button:not([class]) { background: none; border: none; padding: 0; margin: 0; color: inherit; font: inherit; cursor: pointer; }
.pc-editor-overlay button:not([class]):hover, .pc-editor-overlay button:not([class]):focus { background: none; outline: none; box-shadow: none; }

/* ─── Main Layout: [canvas] [panel] [nav-icons] ─── */
.pc-editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ─── Canvas Area (takes most space) ─── */
.pc-canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pc-bg-canvas);
    position: relative;
    overflow: hidden;
}

.pc-canvas-stage {
    transform-origin: center center;
    transition: transform 0.1s ease;
}

.pc-canvas-wrapper {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

.pc-canvas-wrapper .canvas-container { border-radius: 4px; }
.pc-canvas-wrapper canvas { border-radius: 4px; }

/* Canvas top-left toolbar (undo/redo/zoom) */
.pc-canvas-tools {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.pc-canvas-tools .pc-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--pc-border);
    background: var(--pc-bg);
    color: var(--pc-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pc-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0;
    line-height: 0;
}

.pc-canvas-tools .pc-tool-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
    stroke: currentColor;
}

.pc-canvas-tools .pc-tool-btn:hover {
    background: var(--pc-bg-hover);
    color: var(--pc-text);
    border-color: var(--pc-primary);
}

/* Canvas zoom bottom-right */
.pc-zoom-controls {
    position: absolute;
    bottom: 80px;
    right: 16px;
    display: flex;
    gap: 2px;
    background: var(--pc-bg);
    border: 1px solid var(--pc-border);
    border-radius: var(--pc-radius);
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.pc-zoom-label {
    padding: 4px 8px;
    font-size: 12px;
    color: var(--pc-text-muted);
    display: flex;
    align-items: center;
    min-width: 40px;
    justify-content: center;
}

/* ─── Right Panel (content area) ─── */
.pc-panel {
    width: var(--pc-panel-width);
    background: var(--pc-bg-panel);
    border-left: 1px solid var(--pc-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.pc-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--pc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.pc-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--pc-text);
}

.pc-panel-close {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--pc-text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pc-transition);
}

.pc-panel-close:hover { background: var(--pc-bg-hover); color: var(--pc-text); }
.pc-panel-close:active { transform: scale(0.9); }

.pc-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.pc-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--pc-text-dim);
    padding: 60px 20px;
    height: 100%;
}

.pc-panel-empty p { margin: 8px 0 0; opacity: 0.7; }

/* ─── Right Navigation Icons ─── */
.pc-nav {
    width: var(--pc-nav-width);
    background: var(--pc-bg);
    border-left: 1px solid var(--pc-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 2px;
    flex-shrink: 0;
}

.pc-nav-btn {
    width: 56px;
    height: 52px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--pc-text-muted);
    font-size: 9px;
    transition: all var(--pc-transition);
    position: relative;
    padding: 4px 2px;
}

.pc-nav-btn svg {
    opacity: 0.6;
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
    stroke: currentColor;
}

.pc-nav-btn:hover {
    background: var(--pc-bg-hover);
    color: var(--pc-text);
}

.pc-nav-btn:hover svg { opacity: 1; }

.pc-nav-btn.active {
    background: var(--pc-primary-light);
    color: var(--pc-primary);
}

.pc-nav-btn.active svg { opacity: 1; color: var(--pc-primary); }

/* ─── Bottom Bar ─── */
.pc-bottom-bar {
    height: var(--pc-bottom-height);
    background: var(--pc-bg);
    border-top: 1px solid var(--pc-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    flex-shrink: 0;
}

.pc-bottom-product {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pc-bottom-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pc-text);
}

.pc-bottom-product-meta {
    font-size: 12px;
    color: var(--pc-text-muted);
}

/* ─── Buttons ─── */
.pc-btn {
    background: var(--pc-bg);
    border: 1px solid var(--pc-border);
    color: var(--pc-text);
    padding: 6px 12px;
    border-radius: var(--pc-radius-sm);
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--pc-transition);
    white-space: nowrap;
    line-height: 1;
}

.pc-btn:hover { background: var(--pc-bg-hover); border-color: #cbd5e1; color: var(--pc-text); }
.pc-btn:focus { outline: none; box-shadow: none; background: var(--pc-bg); color: var(--pc-text); }
.pc-btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.pc-btn:active { transform: scale(0.97); background: var(--pc-bg-hover); color: var(--pc-text); }

.pc-btn-primary { background: var(--pc-primary); border-color: var(--pc-primary); color: white; }
.pc-btn-primary:hover { background: var(--pc-primary-hover); border-color: var(--pc-primary-hover); color: white; }
.pc-btn-primary:focus { background: var(--pc-primary); color: white; }
.pc-btn-primary:active { background: var(--pc-primary-hover); color: white; }

.pc-btn-success { background: var(--pc-success); border-color: var(--pc-success); color: white; }
.pc-btn-success:hover { background: #16a34a; }

.pc-btn-icon { padding: 6px; min-width: 32px; justify-content: center; }
.pc-btn-sm { padding: 5px 10px; font-size: 12px; height: 32px; }

.pc-btn-lg {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
}

/* ─── View Switcher (bottom-left thumbnails) ─── */
.pc-views-bar {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
}

.pc-view-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--pc-border);
    background: var(--pc-bg);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all var(--pc-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pc-view-thumb:hover { border-color: var(--pc-primary); }

.pc-view-thumb.active { border-color: var(--pc-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }

.pc-view-thumb img {
    width: 100%;
    height: 44px;
    object-fit: contain;
}

.pc-view-thumb span {
    font-size: 9px;
    color: var(--pc-text-muted);
    padding: 2px 0;
}

/* ─── Panel Sections ─── */
.pc-section { margin-bottom: 20px; }

.pc-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pc-text-dim);
    margin: 0 0 10px;
    font-weight: 600;
}

/* ─── Input ─── */
.pc-input {
    width: 100%;
    background: var(--pc-bg);
    border: 1px solid var(--pc-border);
    border-radius: var(--pc-radius-sm);
    color: var(--pc-text);
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--pc-transition);
}

.pc-input:focus { border-color: var(--pc-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08); }
.pc-input::placeholder { color: var(--pc-text-dim); }

select.pc-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* ─── Panel body ─── */
.pc-panel-body { padding: 16px 20px; }

/* ─── Properties sections ─── */
.pc-props-section { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--pc-border-light); }
.pc-props-section:last-child { border-bottom: none; margin-bottom: 0; }
.pc-props-label { display: block; font-size: 11px; color: var(--pc-text-muted); margin-bottom: 4px; font-weight: 500; letter-spacing: 0.02em; }
.pc-props-actions { margin-top: 4px; }

/* ─── Property rows ─── */
.pc-prop-group { margin-bottom: 14px; }
.pc-prop-group label { display: block; font-size: 12px; color: var(--pc-text-muted); margin-bottom: 4px; font-weight: 500; }

.pc-prop-row { display: flex; gap: 6px; align-items: center; }
.pc-prop-row .pc-input { flex: 1; min-width: 0; }

.pc-prop-label { font-size: 11px; color: var(--pc-text-dim); width: 14px; text-align: center; flex-shrink: 0; }
.pc-prop-value { font-size: 11px; color: var(--pc-text-muted); min-width: 36px; text-align: right; flex-shrink: 0; }

/* ─── Text counter ─── */
.pc-text-counter { text-align: right; font-size: 11px; color: var(--pc-text-dim); margin-top: 4px; }
.pc-text-input { font-size: 14px; line-height: 1.5; }

/* ─── Font preview button ─── */
.pc-font-preview-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border: 1px solid var(--pc-border); border-radius: var(--pc-radius);
    cursor: pointer; transition: all var(--pc-transition); background: var(--pc-bg);
}
.pc-font-preview-btn:hover { border-color: var(--pc-primary); }
.pc-font-preview-btn:active { transform: scale(0.98); }
.pc-font-preview-sample { font-size: 24px; font-weight: 400; line-height: 1; min-width: 36px; text-align: center; }
.pc-font-preview-name { flex: 1; font-size: 13px; color: var(--pc-text); }
.pc-font-preview-btn svg { color: var(--pc-text-muted); flex-shrink: 0; }

/* ─── Font dropdown ─── */
.pc-font-dropdown {
    margin-top: 6px; border: 1px solid var(--pc-border); border-radius: var(--pc-radius);
    background: var(--pc-bg); box-shadow: var(--pc-shadow); max-height: 280px; overflow: hidden;
    display: flex; flex-direction: column;
}
.pc-font-dropdown .pc-font-search { border: none; border-bottom: 1px solid var(--pc-border-light); border-radius: 0; margin: 0; }
.pc-font-dropdown-list { overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--pc-border) transparent; }
.pc-font-dropdown .pc-font-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; cursor: pointer; transition: background var(--pc-transition);
}
.pc-font-dropdown .pc-font-item:hover { background: var(--pc-primary-light); }
.pc-font-dropdown .pc-font-item.active { background: var(--pc-primary-light); color: var(--pc-primary); font-weight: 500; }

/* ─── Color row ─── */
.pc-color-row { display: flex; gap: 8px; align-items: center; }
.pc-color-swatch-lg {
    width: 40px; height: 40px; border-radius: var(--pc-radius-sm);
    border: 2px solid var(--pc-border); cursor: pointer; padding: 0; overflow: hidden; flex-shrink: 0;
}
.pc-color-swatch-lg:hover { border-color: var(--pc-primary); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12); }
.pc-color-swatch-lg input[type="color"] { width: 56px; height: 56px; margin: -8px; cursor: pointer; border: none; }

/* Legacy compat */
.pc-color-swatch {
    width: 32px; height: 32px;
    border-radius: var(--pc-radius-sm);
    border: 2px solid var(--pc-border);
    cursor: pointer; padding: 0; overflow: hidden; flex-shrink: 0;
}
.pc-color-swatch input[type="color"] { width: 48px; height: 48px; margin: -8px; cursor: pointer; border: none; }

/* ─── Effect buttons (Bold/Italic) ─── */
.pc-effect-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--pc-border); border-radius: var(--pc-radius-sm);
    background: var(--pc-bg); cursor: pointer; font-size: 15px; color: var(--pc-text);
    transition: all var(--pc-transition); padding: 0;
}
.pc-effect-btn:hover { border-color: var(--pc-primary); color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-effect-btn:active { transform: scale(0.93); background: var(--pc-primary-light); }
.pc-effect-btn:focus { background: var(--pc-bg); outline: none; box-shadow: none; }
.pc-effect-btn.active { background: var(--pc-primary); color: white; border-color: var(--pc-primary); }
.pc-effect-btn.active:hover { background: var(--pc-primary-hover); }

/* ─── Alignment buttons ─── */
.pc-align-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--pc-border); border-radius: var(--pc-radius-sm);
    background: var(--pc-bg); cursor: pointer; color: var(--pc-text);
    transition: all var(--pc-transition); padding: 0; font-size: 0; line-height: 0;
}
.pc-align-btn svg {
    width: 16px; height: 16px; display: block; flex-shrink: 0;
}
.pc-align-btn:hover { border-color: var(--pc-primary); color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-align-btn:active { transform: scale(0.93); background: var(--pc-primary-light); }
.pc-align-btn:focus { background: var(--pc-bg); outline: none; box-shadow: none; }
.pc-align-btn.active { background: var(--pc-primary); color: white; border-color: var(--pc-primary); }
.pc-align-btn.active:hover { background: var(--pc-primary-hover); }

/* ─── Size controls ─── */
.pc-size-row { display: flex; align-items: center; gap: 12px; }
.pc-size-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--pc-border); border-radius: var(--pc-radius-sm);
    background: var(--pc-bg); cursor: pointer; font-size: 16px; color: var(--pc-text);
    transition: all var(--pc-transition); user-select: none; padding: 0;
}
.pc-size-btn:hover { border-color: var(--pc-primary); color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-size-btn:active { transform: scale(0.93); background: var(--pc-primary-light); }
.pc-size-btn:focus { background: var(--pc-bg); outline: none; box-shadow: none; }
.pc-size-value { font-size: 14px; font-weight: 500; min-width: 28px; text-align: center; }

/* ─── Nudge buttons ─── */
.pc-nudge-row { display: flex; gap: 6px; }
.pc-nudge-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--pc-border); border-radius: var(--pc-radius-sm);
    background: var(--pc-bg); cursor: pointer; color: var(--pc-text);
    transition: all var(--pc-transition); padding: 0; font-size: 0; line-height: 0;
}
.pc-nudge-btn svg {
    width: 14px; height: 14px; display: block; flex-shrink: 0;
}
.pc-nudge-btn:hover { border-color: var(--pc-primary); color: var(--pc-primary); background: var(--pc-primary-light); }
.pc-nudge-btn:active { transform: scale(0.93); background: var(--pc-primary-light); color: var(--pc-primary); border-color: var(--pc-primary); }
.pc-nudge-btn:focus { background: var(--pc-bg); color: var(--pc-text); border-color: var(--pc-border); outline: none; box-shadow: none; }

/* ─── Danger button ─── */
.pc-btn-danger { color: var(--pc-danger) !important; border-color: #fecaca !important; }
.pc-btn-danger:hover { background: #fef2f2 !important; }
.pc-btn-danger:active { transform: scale(0.97); }

/* ─── Range ─── */
.pc-range {
    flex: 1; appearance: none; height: 4px;
    background: var(--pc-border); border-radius: 2px; outline: none;
}
.pc-range::-webkit-slider-thumb {
    appearance: none; width: 16px; height: 16px; border-radius: 50%;
    background: var(--pc-primary); cursor: pointer; border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ─── Element category dropdown (matches font dropdown per design system) ─── */
.pc-cat-wrapper { position: relative; margin-bottom: 0; }
.pc-cat-preview-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border: 1px solid var(--pc-border); border-radius: var(--pc-radius);
    cursor: pointer; transition: all var(--pc-transition); background: var(--pc-bg);
}
.pc-cat-preview-btn:hover { border-color: var(--pc-primary); }
.pc-cat-preview-btn:active { transform: scale(0.98); }
.pc-cat-preview-name { flex: 1; font-size: 13px; color: var(--pc-text); font-weight: 500; }
.pc-cat-preview-btn svg { color: var(--pc-text-muted); flex-shrink: 0; }

.pc-cat-dropdown {
    position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 20;
    border: 1px solid var(--pc-border); border-radius: var(--pc-radius);
    background: var(--pc-bg); box-shadow: var(--pc-shadow); max-height: 280px; overflow: hidden;
    display: flex; flex-direction: column;
}
.pc-cat-dropdown .pc-cat-search { border: none; border-bottom: 1px solid var(--pc-border-light); border-radius: 0; margin: 0; }
.pc-cat-dropdown-list { overflow-y: auto; flex: 1; scrollbar-width: thin; }
.pc-cat-item {
    padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--pc-text);
    transition: background var(--pc-transition);
}
.pc-cat-item:hover { background: var(--pc-primary-light); }
.pc-cat-item.active { background: var(--pc-primary-light); color: var(--pc-primary); font-weight: 500; }

/* ─── Element search ─── */
.pc-element-search { margin-bottom: 0; }

/* ─── Asset skeleton loading ─── */
.pc-asset-skeleton {
    aspect-ratio: 1;
    background: linear-gradient(90deg, var(--pc-border-light) 25%, var(--pc-bg-hover) 50%, var(--pc-border-light) 75%);
    background-size: 200% 100%;
    animation: pc-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--pc-radius-sm);
}
@keyframes pc-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Asset Grid ─── */
.pc-asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.pc-asset-item {
    aspect-ratio: 1;
    background: var(--pc-border-light);
    border: 1px solid var(--pc-border);
    border-radius: var(--pc-radius-sm);
    cursor: pointer; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--pc-transition);
}
.pc-asset-item:hover { border-color: var(--pc-primary); background: var(--pc-primary-light); transform: scale(1.03); }
.pc-asset-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ─── Font search ─── */
.pc-font-search { margin-bottom: 8px; }

/* ─── Font List ─── */
.pc-font-list { display: flex; flex-direction: column; gap: 2px; max-height: 400px; overflow-y: auto; }

.pc-font-sample {
    font-size: 22px; line-height: 1; min-width: 40px; text-align: center;
    color: var(--pc-text); display: inline-block;
}
.pc-font-name { font-size: 13px; color: var(--pc-text-muted); }

.pc-font-item {
    padding: 8px 12px; background: transparent;
    border: 1px solid transparent; border-radius: var(--pc-radius-sm);
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; font-size: 15px; color: var(--pc-text);
    transition: all var(--pc-transition);
}
.pc-font-item:hover { background: var(--pc-bg-hover); border-color: var(--pc-border); }
.pc-font-item.active { border-color: var(--pc-primary); background: var(--pc-primary-light); }

/* ─── Layer List ─── */
.pc-layer-list { list-style: none; padding: 0; margin: 0; }

.pc-layer-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: var(--pc-radius-sm);
    cursor: pointer; font-size: 13px;
    transition: background var(--pc-transition); margin-bottom: 2px;
}
.pc-layer-item:hover { background: var(--pc-bg-hover); }
.pc-layer-item.selected { background: var(--pc-primary-light); outline: 1px solid rgba(79, 70, 229, 0.2); }

.pc-layer-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.5; }
.pc-layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-layer-empty { padding: 20px; color: var(--pc-text-dim); font-size: 13px; text-align: center; list-style: none; }

/* ─── Upload Zone ─── */
.pc-upload-zone {
    border: 2px dashed var(--pc-border); border-radius: var(--pc-radius);
    padding: 24px; text-align: center; cursor: pointer;
    transition: all var(--pc-transition);
    color: var(--pc-text-muted); font-size: 13px;
    display: flex; flex-direction: column; align-items: center;
}
.pc-upload-zone:hover { border-color: var(--pc-primary); color: var(--pc-text); background: var(--pc-primary-light); }
.pc-upload-zone.dragover { border-color: var(--pc-primary); background: rgba(79, 70, 229, 0.1); }

/* ─── Spinner ─── */
.pc-spinner-sm {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white; border-radius: 50%;
    animation: pc-spin 0.6s linear infinite;
}
@keyframes pc-spin { to { transform: rotate(360deg); } }

/* ─── Scrollbar ─── */
.pc-panel-content::-webkit-scrollbar { width: 5px; }
.pc-panel-content::-webkit-scrollbar-track { background: transparent; }
.pc-panel-content::-webkit-scrollbar-thumb { background: var(--pc-border); border-radius: 3px; }

/* ─── Customize Button on Product Page ─── */
.pc-customize-button {
    background: var(--pc-primary, #4f46e5) !important;
    color: white !important; border: none !important;
    padding: 12px 24px !important; border-radius: 8px !important;
    font-size: 15px !important; font-weight: 600 !important;
    cursor: pointer !important; transition: all 0.2s ease !important;
    display: inline-flex !important; align-items: center !important; gap: 8px !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}
.pc-customize-button:hover { background: var(--pc-primary-hover, #4338ca) !important; transform: translateY(-1px) !important; }
.pc-customize-button::before { content: "✦"; font-size: 16px; }

/* ─── Focus Visible (Accessibility) ─── */
.pc-btn:focus-visible,
.pc-tool-btn:focus-visible,
.pc-nav-btn:focus-visible,
.pc-view-thumb:focus-visible,
.pc-input:focus-visible,
.pc-font-item:focus-visible,
.pc-asset-item:focus-visible,
.pc-layer-item:focus-visible,
.pc-effect-btn:focus-visible,
.pc-align-btn:focus-visible,
.pc-size-btn:focus-visible,
.pc-nudge-btn:focus-visible,
.pc-cat-preview-btn:focus-visible,
.pc-cat-item:focus-visible,
.pc-font-preview-btn:focus-visible,
.pc-color-swatch-lg:focus-visible {
    outline: 2px solid var(--pc-primary);
    outline-offset: 2px;
}

/* ─── Tool Button Disabled State ─── */
.pc-canvas-tools .pc-tool-btn:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.pc-canvas-tools .pc-tool-btn:active:not(:disabled) {
    transform: scale(0.92);
}

/* ─── Button Success State (for Save feedback) ─── */
.pc-btn-saved {
    background: var(--pc-success) !important;
    border-color: var(--pc-success) !important;
    color: white !important;
    pointer-events: none;
}

.pc-btn-error {
    background: var(--pc-danger) !important;
    border-color: var(--pc-danger) !important;
    color: white !important;
}

/* ─── Panel Slide Transition ─── */
.pc-panel {
    transition: width var(--pc-transition), opacity var(--pc-transition);
}

.pc-panel.pc-panel-collapsed {
    width: 0;
    opacity: 0;
    border-left: none;
    overflow: hidden;
}

/* ─── Nav Button Refinements ─── */
.pc-nav-btn span {
    letter-spacing: 0.02em;
    font-weight: 500;
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.pc-nav-btn:active {
    transform: scale(0.93);
}

/* ─── Bottom Bar Polish ─── */
.pc-bottom-bar .pc-btn + .pc-btn {
    margin-left: 0;
}

.pc-bottom-bar .pc-btn-lg {
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.pc-bottom-bar .pc-btn-lg:hover {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

/* ─── Range Input Firefox ─── */
.pc-range::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--pc-primary); cursor: pointer; border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pc-range::-moz-range-track {
    height: 4px; background: var(--pc-border); border-radius: 2px;
}

/* ─── Scrollbar Firefox ─── */
.pc-panel-content {
    scrollbar-width: thin;
    scrollbar-color: var(--pc-border) transparent;
}

/* ─── Color Swatch Hover ─── */
.pc-color-swatch:hover {
    border-color: var(--pc-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

/* ─── Upload Zone Active (while uploading) ─── */
.pc-upload-zone.uploading {
    border-color: var(--pc-primary);
    background: var(--pc-primary-light);
    pointer-events: none;
    opacity: 0.7;
}

/* ─── Layer Item Drag Cursor ─── */
.pc-layer-item:active {
    background: var(--pc-primary-light);
    cursor: grabbing;
}

/* ─── View Thumb Focus ─── */
.pc-view-thumb:active {
    transform: scale(0.95);
}

/* ─── Toast / Notification ─── */
.pc-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--pc-text);
    color: white;
    padding: 10px 20px;
    border-radius: var(--pc-radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.pc-toast.pc-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pc-toast-success { background: #166534; }
.pc-toast-error { background: #991b1b; }

/* ─── Canvas Loading Overlay ─── */
.pc-canvas-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    gap: 10px;
    color: var(--pc-text-muted);
    font-size: 13px;
}

.pc-canvas-loading .pc-spinner-sm {
    border-color: rgba(79, 70, 229, 0.2);
    border-top-color: var(--pc-primary);
    width: 20px;
    height: 20px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .pc-panel { width: 300px; }
    .pc-nav { width: 48px; }
    .pc-nav-btn { width: 36px; height: 36px; font-size: 0; }
    .pc-nav-btn span { display: none; }
    .pc-bottom-bar { padding: 0 12px; gap: 8px; }
    .pc-bottom-bar .pc-btn-lg { padding: 8px 16px; font-size: 13px; }
    .pc-bottom-product-name { font-size: 13px; }
    .pc-bottom-product-meta { font-size: 11px; }
}

@media (max-width: 480px) {
    .pc-panel { display: none; }
    .pc-nav { width: 100%; position: fixed; bottom: 0; left: 0; flex-direction: row; justify-content: space-around; height: 56px; border-top: 1px solid var(--pc-border); border-left: none; z-index: 10; }
    .pc-nav-btn { width: auto; height: auto; padding: 6px 8px; }
    .pc-bottom-bar { display: none; }
    .pc-canvas-tools { top: 8px; left: 8px; }
}

/* ─── Layout Picker ─── */
.pc-layout-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.97);
}

.pc-layout-picker-inner {
    text-align: center;
    max-width: 640px;
    padding: 40px 24px;
}

.pc-layout-picker-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pc-text);
    margin: 0 0 8px;
}

.pc-layout-picker-subtitle {
    font-size: 15px;
    color: var(--pc-text-muted);
    margin: 0 0 32px;
}

.pc-layout-picker-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.pc-layout-picker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--pc-border);
    border-radius: 12px;
    background: var(--pc-bg);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    min-width: 160px;
    max-width: 220px;
}

.pc-layout-picker-card:hover {
    border-color: var(--pc-primary);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.12);
    transform: translateY(-2px);
}

.pc-layout-picker-card:active {
    transform: translateY(0);
}

.pc-layout-picker-thumb {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.pc-layout-picker-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pc-layout-picker-placeholder {
    font-size: 48px;
    font-weight: 700;
    color: var(--pc-text-muted);
}

.pc-layout-picker-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--pc-text);
}

.pc-layout-picker-close {
    margin-top: 32px;
    padding: 8px 24px;
    border: 1px solid var(--pc-border);
    border-radius: var(--pc-radius);
    background: var(--pc-bg);
    color: var(--pc-text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.pc-layout-picker-close:hover {
    background: var(--pc-panel-bg);
    color: var(--pc-text);
}
