/* ============================================
   3D Print Service — Public Styles
   ============================================ */

:root {
    --ps-primary: #2563eb;
    --ps-primary-dark: #1d4ed8;
    --ps-success: #10b981;
    --ps-danger: #ef4444;
    --ps-warning: #f59e0b;
    --ps-bg: #f8fafc;
    --ps-card: #ffffff;
    --ps-text: #1e293b;
    --ps-text-muted: #64748b;
    --ps-border: #e2e8f0;
}

.printshop-upload-section { max-width: 760px; margin: 0 auto; }

/* Wizard Steps */
.ps-step { display: none; padding: 32px 0; border-bottom: 1px solid var(--ps-border); }
#ps-step-upload { display: block; }
#ps-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; clip: rect(0,0,0,0); border: 0; padding: 0; margin: -1px; }
.ps-step.active { display: block; }
.ps-step h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 20px; color: var(--ps-text); }

/* Dropzone */
.ps-dropzone, .ps-license-dropzone {
    border: 2px dashed var(--ps-border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: var(--ps-bg);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.ps-dropzone.drag-over, .ps-license-dropzone.drag-over {
    border-color: var(--ps-primary);
    background: #eff6ff;
}
.ps-dropzone p, .ps-license-dropzone p { margin: 0; color: var(--ps-text-muted); }
.ps-hint { font-size: 0.8rem; color: #94a3b8; margin-top: 8px; display: block; }

/* File Preview inside dropzone */
.ps-file-preview {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--ps-card); border: 1px solid var(--ps-border);
    border-radius: 8px; padding: 10px 16px; margin-top: 16px;
}
.ps-file-preview span { font-size: 0.875rem; }
.ps-file-size { color: var(--ps-text-muted); font-size: 0.75rem; }
.ps-btn-remove {
    background: none; border: none; color: var(--ps-danger); cursor: pointer;
    font-size: 1rem; line-height: 1; padding: 0 4px;
}

/* Progress bar */
.ps-progress-wrap { width: 100%; background: var(--ps-border); height: 6px; border-radius: 3px; margin-top: 16px; overflow: hidden; }
.ps-progress-bar { width: 0%; height: 100%; background: var(--ps-primary); transition: width 0.3s ease; }

/* Material Grid */
.ps-material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ps-material-card {
    display: flex; flex-direction: column;
    border: 2px solid var(--ps-border); border-radius: 12px;
    padding: 20px; background: var(--ps-card); cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s; position: relative;
}
.ps-material-card input[type="radio"] { position: absolute; opacity: 0; }
.ps-material-card:hover { border-color: var(--ps-primary); box-shadow: 0 4px 12px rgba(37,99,235,0.08); }
.ps-material-card.selected { border-color: var(--ps-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.ps-material-swatch {
    width: 40px; height: 40px; border-radius: 8px;
    margin-bottom: 12px; border: 2px solid var(--ps-border);
}
.ps-material-info strong { display: block; font-size: 0.95rem; margin-bottom: 6px; }
.ps-material-info span { display: block; font-size: 0.8rem; color: var(--ps-text-muted); }
.ps-strength { display: block; margin-top: 6px; font-size: 1.1rem; color: #f59e0b; }
.ps-material-temp { position: absolute; top: 16px; right: 16px; font-size: 0.75rem;
    background: var(--ps-bg); padding: 4px 8px; border-radius: 6px; color: var(--ps-text-muted); border: 1px solid var(--ps-border); }

/* Price Box */
.ps-price-box {
    margin-top: 24px; padding: 24px; border-radius: 12px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff;
}
.ps-price-box h4 { margin: 0 0 16px 0; font-size: 1rem; }
.ps-price-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.875rem; }
.ps-price-row.total { border-top: 2px solid rgba(255,255,255,0.2); border-bottom: none; margin-top: 8px; padding-top: 16px; font-size: 1.1rem; font-weight: 700; }

/* 3D Viewer */
.model-viewer-container { background: var(--ps-bg); border-radius: 12px; overflow: hidden; margin-top: 20px; border: 1px solid var(--ps-border); }

/* License section */
.ps-license-box { background: var(--ps-bg); border-radius: 12px; padding: 24px; }
.ps-radio { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; cursor: pointer; transition: background 0.2s; margin-bottom: 8px; }
.ps-radio:hover { background: #e2e8f0; }
.ps-radio input { width: 18px; height: 18px; accent-color: var(--ps-primary); }

.ps-disclaimer {
    display: flex; gap: 12px; background: #fef3c7; border: 1px solid #fcd34d;
    border-radius: 8px; padding: 16px; font-size: 0.8rem; color: #92400e;
}
.ps-disclaimer svg { flex-shrink: 0; margin-top: 2px; }
.ps-disclaimer p { margin: 0; }

/* Add to Cart */
.ps-add-to-cart-wrap { margin-top: 28px; }
.ps-add-to-cart-wrap .single_add_to_cart_button {
    width: 100%; padding: 16px; font-size: 1.1rem; font-weight: 600; border-radius: 12px;
}

/* Loading / Spinner */
.ps-spinner { display: inline-block; width: 16px; height: 16px;
    border: 2px solid var(--ps-border); border-top-color: var(--ps-primary);
    border-radius: 50%; animation: ps-spin 0.6s linear infinite; }
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 520px) {
    .ps-material-grid { grid-template-columns: 1fr; }
    .ps-dropzone, .ps-license-dropzone { padding: 24px; }
}

/* ===== Dark Upload Wizard Override (Homepage #upload-primary) ===== */
#upload-primary .printshop-upload-section { max-width: none; margin: 0; }
#upload-primary .ps-step { display: none; padding: 0; border-bottom: none; }
#upload-primary #ps-step-upload { display: block; }
#upload-primary .ps-step h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem; font-weight: 600;
    color: #E8F0FF; margin-bottom: 8px;
}
#upload-primary .ps-step h3 .ps-step-icon {
    font-size: 1.2rem; margin-right: 10px; display: inline-block; vertical-align: middle;
    filter: grayscale(0.3);
}
#upload-primary .ps-dropzone {
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 56px 40px;
    text-align: center;
    background: #0E1016;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}
#upload-primary .ps-dropzone:hover {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.03);
}
#upload-primary .ps-dropzone.drag-over {
    border-color: #00E5FF;
    background: rgba(0,229,255,0.04);
    box-shadow: 0 0 60px rgba(99,102,241,0.12);
}
#upload-primary .ps-dropzone p { color: #8C96B8; font-size: 1rem; margin: 0; }
#upload-primary .ps-dropzone .ps-hint { color: #5C6480; font-size: 0.8rem; margin-top: 12px; display: block; }
#upload-primary .ps-file-badges {
    display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap;
}
#upload-primary .ps-file-badge {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px; border-radius: 6px;
    background: rgba(255,255,255,0.06); color: #8C96B8;
    border: 1px solid rgba(255,255,255,0.08);
}
#upload-primary .ps-file-preview {
    display: inline-flex; align-items: center; gap: 12px;
    background: #13161E; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 12px 18px; margin-top: 20px;
    color: #E8F0FF;
}
#upload-primary .ps-file-preview .ps-file-size { color: #5C6480; font-size: 0.75rem; }
#upload-primary .ps-btn-remove { background: none; border: none; color: #EF4444; cursor: pointer; font-size: 1.1rem; }
#upload-primary .ps-progress-wrap {
    width: 100%; background: rgba(255,255,255,0.08); height: 6px; border-radius: 3px;
    margin-top: 20px; overflow: hidden;
}
#upload-primary .ps-progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #00E5FF, #7C3AED); transition: width 0.3s ease; }
/* Hide native file input inside dark upload */
#upload-primary input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; clip: rect(0,0,0,0); }

/* ===== Shop Page Styles ===== */
.ps-shop-wrap { background: #08090C; color: #E8F0FF; padding-bottom: 80px; }
.ps-shop-hero { padding: 80px 0 40px; text-align: center; }
.ps-shop-hero .ps-overline { font-family: 'Space Grotesk', monospace; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #6366F1; margin-bottom: 12px; }
.ps-shop-hero .ps-shop-title { font-size: 3rem; font-weight: 700; margin-bottom: 16px; }
.ps-shop-hero .ps-shop-subtitle { font-size: 1.05rem; color: #8C96B8; max-width: 520px; margin: 0 auto; }
.ps-shop-grid-section { padding: 40px 0; }
.ps-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.ps-product-card {
    background: #0E1016; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ps-product-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); border-color: rgba(99,102,241,0.25); }
.ps-product-img-wrap { display: block; height: 220px; background: #13161E; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ps-product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.ps-product-img-placeholder { color: #4C5268; }
.ps-product-body { padding: 24px; }
.ps-product-tag { font-family: 'Space Grotesk', monospace; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; background: rgba(99,102,241,0.12); color: #00E5FF; display: inline-block; margin-bottom: 12px; }
.ps-product-name { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }
.ps-product-name a { color: #E8F0FF; text-decoration: none; }
.ps-product-name a:hover { color: #00E5FF; }
.ps-product-desc { font-size: 0.85rem; color: #8C96B8; line-height: 1.6; margin-bottom: 16px; }
.ps-product-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ps-product-price { font-family: 'Space Grotesk', monospace; font-size: 0.95rem; font-weight: 600; color: #00E5FF; }
.ps-product-card .ps-btn-primary { width: 100%; text-align: center; }

/* ===== Global Native File Input Hide (all wizard contexts) ===== */
.printshop-upload-wrap input[type="file"],
.printshop-product-wizard input[type="file"],
#ps-file-input, #ps-license-input {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    opacity: 0 !important; pointer-events: none !important;
    clip: rect(0,0,0,0) !important; border: 0 !important;
    padding: 0 !important; margin: -1px !important;
}

/* ===== FILE INPUT ABSOLUTE HIDE ===== */
.printshop-upload-wrap input[type="file"],
.printshop-upload-wrap input[type="file"]::-webkit-file-upload-button {
    position: absolute !important; width: 0 !important; height: 0 !important;
    padding: 0 !important; margin: 0 !important; overflow: hidden !important;
    opacity: 0 !important; border: 0 !important; clip: rect(0 0 0 0) !important;
    pointer-events: none !important; display: block !important;
}

/* ===== DROPZONE ===== */
.ps-dropzone {
    border: 2px dashed rgba(255,255,255,.15);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .25s ease;
    background: rgba(255,255,255,.02);
    position: relative;
}
.ps-dropzone:hover, .ps-dropzone.dragover {
    border-color: #8b5cf6;
    background: rgba(139,92,246,.06);
}
.ps-dropzone svg { color: #8b5cf6; margin-bottom: 14px; }
.ps-dropzone p { margin: 0 0 10px; font-size: .95rem; color: #e5e5e5; }
.ps-dropzone .ps-browse { color: #8b5cf6; font-weight: 600; text-decoration: underline; }
.ps-dropzone .ps-hint { font-size: .75rem; color: #8888a0; }
.ps-file-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.ps-file-badge {
    font-size: .7rem; font-weight: 600; color: #c4b5fd;
    background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.25);
    padding: 4px 10px; border-radius: 20px; letter-spacing: .03em;
}

/* ===== ANALYSIS FEEDBACK ===== */
.ps-analysis-feedback {
    margin-top: 24px; padding: 18px 20px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    animation: psFadeIn .4s ease;
}
@keyframes psFadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

.ps-file-info { display: flex; align-items: center; gap: 14px; }
.ps-file-icon { font-size: 2rem; }
.ps-file-name { font-weight: 600; color: #f0f0f8; font-size: .92rem; word-break: break-all; }
.ps-file-meta { font-size: .78rem; color: #8888a0; margin-top: 3px; }

.ps-analysis-status { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.ps-status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ps-status-dot.uploading { background: #8b5cf6; animation: psPulse 1.2s infinite; }
.ps-status-dot.done { background: #22c55e; }
.ps-status-dot.slicing { background: #f59e0b; animation: psPulse 1.2s infinite; }
@keyframes psPulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.ps-status-text { font-size: .88rem; color: #c4b5fd; font-weight: 500; }
.ps-analysis-sub { font-size: .78rem; color: #6b6b7b; margin-top: 6px; padding-left: 20px; }

/* ===== MATERIAL CARDS ===== */
.ps-mat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ps-mat-tag {
    font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: #a78bfa; background: rgba(139,92,246,.12); padding: 3px 8px; border-radius: 4px;
}
.ps-mat-commercial {
    font-size: .72rem; color: #f59e0b; margin-top: 8px; padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.06);
}

/* ===== SLICER SPINNER ===== */
.ps-slicer-spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(139,92,246,.15);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: psSpin .8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes psSpin { to { transform: rotate(360deg); } }

.ps-status-success { color: #22c55e !important; font-weight: 500; }
.ps-status-fail { color: #ef4444 !important; }
.ps-status-timeout { color: #f59e0b !important; }

/* ===== STEP NAVIGATOR (indicators) ===== */
.ps-steps-nav {
    display: flex; gap: 8px; margin-bottom: 24px;
}
.ps-step-pill {
    font-size: .72rem; font-weight: 600;
    padding: 6px 14px; border-radius: 20px;
    background: rgba(255,255,255,.05); color: #6b6b7b;
    border: 1px solid rgba(255,255,255,.06);
    transition: all .25s ease;
}
.ps-step-pill.active { background: rgba(139,92,246,.15); color: #a78bfa; border-color: rgba(139,92,246,.3); }
.ps-step-pill.done { background: rgba(34,197,94,.1); color: #22c55e; border-color: rgba(34,197,94,.2); }

/* ===== FILE INPUT OVERLAY FIX ===== */
#ps-dropzone { position: relative; }
#ps-file-input {
    position: absolute !important;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0 !important; cursor: pointer !important;
    z-index: 10;
}

/* SAFE FILE INPUT OVERLAY - v2 */
#ps-dropzone,.printshop-upload-wrap{position:relative !important;}
#ps-file-input,.printshop-upload-wrap input[type=file]{
    position:absolute!important;width:100%!important;height:100%!important;
    top:0!important;left:0!important;opacity:0!important;cursor:pointer!important;
    z-index:10!important;display:block!important;pointer-events:auto!important;
    margin:0!important;padding:0!important;border:0!important;background:transparent!important;
}
