/* ============================================
   HENX3D - Calculator Bundle
   Consolidated: Progress, Upload, Materials,
   Options, Price, Delivery, Modal, Viewer
   ============================================ */

/* ---- Progress Steps ---- */

.calc-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 3rem;
    max-width: 800px;
    padding: 0 1rem;
}

.calc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.calc-step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.calc-step-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    max-width: 120px;
    transition: all 0.3s ease;
}

.calc-step.active .calc-step-number {
    background: linear-gradient(135deg, #00e5ff, #7b2ff7);
    border-color: var(--color-primary, #00e5ff);
    color: white;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    transform: scale(1.1);
}

.calc-step.active .calc-step-label {
    color: var(--color-primary, #00e5ff);
    font-weight: 600;
}

.calc-step.completed .calc-step-number {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--color-primary, #00e5ff);
    color: var(--color-primary, #00e5ff);
}

.calc-step.completed .calc-step-label {
    color: rgba(0, 229, 255, 0.8);
}

.calc-step.completed .calc-step-number::after {
    content: "\2713";
    position: absolute;
    font-size: 1.5rem;
    color: var(--color-primary, #00e5ff);
}

.calc-step.clickable {
    cursor: pointer;
}

.calc-step.clickable:hover .calc-step-number {
    transform: scale(1.05);
    border-color: var(--color-primary, #00e5ff);
    background: rgba(0, 229, 255, 0.1);
}

.calc-step.clickable:hover .calc-step-label {
    color: var(--color-primary, #00e5ff);
}

.calc-step-connector {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 1rem;
    position: relative;
    max-width: 150px;
}

.calc-step.completed ~ .calc-step-connector {
    background: linear-gradient(90deg, #00e5ff, rgba(0, 229, 255, 0.2));
}

.calc-step-info {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4d4d;
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.calc-step.has-error .calc-step-info {
    display: flex;
}

/* ---- Progress Bar ---- */

.calc-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.calc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00e5ff, #7b2ff7);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* ---- Calculator Container ---- */

.calc-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card, rgba(255,255,255,0.03));
    border: 1px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.calc-panel {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

.calc-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.calc-panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    text-align: center;
}

/* ---- Validation ---- */

.calc-panel .calc-validation-error {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    color: var(--color-error-light, #ff4d4d);
    display: none;
}

.calc-panel .calc-validation-error.show {
    display: block;
    animation: slideIn 0.3s ease;
}

/* ---- Demo Templates ---- */
.demo-templates {
    max-width: 600px;
    margin: 1.5rem auto;
    text-align: center;
}

.demo-templates-label {
    font-size: 0.8rem;
    color: var(--muted, #94a3b8);
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.demo-templates-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.demo-template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    font-family: inherit;
    min-width: 70px;
}

.demo-template-btn:hover {
    border-color: var(--primary, #00e5ff);
    color: var(--primary, #00e5ff);
    background: rgba(0, 229, 255, 0.06);
    transform: translateY(-1px);
}

.demo-template-btn svg {
    opacity: 0.6;
}

.demo-template-btn:hover svg {
    opacity: 1;
    stroke: var(--primary, #00e5ff);
}

/* ---- Upload Section ---- */

.calc-upload-section {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.upload-zone {
    text-align: center;
    padding: 3rem 2rem;
    border: 2px dashed var(--line, rgba(255,255,255,0.15));
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent, #00e5ff);
    background: rgba(0, 229, 255, 0.03);
}

.upload-zone h3 {
    margin: 1rem 0 0.5rem;
    color: var(--text, #e2e8f0);
}

.upload-zone p {
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.calc-upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.calc-file-info {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg, 12px);
    padding: 2rem;
    text-align: center;
}

.calc-file-info .calc-upload-icon {
    color: var(--color-success, #10b981);
    font-size: 3rem;
    animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.calc-file-info h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.calc-file-info p {
    color: var(--muted);
    margin-bottom: 1rem;
}

/* Upload Progress */
.calc-upload-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.calc-upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 0.3s ease;
    position: relative;
}

.calc-upload-progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* ---- Divider ---- */

.calc-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
    color: var(--muted, #94a3b8);
}

.calc-divider::before,
.calc-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--line, rgba(255,255,255,0.1));
}

.calc-divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ---- Form Elements ---- */

.calc-form-section {
    margin-bottom: 3rem;
}

.calc-form-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.calc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.calc-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    margin-bottom: 0.5rem;
}

.calc-form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--muted, #94a3b8);
    margin-top: 0.25rem;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.calc-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text, #e2e8f0);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.calc-input:focus,
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent, #67e8f9);
    background: var(--input-bg-focus, rgba(255,255,255,0.08));
    box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.1);
    transform: translateY(-1px);
}

.calc-input.success {
    border-color: var(--color-success, #10b981);
}

.calc-input.error {
    border-color: var(--color-error, #ef4444);
    animation: shake 0.3s;
}

/* Select Dropdowns */
select.calc-input,
.calc-input select,
select {
    background: var(--input-bg, rgba(255,255,255,0.05)) !important;
    color: var(--text, #e2e8f0) !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2367e8f9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.25rem !important;
    padding-right: 2.5rem !important;
}

select.calc-input:hover,
.calc-input select:hover,
select:hover {
    border-color: var(--accent, #67e8f9);
    background: var(--input-bg-focus, rgba(255,255,255,0.08)) !important;
}

select.calc-input:focus,
.calc-input select:focus,
select:focus {
    outline: none;
    border-color: var(--accent, #67e8f9);
    background: var(--input-bg-focus, rgba(255,255,255,0.08)) !important;
    box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.1);
}

select.calc-input option,
.calc-input select option,
select option {
    background: #1a1f3a !important;
    color: var(--color-text, #e2e8f0) !important;
    padding: 0.75rem !important;
}

/* ---- Material Cards ---- */

.calc-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.calc-material-category {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
}

.calc-material-category:first-child {
    margin-top: 0;
}

.calc-material-category h4 {
    font-size: 1rem;
    color: var(--glow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.calc-material-card {
    display: block;
    position: relative;
    background: var(--card, rgba(255,255,255,0.03));
    border: 2px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-material-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.calc-material-card:hover {
    border-color: rgba(103,232,249,.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103,232,249,.15);
}

.calc-material-card:has(input[type="radio"]:checked),
.calc-material-card.active {
    border-color: rgba(103,232,249,.25) !important;
    background: linear-gradient(180deg, rgba(103,232,249,.15), rgba(103,232,249,.05)) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.15) !important;
    transform: translateY(-2px) !important;
}

.calc-material-card:has(input[type="radio"]:checked):hover,
.calc-material-card.active:hover {
    border-color: rgba(103,232,249,.35) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.25) !important;
    transform: translateY(-3px) !important;
}

.calc-material-card input[type="radio"]:checked ~ .calc-material-content,
.calc-material-card.active .calc-material-content {
    color: var(--accent, #67e8f9);
}

.calc-material-card input[type="radio"]:checked ~ .calc-material-content .calc-material-header h4,
.calc-material-card.active .calc-material-content .calc-material-header h4 {
    color: var(--accent, #67e8f9);
}

.calc-material-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.calc-material-header h4 {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    margin: 0;
}

.calc-material-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent, #67e8f9);
}

.calc-material-description {
    font-size: 0.875rem;
    color: var(--muted, #94a3b8);
    margin: 0;
}

.calc-material-properties {
    margin-top: 0.75rem;
}

.calc-material-properties small {
    font-size: 0.75rem;
    color: var(--muted);
}

.calc-material-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    margin-bottom: 0.5rem;
}

.calc-material-content p {
    font-size: 0.875rem;
    color: var(--muted, #94a3b8);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* ---- Option Cards ---- */

.calc-option-card {
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border: 1px solid var(--line);
    border-radius: var(--radius, 12px);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calc-option-card:hover {
    transform: translateY(-2px);
    border-color: rgba(103,232,249,.25);
    box-shadow: 0 4px 12px rgba(103,232,249,.15);
}

.calc-option-card.active {
    border-color: rgba(103,232,249,.25) !important;
    background: linear-gradient(180deg, rgba(103,232,249,.15), rgba(103,232,249,.05)) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.15) !important;
    transform: translateY(-2px) !important;
}

.calc-option-card.active:hover {
    border-color: rgba(103,232,249,.35) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.25) !important;
    transform: translateY(-3px) !important;
}

.calc-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.calc-option-header h4 {
    font-size: 1.125rem;
    color: var(--text);
    margin: 0;
}

.calc-option-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--glow);
}

.calc-option-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: var(--bg);
}

.calc-option-description {
    color: var(--text);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.calc-option-detail {
    color: var(--muted);
    font-size: 0.875rem;
    margin: 0;
}

.calc-option-properties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.calc-option-properties span {
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,.05);
    border-radius: 4px;
}

/* ---- Radio Cards ---- */

.calc-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.calc-radio-card {
    display: block;
    background: var(--card, rgba(255,255,255,0.03));
    border: 2px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-radio-card:hover {
    border-color: rgba(103,232,249,.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103,232,249,.15);
}

.calc-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.calc-radio-card:has(input[type="radio"]:checked),
.calc-radio-card.active {
    border-color: rgba(103,232,249,.25) !important;
    background: linear-gradient(180deg, rgba(103,232,249,.15), rgba(103,232,249,.05)) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.15) !important;
    transform: translateY(-2px) !important;
}

.calc-radio-card:has(input[type="radio"]:checked):hover,
.calc-radio-card.active:hover {
    border-color: rgba(103,232,249,.35) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.25) !important;
    transform: translateY(-3px) !important;
}

.calc-radio-card input[type="radio"]:checked ~ .calc-radio-content,
.calc-radio-card.active .calc-radio-content {
    color: var(--accent, #67e8f9);
}

.calc-radio-card input[type="radio"]:checked ~ .calc-radio-content strong,
.calc-radio-card.active .calc-radio-content strong {
    color: var(--accent, #67e8f9);
}

.calc-radio-content strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    margin-bottom: 0.25rem;
}

.calc-radio-content p {
    font-size: 0.875rem;
    color: var(--muted, #94a3b8);
    margin: 0;
}

/* ---- Checkbox Cards ---- */

.calc-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.calc-checkbox-card {
    display: block;
    position: relative;
    background: var(--card, rgba(255,255,255,0.03));
    border: 2px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-checkbox-card:hover {
    border-color: var(--accent, #67e8f9);
    background: var(--card-hover, rgba(255,255,255,0.05));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103, 232, 249, 0.15);
}

.calc-checkbox-card:has(input[type="checkbox"]:checked) {
    border-color: rgba(103,232,249,.25) !important;
    background: linear-gradient(180deg, rgba(103,232,249,.15), rgba(103,232,249,.05)) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.15) !important;
    transform: translateY(-2px) !important;
}

.calc-checkbox-card:has(input[type="checkbox"]:checked):hover {
    border-color: rgba(103,232,249,.35) !important;
    box-shadow: 0 4px 12px rgba(103,232,249,.25) !important;
    transform: translateY(-3px) !important;
}

.calc-checkbox-card input[type="checkbox"] {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent, #67e8f9);
}

.calc-checkbox-card input[type="checkbox"]:checked {
    background: var(--accent, #67e8f9);
    border-color: var(--accent, #67e8f9);
}

.calc-checkbox-content {
    padding-right: 2rem;
    transition: all 0.2s ease;
}

.calc-checkbox-content strong {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    margin-bottom: 0.5rem;
}

.calc-checkbox-content p {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent, #67e8f9);
    margin: 0;
}

/* ---- Quality / Shipping / Post-processing Grids ---- */

.calc-quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.calc-shipping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.calc-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.calc-quality-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(103, 232, 249, 0.2);
}

.calc-quality-card:hover h3 {
    color: var(--accent);
}

/* ---- Price Summary ---- */

.calc-price-summary {
    background: linear-gradient(180deg, rgba(0,229,255,.08), rgba(0,229,255,.02));
    border: 1px solid var(--glow);
    border-radius: var(--radius-lg, 12px);
    padding: 2rem;
    margin-top: 3rem;
}

.calc-price-summary h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.calc-price-breakdown {
    background: rgba(0,0,0,.2);
    border-radius: var(--radius, 12px);
    padding: 1.5rem;
}

.calc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--text);
}

.calc-price-row span:first-child {
    color: var(--muted);
}

.calc-price-row span:last-child {
    font-weight: 700;
    font-size: 1rem;
}

.calc-price-positive {
    color: var(--secondary) !important;
}

.calc-price-divider {
    height: 1px;
    background: var(--line);
    margin: 0.5rem 0;
}

.calc-price-subtotal {
    font-size: 1.125rem;
    padding-top: 1rem;
}

.calc-price-total {
    font-size: 1.5rem;
    padding-top: 1rem;
}

.calc-price-total span:last-child {
    color: var(--glow);
    font-size: 2rem;
}

.calc-price-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.calc-price-info p {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.calc-price-info span {
    color: var(--glow);
    font-weight: 600;
}

.calc-price-note {
    font-size: 0.875rem;
    color: var(--muted) !important;
    font-style: italic;
    margin-top: 1rem;
}

/* ---- Summary Box ---- */

.calc-summary {
    background: linear-gradient(135deg,
        rgba(103, 232, 249, 0.08) 0%,
        rgba(84, 200, 240, 0.04) 50%,
        rgba(255,255,255,0.02) 100%);
    border: 2px solid var(--accent, #67e8f9);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(103, 232, 249, 0.15);
}

.calc-summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text, #e2e8f0);
    margin-bottom: 1.5rem;
    text-align: center;
    background: linear-gradient(90deg, var(--accent), #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.calc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    margin: 0.5rem 0;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.calc-summary-row:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.calc-summary-row span:first-child {
    font-size: 0.9375rem;
    color: var(--muted, #94a3b8);
    font-weight: 500;
}

.calc-summary-row span:last-child {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text, #e2e8f0);
}

.calc-summary-row .text-success {
    color: var(--color-success, #10b981) !important;
}

.calc-summary-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent, #67e8f9), transparent);
    margin: 1.5rem 0;
    opacity: 0.5;
}

.calc-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1rem;
    margin-top: 1rem;
    background: linear-gradient(135deg,
        rgba(103, 232, 249, 0.15),
        rgba(84, 200, 240, 0.08));
    border-radius: 12px;
    border: 1px solid var(--accent, #67e8f9);
}

.calc-summary-total span:first-child {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text, #e2e8f0);
}

.calc-summary-total span:last-child {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent, #67e8f9);
    text-shadow: 0 0 20px rgba(103, 232, 249, 0.5);
}

.calc-summary-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    text-align: center;
}

.calc-summary-note p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--muted, #94a3b8);
}

.calc-summary-note strong {
    color: var(--text, #e2e8f0);
    font-weight: 600;
}

.calc-summary-note span {
    color: var(--accent, #67e8f9);
    font-weight: 700;
    font-size: 1.125rem;
}

/* ---- Actions ---- */

.calc-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.calc-actions .btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.calc-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calc-actions .btn-outline {
    background: transparent;
    border: 2px solid var(--line, rgba(255,255,255,0.2));
    color: var(--text, #e2e8f0);
}

.calc-actions .btn-outline:hover {
    border-color: var(--accent, #67e8f9);
    background: rgba(103, 232, 249, 0.1);
    transform: translateY(-2px);
}

.calc-actions .btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.calc-actions .btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.calc-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent, #67e8f9), var(--accent2, #54c8f0));
    border: none;
    color: var(--bg, #0a0e27);
    box-shadow: 0 4px 12px rgba(103, 232, 249, 0.3);
}

.calc-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(103, 232, 249, 0.4);
}

/* ---- Utility / State ---- */

.calc-loading {
    position: relative;
    opacity: 0.6;
}

.calc-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 40px; height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-pulse {
    animation: pulse 2s infinite;
}

.calc-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.calc-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 39, 0.95);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(103, 232, 249, 0.2);
}

.calc-tooltip::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(10, 14, 39, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calc-tooltip:hover::before,
.calc-tooltip:hover::after {
    opacity: 1;
}

.calc-price-animate {
    animation: priceChange 0.3s ease;
}

.calc-radio-card input[type="radio"]:checked ~ .calc-radio-content,
.calc-material-card input:checked ~ .calc-material-content {
    animation: selectBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-reset {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error, #ef4444);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--color-error, #ef4444);
}

.calc-config-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn-config {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-config:hover {
    background: rgba(103, 232, 249, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Delivery Time ---- */

.delivery-time-section {
    margin-top: 2rem;
    animation: slideInUp 0.4s ease;
}

.delivery-time-card {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(103, 232, 249, 0.05));
    border: 2px solid rgba(0, 229, 255, 0.3);
    border-radius: var(--radius-lg, 12px);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.delivery-time-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(103, 232, 249, 0.1) 0%, transparent 70%);
    animation: pulseGlow 3s ease-in-out infinite;
}

.delivery-time-card h3 {
    color: var(--glow);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.delivery-time-text {
    font-size: 1.125rem;
    color: var(--text);
    margin: 1rem 0;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

.delivery-time-text strong {
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 700;
    display: block;
    margin-top: 0.5rem;
}

.delivery-details {
    color: var(--muted);
    font-size: 0.875rem;
    display: block;
    margin-top: 0.75rem;
}

.delivery-disclaimer {
    color: var(--color-text-subtle, #64748b);
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 1.25rem;
    display: block;
    position: relative;
    z-index: 1;
}

.delivery-icon {
    font-size: 2rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    display: inline-block;
    animation: deliveryBounce 2s ease-in-out infinite;
}

.delivery-time-text .loading {
    color: var(--muted);
    font-style: italic;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.delivery-time-text .loading::after {
    content: '';
    width: 16px; height: 16px;
    border: 2px solid rgba(103, 232, 249, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.delivery-warning {
    color: var(--color-warning, #fbbf24);
    font-weight: 600;
}

.delivery-time-card.warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    border-color: rgba(251, 191, 36, 0.3);
}

.delivery-error {
    color: var(--color-error-light, #fca5a5);
    font-weight: 600;
}

.delivery-time-card.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
}

.capacity-indicator {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.capacity-label {
    font-size: 0.875rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.75rem;
    text-align: left;
}

.capacity-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 999px;
    transition: width 0.6s ease;
    position: relative;
}

.capacity-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.capacity-fill.high   { background: linear-gradient(90deg, #ef4444, #dc2626); }
.capacity-fill.medium { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.capacity-fill.low    { background: linear-gradient(90deg, #10b981, #059669); }

.capacity-text {
    font-size: 0.875rem;
    color: var(--text);
    margin-top: 0.5rem;
    display: block;
    text-align: right;
    font-weight: 600;
}

.machine-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 1rem;
}

.machine-info-badge .icon {
    font-size: 1rem;
}

/* ---- Hero (calculator page only) ---- */

.page-calculator .hero {
    position: relative;
    background: transparent;
    color: var(--text, #e2e8f0);
    padding: 3rem 0 2rem 0;
    overflow: hidden;
    min-height: 200px;
}

.page-calculator .hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg,
        rgba(103, 232, 249, 0.03) 0%,
        rgba(84, 200, 240, 0.02) 50%,
        transparent 100%);
    z-index: 0;
}

.page-calculator .hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-calculator .hero-title {
    color: var(--text, #e2e8f0);
    margin-bottom: 1rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(90deg, var(--text, #e2e8f0), #bfe0ff, #b3d8ff, var(--text, #e2e8f0));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
}

.page-calculator .hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--muted, #94a3b8);
    margin-bottom: 0;
    line-height: 1.6;
    font-weight: 400;
}

/* ---- Recommendation Modal ---- */

.recommendation-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10000;
}

.recommendation-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendation-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.recommendation-content {
    position: relative;
    z-index: 1;
    background: var(--card, rgba(15, 23, 42, 0.97));
    border: 1px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.recommendation-content h2 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
}

.recommended-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.recommended-icon {
    font-size: 2.5rem;
}

.recommended-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.recommended-info p {
    margin: 0;
    opacity: 0.7;
    font-size: 0.9rem;
}

.reasoning {
    margin-bottom: 1.5rem;
}

.reasoning h4,
.process-alternatives h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

.reasoning ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reasoning li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

/* ---- Viewer / 3D Preview ---- */

.calculator-viewer-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.viewer-container {
    min-height: 350px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--line, rgba(255,255,255,0.1));
}

#viewer-canvas {
    width: 100%;
    height: 100%;
    min-height: 350px;
    display: block;
}

.analysis-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Viewer Controls (Toolbar) */
.viewer-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.viewer-control-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(10, 14, 39, 0.75);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.viewer-control-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.6);
    color: #fff;
}

.viewer-control-btn.active {
    background: rgba(0, 229, 255, 0.25);
    border-color: #00e5ff;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
    color: #00e5ff;
}

.control-separator {
    width: 100%;
    height: 1px;
    background: rgba(0, 229, 255, 0.15);
    margin: 2px 0;
}

#rotation-controls {
    display: none;
    flex-direction: column;
    gap: 4px;
}

#rotation-controls .viewer-control-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
    font-weight: 700;
    font-family: monospace;
}

/* Viewer Info Bar (bottom) */
.viewer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 1.5rem;
    padding: 6px 14px;
    background: rgba(10, 14, 39, 0.8);
    border-top: 1px solid rgba(0, 229, 255, 0.1);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.viewer-info strong {
    color: rgba(255, 255, 255, 0.8);
}

/* ---- Process Options ---- */

.process-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 0.75rem;
}

.process-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--line, rgba(255,255,255,0.1));
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255,255,255,0.02);
}

.process-option:hover {
    border-color: var(--accent, #00e5ff);
    background: rgba(0, 229, 255, 0.05);
    transform: translateY(-2px);
}

.process-option.active {
    border-color: var(--accent, #00e5ff);
    background: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.process-emoji {
    font-size: 2rem;
}

.process-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

/* ---- Keyframe Animations ---- */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(103, 232, 249, 0.7); }
    50%      { box-shadow: 0 0 0 10px rgba(103, 232, 249, 0); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 0.8; transform: scale(1.1); }
}

@keyframes priceChange {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); color: var(--accent); }
}

@keyframes selectBounce {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

@keyframes successPop {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes deliveryBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

@keyframes shine {
    to { background-position: 200% center; }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .calc-progress {
        flex-direction: column;
        gap: 1.5rem;
    }

    .calc-step-connector {
        width: 2px;
        height: 40px;
        max-width: none;
        margin: 0;
    }

    .calc-step-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .calc-step-label {
        font-size: 0.85rem;
        max-width: 100px;
    }

    .calc-container {
        padding: 1.5rem;
    }

    .calc-form-grid,
    .calc-materials-grid,
    .calc-quality-grid,
    .calc-shipping-grid,
    .calc-option-grid,
    .calc-radio-group,
    .calc-options-grid {
        grid-template-columns: 1fr;
    }

    .calc-actions {
        flex-direction: column;
    }

    .calc-actions .btn {
        width: 100%;
    }

    .calc-price-summary {
        padding: 1.5rem;
    }

    .calc-price-breakdown {
        padding: 1rem;
    }

    .calc-price-total {
        font-size: 1.25rem;
    }

    .calc-price-total span:last-child {
        font-size: 1.5rem;
    }

    .calc-summary {
        padding: 1.5rem;
    }

    .calc-summary-total span:last-child {
        font-size: 1.5rem;
    }

    .calc-tooltip::before {
        bottom: auto;
        top: 125%;
        white-space: normal;
        max-width: 200px;
    }

    .calc-tooltip::after {
        bottom: auto;
        top: 115%;
        border-top-color: transparent;
        border-bottom-color: rgba(10, 14, 39, 0.95);
    }

    .btn-reset {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }

    .page-calculator .hero {
        padding: 2rem 0 1.5rem 0;
    }

    .page-calculator .hero-title {
        font-size: 1.5rem;
    }

    .page-calculator .hero-subtitle {
        font-size: 0.9rem;
    }

    .calculator-viewer-row {
        grid-template-columns: 1fr;
    }

    .viewer-controls {
        top: 8px;
        right: 8px;
        gap: 4px;
    }

    .viewer-control-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .viewer-info {
        font-size: 0.7rem;
        gap: 1rem;
        padding: 4px 10px;
    }

    .process-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .delivery-time-section {
        margin-top: 1.5rem;
    }

    .delivery-time-card {
        padding: 1.5rem;
    }

    .delivery-time-card h3 {
        font-size: 1.125rem;
    }

    .delivery-time-text {
        font-size: 1rem;
    }

    .delivery-time-text strong {
        font-size: 1.125rem;
    }

    .delivery-icon {
        font-size: 1.5rem;
    }

    .capacity-indicator {
        margin-top: 1rem;
        padding-top: 1rem;
    }
}

@media print {
    .delivery-time-section {
        page-break-inside: avoid;
    }

    .delivery-time-card::before {
        display: none;
    }
}
