/* ==========================================================================
   Calculadora de Costes y Precio de Venta para Impresión 3D
   iDiUtils.com - /assets/css/calculadora-costes-impresion-3d.css
   ========================================================================== */

.c3d-container {
    width: 100%;
    max-width: 100%;
}

.c3d-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .c3d-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Selector de Tecnología (FDM vs Resina) */
.c3d-tech-selector {
    display: flex;
    background: var(--color-bg-secondary, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.75rem;
    gap: 6px;
}

.c3d-tech-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.c3d-tech-btn:hover {
    color: var(--color-text-primary);
}

.c3d-tech-btn.active {
    background: var(--color-primary, #3b38eb);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 56, 235, 0.35);
}

/* Secciones de Parámetros */
.c3d-section {
    background: var(--color-card-bg, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.c3d-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.c3d-section-title i {
    color: var(--color-primary);
}

/* Grid de campos dentro de sección */
.c3d-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.c3d-row:last-child {
    margin-bottom: 0;
}

.c3d-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.c3d-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.c3d-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.c3d-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text-primary);
    background: var(--color-input-bg, rgba(0, 0, 0, 0.2));
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.c3d-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 56, 235, 0.2);
}

.c3d-input-unit {
    position: absolute;
    right: 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    pointer-events: none;
}

.c3d-input.has-unit {
    padding-right: 2.75rem;
}

.c3d-help {
    font-size: 0.76rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Caja de Tarifa Eléctrica en Tiempo Real */
.c3d-elec-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.c3d-elec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.c3d-elec-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #10b981;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.c3d-elec-price-display {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--color-text-primary);
}

.c3d-elec-info {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.c3d-elec-btn-toggle {
    background: transparent;
    border: 1px dashed var(--color-border);
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.c3d-elec-btn-toggle:hover {
    border-color: var(--color-primary);
    background: rgba(59, 56, 235, 0.08);
}

/* Presets rápidos de potencia */
.c3d-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.c3d-preset-chip {
    background: var(--color-bg-secondary, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.c3d-preset-chip:hover {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* Panel Lateral de Resultados */
.c3d-results-panel {
    position: sticky;
    top: 2rem;
    background: var(--color-card-bg, #1e293b);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.c3d-res-main-card {
    background: linear-gradient(135deg, rgba(59, 56, 235, 0.12) 0%, rgba(126, 26, 242, 0.12) 100%);
    border: 1px solid rgba(59, 56, 235, 0.3);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.c3d-res-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.c3d-res-hero-price {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.c3d-res-hero-sub {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Indicadores Secundarios */
.c3d-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.c3d-kpi-item {
    background: var(--color-bg-secondary, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.c3d-kpi-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.c3d-kpi-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

.c3d-kpi-val.profit {
    color: #10b981;
}

/* Barra de Distribución Visual */
.c3d-bar-container {
    width: 100%;
    height: 10px;
    background: var(--color-border);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    margin: 1rem 0;
}

.c3d-bar-slice {
    height: 100%;
    transition: width 0.3s ease;
}

.c3d-bar-mat { background: #3b82f6; }
.c3d-bar-elec { background: #10b981; }
.c3d-bar-wear { background: #f59e0b; }
.c3d-bar-labor { background: #8b5cf6; }
.c3d-bar-risk { background: #ec4899; }

/* Lista de Desglose */
.c3d-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.86rem;
}

.c3d-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed var(--color-border);
}

.c3d-breakdown-row:last-child {
    border-bottom: none;
}

.c3d-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
}

.c3d-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.c3d-item-val {
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Botones de Acción */
.c3d-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.c3d-btn-quote {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.85rem 1.25rem;
    background: #25d366;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.c3d-btn-quote:hover {
    background: #1eb956;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.c3d-btn-print {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-secondary, rgba(255, 255, 255, 0.05));
    color: var(--color-text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.c3d-btn-print:hover {
    background: var(--color-border);
}

/* Toast de Copiado */
.c3d-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #10b981;
    color: #ffffff;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.c3d-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Responsividad en móvil */
@media (max-width: 480px) {
    .c3d-section {
        padding: 1rem;
    }
    .c3d-row {
        grid-template-columns: 1fr;
    }
    .c3d-kpis {
        grid-template-columns: 1fr;
    }
    .c3d-res-hero-price {
        font-size: 2rem;
    }
}
